Skip to content

Commit

Permalink
fix: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chungquantin committed Oct 3, 2024
1 parent 340d358 commit 315bb65
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions crates/pop-drink/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 315bb65

Please sign in to comment.