Skip to content

Commit

Permalink
Replace pub use with wrapper function for API compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity committed Oct 31, 2023
1 parent b63ecf2 commit a0af723
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions ic-agent/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,23 @@ pub mod agent;
pub mod export;
pub mod identity;

use agent::response_authentication::LookupPath;
#[doc(inline)]
pub use agent::{
agent_error, agent_error::AgentError, response_authentication::lookup_value, Agent,
NonceFactory, NonceGenerator,
};
pub use agent::{agent_error, agent_error::AgentError, Agent, NonceFactory, NonceGenerator};
#[doc(inline)]
pub use ic_transport_types::{to_request_id, RequestId, RequestIdError};
#[doc(inline)]
pub use identity::{Identity, Signature};

// Re-export from ic_certification for backward compatibility.
pub use ic_certification::{hash_tree, Certificate};

/// Looks up a value in the certificate's tree at the specified hash.
///
/// Returns the value if it was found; otherwise, errors with `LookupPathAbsent`, `LookupPathUnknown`, or `LookupPathError`.
pub fn lookup_value<P: LookupPath, Storage: AsRef<[u8]>>(
tree: &ic_certification::certificate::Certificate<Storage>,
path: P,
) -> Result<&[u8], AgentError> {
agent::response_authentication::lookup_value(&tree.tree, path)
}

0 comments on commit a0af723

Please sign in to comment.