diff --git a/shared/src/ledger/ibc/vp/mod.rs b/shared/src/ledger/ibc/vp/mod.rs index 5986a01771..af83e570f0 100644 --- a/shared/src/ledger/ibc/vp/mod.rs +++ b/shared/src/ledger/ibc/vp/mod.rs @@ -17,7 +17,7 @@ use namada_core::ledger::ibc::{ use namada_core::ledger::storage::write_log::StorageModification; use namada_core::ledger::storage::{self as ledger_storage, StorageHasher}; use namada_core::proto::Tx; -use namada_core::types::address::{Address, InternalAddress}; +use namada_core::types::address::Address; use namada_core::types::storage::Key; use namada_proof_of_stake::read_pos_params; use thiserror::Error; @@ -68,8 +68,6 @@ where { type Error = Error; - const ADDR: InternalAddress = InternalAddress::Ibc; - fn validate_tx( &self, tx_data: &Tx, @@ -283,8 +281,8 @@ mod tests { }; use super::{get_dummy_header, *}; use crate::core::ledger::storage::testing::TestWlStorage; - use crate::core::types::address::nam; use crate::core::types::address::testing::established_address_1; + use crate::core::types::address::{nam, InternalAddress}; use crate::core::types::storage::Epoch; use crate::ibc::applications::transfer::acknowledgement::TokenTransferAcknowledgement; use crate::ibc::applications::transfer::coin::PrefixedCoin; diff --git a/shared/src/ledger/ibc/vp/token.rs b/shared/src/ledger/ibc/vp/token.rs index 18234abd35..1c9cc5bc1d 100644 --- a/shared/src/ledger/ibc/vp/token.rs +++ b/shared/src/ledger/ibc/vp/token.rs @@ -80,8 +80,6 @@ where { type Error = Error; - const ADDR: InternalAddress = InternalAddress::IbcBurn; - fn validate_tx( &self, tx_data: &Tx, diff --git a/shared/src/ledger/native_vp/ethereum_bridge/bridge_pool_vp.rs b/shared/src/ledger/native_vp/ethereum_bridge/bridge_pool_vp.rs index 283cf52c58..e662c06667 100644 --- a/shared/src/ledger/native_vp/ethereum_bridge/bridge_pool_vp.rs +++ b/shared/src/ledger/native_vp/ethereum_bridge/bridge_pool_vp.rs @@ -269,8 +269,6 @@ where { type Error = Error; - const ADDR: InternalAddress = InternalAddress::EthBridgePool; - fn validate_tx( &self, tx: &Tx, diff --git a/shared/src/ledger/native_vp/ethereum_bridge/vp.rs b/shared/src/ledger/native_vp/ethereum_bridge/vp.rs index 47eed29f3c..c382fed66f 100644 --- a/shared/src/ledger/native_vp/ethereum_bridge/vp.rs +++ b/shared/src/ledger/native_vp/ethereum_bridge/vp.rs @@ -9,7 +9,7 @@ use namada_core::ledger::eth_bridge::storage::{ }; use namada_core::ledger::storage::traits::StorageHasher; use namada_core::ledger::{eth_bridge, storage as ledger_storage}; -use namada_core::types::address::{Address, InternalAddress}; +use namada_core::types::address::Address; use namada_core::types::storage::Key; use namada_core::types::token::{balance_key, Amount, Change}; @@ -110,8 +110,6 @@ where { type Error = Error; - const ADDR: InternalAddress = eth_bridge::INTERNAL_ADDRESS; - /// Validate that a wasm transaction is permitted to change keys under this /// account. /// diff --git a/shared/src/ledger/native_vp/governance/mod.rs b/shared/src/ledger/native_vp/governance/mod.rs index 7d9323f256..d41242a477 100644 --- a/shared/src/ledger/native_vp/governance/mod.rs +++ b/shared/src/ledger/native_vp/governance/mod.rs @@ -16,7 +16,7 @@ use crate::ledger::native_vp::{Ctx, NativeVp}; use crate::ledger::storage_api::StorageRead; use crate::ledger::{native_vp, pos}; use crate::proto::Tx; -use crate::types::address::{Address, InternalAddress}; +use crate::types::address::Address; use crate::types::storage::{Epoch, Key}; use crate::types::token; use crate::vm::WasmCacheAccess; @@ -50,8 +50,6 @@ where { type Error = Error; - const ADDR: InternalAddress = InternalAddress::Governance; - fn validate_tx( &self, tx_data: &Tx, diff --git a/shared/src/ledger/native_vp/mod.rs b/shared/src/ledger/native_vp/mod.rs index dcc0432ea7..98d3093134 100644 --- a/shared/src/ledger/native_vp/mod.rs +++ b/shared/src/ledger/native_vp/mod.rs @@ -21,7 +21,7 @@ use crate::ledger::storage; use crate::ledger::storage::write_log::WriteLog; use crate::ledger::storage::{Storage, StorageHasher}; use crate::proto::Tx; -use crate::types::address::{Address, InternalAddress}; +use crate::types::address::Address; use crate::types::hash::Hash; use crate::types::storage::{ BlockHash, BlockHeight, Epoch, Header, Key, TxIndex, @@ -36,9 +36,6 @@ pub type Error = storage_api::Error; /// A native VP module should implement its validation logic using this trait. pub trait NativeVp { - /// The address of this VP - const ADDR: InternalAddress; - /// Error type for the methods' results. type Error: std::error::Error; diff --git a/shared/src/ledger/native_vp/parameters.rs b/shared/src/ledger/native_vp/parameters.rs index d367c16698..bb1db0ab30 100644 --- a/shared/src/ledger/native_vp/parameters.rs +++ b/shared/src/ledger/native_vp/parameters.rs @@ -4,7 +4,7 @@ use std::collections::BTreeSet; use namada_core::ledger::storage; use namada_core::proto::Tx; -use namada_core::types::address::{Address, InternalAddress}; +use namada_core::types::address::Address; use namada_core::types::storage::Key; use thiserror::Error; @@ -41,8 +41,6 @@ where { type Error = Error; - const ADDR: InternalAddress = InternalAddress::Parameters; - fn validate_tx( &self, tx_data: &Tx, diff --git a/shared/src/ledger/native_vp/replay_protection.rs b/shared/src/ledger/native_vp/replay_protection.rs index 9b300e376b..a2a2a66f36 100644 --- a/shared/src/ledger/native_vp/replay_protection.rs +++ b/shared/src/ledger/native_vp/replay_protection.rs @@ -3,7 +3,7 @@ use std::collections::BTreeSet; use namada_core::ledger::storage; -use namada_core::types::address::{Address, InternalAddress}; +use namada_core::types::address::Address; use namada_core::types::storage::Key; use thiserror::Error; @@ -40,8 +40,6 @@ where { type Error = Error; - const ADDR: InternalAddress = InternalAddress::ReplayProtection; - fn validate_tx( &self, _tx_data: &Tx, diff --git a/shared/src/ledger/native_vp/slash_fund.rs b/shared/src/ledger/native_vp/slash_fund.rs index bed71d3bd9..8f2ab54400 100644 --- a/shared/src/ledger/native_vp/slash_fund.rs +++ b/shared/src/ledger/native_vp/slash_fund.rs @@ -11,7 +11,7 @@ use crate::ledger::native_vp::{self, governance, Ctx, NativeVp}; use crate::ledger::storage::{self as ledger_storage, StorageHasher}; use crate::ledger::storage_api::StorageRead; use crate::proto::Tx; -use crate::types::address::{Address, InternalAddress}; +use crate::types::address::Address; use crate::types::storage::Key; use crate::types::token; use crate::vm::WasmCacheAccess; @@ -45,8 +45,6 @@ where { type Error = Error; - const ADDR: InternalAddress = InternalAddress::SlashFund; - fn validate_tx( &self, tx_data: &Tx, diff --git a/shared/src/ledger/pos/vp.rs b/shared/src/ledger/pos/vp.rs index dda3497027..18085c5c53 100644 --- a/shared/src/ledger/pos/vp.rs +++ b/shared/src/ledger/pos/vp.rs @@ -89,8 +89,6 @@ where { type Error = Error; - const ADDR: InternalAddress = InternalAddress::PoS; - fn validate_tx( &self, tx_data: &Tx, @@ -101,7 +99,7 @@ where // use validation::DataUpdate::{self, *}; // use validation::ValidatorUpdate::*; - let addr = Address::Internal(Self::ADDR); + let addr = Address::Internal(InternalAddress::PoS); // let mut changes: Vec = vec![]; let _current_epoch = self.ctx.pre().get_block_epoch()?;