More reorg
This commit is contained in:
parent
40a044429a
commit
f964e21a80
9 changed files with 28 additions and 21 deletions
|
@ -15,6 +15,7 @@
|
||||||
)]
|
)]
|
||||||
|
|
||||||
mod proof;
|
mod proof;
|
||||||
|
mod verifier;
|
||||||
|
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
use crate::proof;
|
use core::fmt::Debug;
|
||||||
use crate::proof::key::{IntoKeys, PrefixedKey};
|
|
||||||
use crate::proof::prefix::PrefixWasm;
|
|
||||||
use crate::proof::verifier::cw::CwVerifier;
|
|
||||||
use crate::proof::Proof;
|
|
||||||
use ibc_relayer_types::core::ics23_commitment::error::Error as ProofError;
|
use ibc_relayer_types::core::ics23_commitment::error::Error as ProofError;
|
||||||
use std::fmt::Debug;
|
|
||||||
use tendermint::merkle::proof::ProofOps;
|
use tendermint::merkle::proof::ProofOps;
|
||||||
use tendermint_rpc::endpoint::abci_query::AbciQuery;
|
use tendermint_rpc::endpoint::abci_query::AbciQuery;
|
||||||
|
|
||||||
|
use crate::{
|
||||||
|
proof,
|
||||||
|
proof::key::{IntoKeys, PrefixedKey},
|
||||||
|
proof::prefix::PrefixWasm,
|
||||||
|
proof::Proof,
|
||||||
|
verifier::cw::CwVerifier,
|
||||||
|
};
|
||||||
|
|
||||||
pub type RawCwProof = CwProof<Vec<u8>, Vec<u8>>;
|
pub type RawCwProof = CwProof<Vec<u8>, Vec<u8>>;
|
||||||
|
|
||||||
pub struct CwProof<K, V> {
|
pub struct CwProof<K, V> {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
use core::marker::PhantomData;
|
||||||
|
|
||||||
use crate::proof::prefix::ConstPrefix;
|
use crate::proof::prefix::ConstPrefix;
|
||||||
use std::marker::PhantomData;
|
|
||||||
|
|
||||||
pub trait IntoKeys {
|
pub trait IntoKeys {
|
||||||
fn into_keys(self) -> Vec<Vec<u8>>;
|
fn into_keys(self) -> Vec<Vec<u8>>;
|
||||||
|
|
|
@ -3,9 +3,8 @@ use ics23::CommitmentProof;
|
||||||
use tendermint::merkle::proof::ProofOps;
|
use tendermint::merkle::proof::ProofOps;
|
||||||
|
|
||||||
pub mod cw;
|
pub mod cw;
|
||||||
mod key;
|
pub mod key;
|
||||||
mod prefix;
|
pub mod prefix;
|
||||||
mod verifier;
|
|
||||||
|
|
||||||
// Copied from hermes
|
// Copied from hermes
|
||||||
pub fn convert_tm_to_ics_merkle_proof(
|
pub fn convert_tm_to_ics_merkle_proof(
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
pub struct PrefixWasm;
|
|
||||||
|
|
||||||
pub trait ConstPrefix {
|
pub trait ConstPrefix {
|
||||||
const PREFIX: &'static str;
|
const PREFIX: &'static str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug)]
|
||||||
|
pub struct PrefixWasm;
|
||||||
|
|
||||||
impl ConstPrefix for PrefixWasm {
|
impl ConstPrefix for PrefixWasm {
|
||||||
const PREFIX: &'static str = "wasm";
|
const PREFIX: &'static str = "wasm";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
use ibc_relayer_types::core::ics23_commitment::error::Error as ProofError;
|
use ibc_relayer_types::core::ics23_commitment::error::Error as ProofError;
|
||||||
use ics23::CommitmentProof;
|
use ics23::CommitmentProof;
|
||||||
|
|
||||||
use crate::{
|
use crate::verifier::{ics23::Ics23MembershipVerifier, multi::MultiVerifier, Verifier};
|
||||||
proof::verifier::ics23::Ics23MembershipVerifier, proof::verifier::multi::MultiVerifier,
|
|
||||||
proof::verifier::Verifier,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct CwVerifier(MultiVerifier<Ics23MembershipVerifier<Vec<u8>, Vec<u8>>, 2>);
|
pub struct CwVerifier(MultiVerifier<Ics23MembershipVerifier<Vec<u8>, Vec<u8>>, 2>);
|
|
@ -1,8 +1,12 @@
|
||||||
use crate::proof::verifier::Verifier;
|
use core::marker::PhantomData;
|
||||||
|
|
||||||
use ibc_relayer_types::core::ics23_commitment::error::Error as ProofError;
|
use ibc_relayer_types::core::ics23_commitment::error::Error as ProofError;
|
||||||
use ics23::commitment_proof::Proof;
|
use ics23::{
|
||||||
use ics23::{calculate_existence_root, verify_membership, CommitmentProof, ProofSpec};
|
calculate_existence_root, commitment_proof::Proof, verify_membership, CommitmentProof,
|
||||||
use std::marker::PhantomData;
|
ProofSpec,
|
||||||
|
};
|
||||||
|
|
||||||
|
use crate::verifier::Verifier;
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct Ics23MembershipVerifier<K, V> {
|
pub struct Ics23MembershipVerifier<K, V> {
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::proof::verifier::Verifier;
|
use crate::verifier::Verifier;
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct MultiVerifier<V, const N: usize> {
|
pub struct MultiVerifier<V, const N: usize> {
|
Loading…
Reference in a new issue