From ed3736ff353ca6fe912a0efaf779cbe5e276889b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Zemanovi=C4=8D?= Date: Wed, 3 Jan 2024 13:56:46 +0000 Subject: [PATCH] token: add common `write_params` fn --- shielded_token/src/lib.rs | 4 +++- token/src/lib.rs | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/shielded_token/src/lib.rs b/shielded_token/src/lib.rs index 7fe8d56292..6e747b14da 100644 --- a/shielded_token/src/lib.rs +++ b/shielded_token/src/lib.rs @@ -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::*; diff --git a/token/src/lib.rs b/token/src/lib.rs index 6bbaeb07fc..4c0e444a66 100644 --- a/token/src/lib.rs +++ b/token/src/lib.rs @@ -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( + 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) +}