diff --git a/core/src/types/storage.rs b/core/src/types/storage.rs index af0ca63340f..c2cd35fe220 100644 --- a/core/src/types/storage.rs +++ b/core/src/types/storage.rs @@ -11,7 +11,6 @@ use arse_merkle_tree::InternalKey; use borsh::{BorshDeserialize, BorshSchema, BorshSerialize}; use borsh_ext::BorshSerializeExt; use data_encoding::{BASE32HEX_NOPAD, HEXUPPER}; -use ics23::CommitmentProof; use index_set::vec::VecIndexSet; use serde::{Deserialize, Serialize}; use thiserror::Error; @@ -19,7 +18,6 @@ use thiserror::Error; use super::key::common; use crate::bytes::ByteBuf; use crate::hints; -use crate::ledger::eth_bridge::storage::bridge_pool::BridgePoolProof; use crate::types::address::{self, Address}; use crate::types::ethereum_events::{GetEventNonce, TransfersToNamada, Uint}; use crate::types::hash::Hash; @@ -498,26 +496,6 @@ impl From for Vec { } } -/// Type of membership proof from a merkle tree -pub enum MembershipProof { - /// ICS23 compliant membership proof - ICS23(CommitmentProof), - /// Bespoke membership proof for the Ethereum bridge pool - BridgePool(BridgePoolProof), -} - -impl From for MembershipProof { - fn from(proof: CommitmentProof) -> Self { - Self::ICS23(proof) - } -} - -impl From for MembershipProof { - fn from(proof: BridgePoolProof) -> Self { - Self::BridgePool(proof) - } -} - impl Key { /// Parses string and returns a key pub fn parse(string: impl AsRef) -> Result { diff --git a/merkle_tree/src/lib.rs b/merkle_tree/src/lib.rs index f0bbd462082..b7e448b14e3 100644 --- a/merkle_tree/src/lib.rs +++ b/merkle_tree/src/lib.rs @@ -11,6 +11,7 @@ use borsh::{BorshDeserialize, BorshSerialize}; use borsh_ext::BorshSerializeExt; use ics23::commitment_proof::Proof as Ics23Proof; use ics23::{CommitmentProof, ExistenceProof, NonExistenceProof}; +use namada_core::ledger::eth_bridge::storage::bridge_pool::BridgePoolProof; use thiserror::Error; use super::traits::{StorageHasher, SubTreeRead, SubTreeWrite}; @@ -24,10 +25,30 @@ use crate::types::address::{Address, InternalAddress}; use crate::types::hash::Hash; use crate::types::keccak::KeccakHash; use crate::types::storage::{ - self, DbKeySeg, Error as StorageError, Key, MembershipProof, StringKey, - TreeBytes, TreeKeyError, IBC_KEY_LIMIT, + self, DbKeySeg, Error as StorageError, Key, StringKey, TreeBytes, + TreeKeyError, IBC_KEY_LIMIT, }; +/// Type of membership proof from a merkle tree +pub enum MembershipProof { + /// ICS23 compliant membership proof + ICS23(CommitmentProof), + /// Bespoke membership proof for the Ethereum bridge pool + BridgePool(BridgePoolProof), +} + +impl From for MembershipProof { + fn from(proof: CommitmentProof) -> Self { + Self::ICS23(proof) + } +} + +impl From for MembershipProof { + fn from(proof: BridgePoolProof) -> Self { + Self::BridgePool(proof) + } +} + #[allow(missing_docs)] #[derive(Error, Debug)] pub enum Error {