Skip to content

Commit

Permalink
Merge pull request #15 from r0gue-io/chungquantin/fix-comments
Browse files Browse the repository at this point in the history
fix: public methods documentation
  • Loading branch information
chungquantin authored Oct 4, 2024
2 parents 340d358 + be47f83 commit d94da0e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions crates/pop-drink/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pub use drink::*;
pub use ink_sandbox::api::{assets_api::AssetsAPI};
pub use ink_sandbox::api::assets_api::AssetsAPI;
pub use sp_io::TestExternalities;
pub use frame_support::{self, sp_runtime::DispatchError, assert_ok};
pub use session::{error::SessionError, ContractBundle, Session, NO_SALT};
Expand All @@ -10,12 +10,12 @@ pub mod devnet {
use super::*;
pub use pop_runtime_devnet::{BuildStorage, Runtime};

// Types used in the pop runtime.
/// Types used in the pop runtime.
pub type Balance = BalanceFor<Runtime>;
pub type AccountId = AccountIdFor<Runtime>;

// This is used to resolve type mismatches between the `AccountId` in the quasi testing
// environment and the contract environment.
/// This is used to resolve type mismatches between the `AccountId` in the quasi testing
/// environment and the contract environment.
pub fn account_id_from_slice(s: &AccountId) -> pop_api::primitives::AccountId {
let account: [u8; 32] = s.clone().into();
utils::account_id_from_slice(&account)
Expand Down Expand Up @@ -48,7 +48,7 @@ pub mod utils {
Ok(result.unwrap())
}

// Call a contract method and decode the returned data.
/// Call a contract method and decode the returned data.
pub fn call<S, O, E>(
session: &mut Session<S>,
func_name: &str,
Expand Down Expand Up @@ -77,13 +77,13 @@ pub mod utils {
}
}

// This is used to resolve type mismatches between the `AccountId` in the quasi testing
// environment and the contract environment.
/// This is used to resolve type mismatches between the `AccountId` in the quasi testing
/// environment and the contract environment.
pub fn account_id_from_slice(s: &[u8; 32]) -> pop_api::primitives::AccountId {
pop_api::primitives::AccountId::decode(&mut &s[..]).expect("Should be decoded to AccountId")
}

// Get the last event from pallet contracts.
/// Get the last event from pallet contracts.
pub fn last_contract_event<S>(session: &Session<S>) -> Option<Vec<u8>>
where
S: Sandbox,
Expand Down

0 comments on commit d94da0e

Please sign in to comment.