-
Notifications
You must be signed in to change notification settings - Fork 951
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
438 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
mod actions; | ||
pub mod context; | ||
pub mod parameters; | ||
pub mod storage; | ||
|
||
use std::cell::RefCell; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//! IBC system parameters | ||
|
||
use namada_core::borsh::{BorshDeserialize, BorshSerialize}; | ||
use namada_core::types::token::Amount; | ||
use namada_state::{StorageRead, StorageResult, StorageWrite}; | ||
|
||
#[derive(Clone, Debug, BorshSerialize, BorshDeserialize)] | ||
/// Governance parameter structure | ||
pub struct IbcParameters { | ||
/// Default supply limit of each token | ||
pub default_mint_limit: Amount, | ||
/// Default per-epoch throughput limit of each token | ||
pub default_per_epoch_throughput_limit: Amount, | ||
} | ||
|
||
impl Default for IbcParameters { | ||
fn default() -> Self { | ||
Self { | ||
default_mint_limit: Amount::zero(), | ||
default_per_epoch_throughput_limit: Amount::zero(), | ||
} | ||
} | ||
} | ||
|
||
impl IbcParameters { | ||
/// Initialize IBC parameters into storage | ||
pub fn init_storage<S>(&self, storage: &mut S) -> StorageResult<()> | ||
where | ||
S: StorageRead + StorageWrite, | ||
{ | ||
let key = crate::storage::params_key(); | ||
storage.write(&key, self) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.