Skip to content

Commit

Permalink
token: add common write_params fn
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Jan 3, 2024
1 parent 38c842d commit ed3736f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion shielded_token/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! Namada shielded token.

pub mod conversion;
pub mod storage;
mod storage;
pub mod storage_key;
pub mod utils;

pub use storage::*;
17 changes: 17 additions & 0 deletions token/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,20 @@ pub mod storage_key {
pub use namada_shielded_token::storage_key::*;
pub use namada_trans_token::storage_key::*;
}

use namada_core::types::address::Address;
use namada_storage::{Result, StorageRead, StorageWrite};
use namada_trans_token::Parameters;

/// Initialize parameters for the token in storage during the genesis block.
pub fn write_params<S>(
params: &Parameters,
storage: &mut S,
address: &Address,
) -> Result<()>
where
S: StorageRead + StorageWrite,
{
namada_trans_token::write_params(params, storage, address)?;
namada_shielded_token::write_params(params, storage, address)
}

0 comments on commit ed3736f

Please sign in to comment.