Extract crate cw-proof

This commit is contained in:
hu55a1n1 2023-12-30 12:33:51 -08:00
parent c62453b782
commit 9417a1e08e
14 changed files with 2591 additions and 10 deletions

2528
utils/cw-proof/Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

16
utils/cw-proof/Cargo.toml Normal file
View file

@ -0,0 +1,16 @@
[package]
name = "cw-proof"
version = "0.1.0"
edition = "2021"
[dependencies]
clap = { version = "4.1.8", features = ["derive"] }
cosmrs = { version = "0.15.0", default-features = false }
ibc-relayer-types = { version = "=0.26.4", default-features = false }
ics23 = { version = "0.11.0", default-features = false }
prost = { version = "0.12.3", default-features = false }
tendermint = { version = "0.34.0", default-features = false }
tendermint-rpc = { version = "0.34.0", default-features = false, features = ["http-client"] }
[dev-dependencies]
hex = { version = "0.4.3", default-features = false }

19
utils/cw-proof/src/lib.rs Normal file
View file

@ -0,0 +1,19 @@
#![no_std]
#![forbid(unsafe_code)]
#![warn(
clippy::checked_conversions,
clippy::panic,
clippy::panic_in_result_fn,
clippy::unwrap_used,
trivial_casts,
trivial_numeric_casts,
rust_2018_idioms,
unused_lifetimes,
unused_import_braces,
unused_qualifications
)]
extern crate alloc;
pub mod proof;
pub mod verifier;

View file

@ -1,3 +1,4 @@
use alloc::{boxed::Box, vec::Vec};
use core::fmt::Debug; use core::fmt::Debug;
use ibc_relayer_types::core::ics23_commitment::error::Error as ProofError; use ibc_relayer_types::core::ics23_commitment::error::Error as ProofError;

View file

@ -1,4 +1,10 @@
use alloc::{
string::{String, ToString},
vec,
vec::Vec,
};
use core::marker::PhantomData; use core::marker::PhantomData;
use cosmrs::AccountId; use cosmrs::AccountId;
use crate::proof::prefix::ConstPrefix; use crate::proof::prefix::ConstPrefix;

View file

@ -1,3 +1,5 @@
use alloc::vec::Vec;
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 tendermint::merkle::proof::ProofOps; use tendermint::merkle::proof::ProofOps;

View file

@ -1,3 +1,5 @@
use alloc::vec::Vec;
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;

View file

@ -1,3 +1,4 @@
use alloc::vec::Vec;
use core::marker::PhantomData; 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;

View file

@ -437,16 +437,27 @@ dependencies = [
"zeroize", "zeroize",
] ]
[[package]]
name = "cw-proof"
version = "0.1.0"
dependencies = [
"clap",
"cosmrs",
"ibc-relayer-types",
"ics23",
"prost",
"tendermint",
"tendermint-rpc",
]
[[package]] [[package]]
name = "cw-prover" name = "cw-prover"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"clap", "clap",
"cosmrs", "cosmrs",
"cw-proof",
"hex", "hex",
"ibc-relayer-types",
"ics23",
"prost",
"serde_json", "serde_json",
"tendermint", "tendermint",
"tendermint-rpc", "tendermint-rpc",

View file

@ -8,9 +8,7 @@ edition = "2021"
[dependencies] [dependencies]
clap = { version = "4.1.8", features = ["derive"] } clap = { version = "4.1.8", features = ["derive"] }
cosmrs = "0.15.0" cosmrs = "0.15.0"
ibc-relayer-types = "=0.26.4" cw-proof = {path = "../cw-proof"}
ics23 = "0.11.0"
prost = "0.12.3"
serde_json = "1.0.108" serde_json = "1.0.108"
tendermint = "0.34.0" tendermint = "0.34.0"
tendermint-rpc = { version = "0.34.0", features = ["http-client"] } tendermint-rpc = { version = "0.34.0", features = ["http-client"] }

View file

@ -14,9 +14,6 @@
unused_qualifications unused_qualifications
)] )]
mod proof;
mod verifier;
use std::{ use std::{
error::Error, error::Error,
fmt::Debug, fmt::Debug,
@ -34,7 +31,7 @@ use tendermint_rpc::{
Client, HttpClientUrl, Client, HttpClientUrl,
}; };
use crate::proof::{cw::RawCwProof, key::CwAbciKey, Proof}; use cw_proof::proof::{cw::RawCwProof, key::CwAbciKey, Proof};
#[derive(Debug, Parser)] #[derive(Debug, Parser)]
#[command(author, version, about, long_about = None)] #[command(author, version, about, long_about = None)]