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 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 cosmrs::AccountId;
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 ics23::CommitmentProof;
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 ics23::CommitmentProof;

View file

@ -1,3 +1,4 @@
use alloc::vec::Vec;
use core::marker::PhantomData;
use ibc_relayer_types::core::ics23_commitment::error::Error as ProofError;

View file

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

View file

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

View file

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