Skip to content

Commit

Permalink
trans_token: fix VP post move
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Jun 17, 2024
1 parent b7ee532 commit 8088635
Show file tree
Hide file tree
Showing 6 changed files with 166 additions and 77 deletions.
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions crates/core/src/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ pub trait Read<S> {
fn max_signatures_per_transaction(
storage: &S,
) -> Result<Option<u8>, Self::Err>;

/// Helper function to retrieve the `is_native_token_transferable` protocol
/// parameter from storage
fn is_native_token_transferable(storage: &S) -> Result<bool, Self::Err>;
}

/// Abstract parameters storage write interface
Expand Down
4 changes: 4 additions & 0 deletions crates/parameters/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ where
) -> Result<Option<u8>, Self::Err> {
max_signatures_per_transaction(storage)
}

fn is_native_token_transferable(storage: &S) -> Result<bool, Self::Err> {
storage::is_native_token_transferable(storage)
}
}

impl<S> Write<S> for Store<S>
Expand Down
15 changes: 15 additions & 0 deletions crates/trans_token/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,25 @@ migrations = [
[dependencies]
namada_core = { path = "../core" }
namada_events = { path = "../events", default-features = false }
namada_state = { path = "../state" }
namada_storage = { path = "../storage" }
namada_tx = { path = "../tx" }
namada_vp = { path = "../vp" }

konst.workspace = true
linkme = {workspace = true, optional = true}
thiserror.workspace = true
tracing.workspace = true

[dev-dependencies]
namada_core = { path = "../core", features = ["testing"] }
namada_gas = { path = "../gas" }
namada_governance = { path = "../governance", features = ["testing"] }
namada_ibc = { path = "../ibc", features = ["testing"] }
namada_parameters = { path = "../parameters", features = ["testing"] }
namada_state = { path = "../state", features = ["testing"] }
namada_storage = { path = "../storage", features = ["testing"] }
namada_tx = { path = "../tx", features = ["testing"] }
namada_vm = { path = "../vm", features = ["testing"] }

assert_matches.workspace = true
1 change: 1 addition & 0 deletions crates/trans_token/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
pub mod event;
mod storage;
pub mod storage_key;
pub mod vp;

use std::marker::PhantomData;

Expand Down
Loading

0 comments on commit 8088635

Please sign in to comment.