Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: moved helpers to utils package #127

Merged
merged 3 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 11 additions & 132 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ union-protos = { package = "protos", git = "https://github.com/unionlabs/union",
# Other dependencies
reqwest = { version = "0.12", features = ["json"] }
tokio = { version = "1", features = ["full"] }
async-trait = "0.1"
time = { version = "0.3", default-features = false, features = ["macros", "parsing"] }
alloy-primitives = "0.8"
alloy-contract = "0.5"
Expand Down
6 changes: 1 addition & 5 deletions operator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ tendermint = { workspace = true }
tendermint-rpc = { workspace = true }
tendermint-light-client-verifier = { workspace = true }

ibc-client-tendermint = { workspace = true }
ibc-client-tendermint-types = { workspace = true }
ibc-core-client-types = { workspace = true }
ibc-core-commitment-types = { workspace = true }
ibc-core-host-types = { workspace = true, features = ["std"] }
ibc-core-host-cosmos = { workspace = true }

sp1-ics07-tendermint-update-client = { workspace = true }
sp1-ics07-tendermint-solidity = { workspace = true, features = ["rpc"] }
sp1-ics07-tendermint-utils = { workspace = true }
sp1-ics07-tendermint-prover = { workspace = true }
Expand All @@ -41,7 +38,6 @@ futures = { workspace = true }
serde_json = { workspace = true }
serde = { workspace = true }
serde_with = { workspace = true }
sha2 = { workspace = true }
dotenv = { workspace = true }
subtle-encoding = { workspace = true }
anyhow = { workspace = true }
Expand Down
5 changes: 0 additions & 5 deletions operator/src/helpers/mod.rs

This file was deleted.

2 changes: 0 additions & 2 deletions operator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
#![deny(missing_docs, clippy::nursery, clippy::pedantic, warnings)]

pub mod cli;
pub mod helpers;
pub(crate) mod rpc;
pub mod runners;
8 changes: 4 additions & 4 deletions operator/src/runners/fixtures/membership.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

use crate::{
cli::command::{fixtures::MembershipCmd, OutputPath},
helpers::union::convert_to_union_proof,
rpc::TendermintRpcExt,
runners::genesis::SP1ICS07TendermintGenesis,
};
use alloy_sol_types::SolValue;
use core::str;
use ibc_client_tendermint::types::ConsensusState;
use ibc_client_tendermint_types::ConsensusState;
use ibc_core_commitment_types::merkle::MerkleProof;
use serde::{Deserialize, Serialize};
use sp1_ics07_tendermint_prover::{programs::MembershipProgram, prover::SP1ICS07TendermintProver};
Expand All @@ -19,7 +17,9 @@ use sp1_ics07_tendermint_solidity::{
},
ISP1Msgs::SP1Proof,
};
use sp1_ics07_tendermint_utils::convert_tm_to_ics_merkle_proof;
use sp1_ics07_tendermint_utils::{
merkle::convert_tm_to_ics_merkle_proof, rpc::TendermintRpcExt, union::convert_to_union_proof,
};
use sp1_sdk::HashableKey;
use std::path::PathBuf;
use tendermint_rpc::{Client, HttpClient};
Expand Down
5 changes: 2 additions & 3 deletions operator/src/runners/fixtures/misbehaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

use crate::{
cli::command::{fixtures::MisbehaviourCmd, OutputPath},
helpers::light_block::LightBlockExt,
rpc::TendermintRpcExt,
runners::genesis::SP1ICS07TendermintGenesis,
};
use alloy_sol_types::SolValue;
use ibc_client_tendermint::types::Misbehaviour;
use ibc_client_tendermint_types::Misbehaviour;
use ibc_proto::ibc::lightclients::tendermint::v1::Misbehaviour as RawMisbehaviour;
use serde::{Deserialize, Serialize};
use sp1_ics07_tendermint_prover::{
Expand All @@ -18,6 +16,7 @@ use sp1_ics07_tendermint_solidity::{
IMisbehaviourMsgs::MsgSubmitMisbehaviour,
ISP1Msgs::SP1Proof,
};
use sp1_ics07_tendermint_utils::{light_block::LightBlockExt, rpc::TendermintRpcExt};
use sp1_sdk::HashableKey;
use std::path::PathBuf;
use tendermint_rpc::HttpClient;
Expand Down
7 changes: 3 additions & 4 deletions operator/src/runners/fixtures/uc_and_mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

use crate::{
cli::command::{fixtures::UpdateClientAndMembershipCmd, OutputPath},
helpers::light_block::LightBlockExt,
rpc::TendermintRpcExt,
runners::{
fixtures::membership::SP1ICS07MembershipFixture, genesis::SP1ICS07TendermintGenesis,
},
};
use alloy_sol_types::SolValue;
use core::str;
use ibc_client_tendermint::types::ConsensusState;
use ibc_client_tendermint_types::ConsensusState;
use ibc_core_commitment_types::merkle::MerkleProof;
use sp1_ics07_tendermint_prover::{
programs::UpdateClientAndMembershipProgram, prover::SP1ICS07TendermintProver,
Expand All @@ -21,7 +19,8 @@ use sp1_ics07_tendermint_solidity::{
ISP1Msgs::SP1Proof,
IUpdateClientAndMembershipMsgs::UcAndMembershipOutput,
};
use sp1_ics07_tendermint_utils::convert_tm_to_ics_merkle_proof;
use sp1_ics07_tendermint_utils::merkle::convert_tm_to_ics_merkle_proof;
use sp1_ics07_tendermint_utils::{light_block::LightBlockExt, rpc::TendermintRpcExt};
use sp1_sdk::HashableKey;
use std::path::PathBuf;
use tendermint_rpc::{Client, HttpClient};
Expand Down
3 changes: 1 addition & 2 deletions operator/src/runners/fixtures/update_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

use crate::{
cli::command::{fixtures::UpdateClientCmd, OutputPath},
helpers::light_block::LightBlockExt,
rpc::TendermintRpcExt,
runners::genesis::SP1ICS07TendermintGenesis,
};
use alloy_sol_types::SolValue;
Expand All @@ -16,6 +14,7 @@ use sp1_ics07_tendermint_solidity::{
ISP1Msgs::SP1Proof,
IUpdateClientMsgs::{MsgUpdateClient, UpdateClientOutput},
};
use sp1_ics07_tendermint_utils::{light_block::LightBlockExt, rpc::TendermintRpcExt};
use sp1_sdk::HashableKey;
use std::path::PathBuf;
use tendermint_rpc::HttpClient;
Expand Down
7 changes: 2 additions & 5 deletions operator/src/runners/genesis.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
//! Contains the runner for the genesis command.

use crate::{
cli::command::{genesis::Args, OutputPath},
helpers::light_block::LightBlockExt,
rpc::TendermintRpcExt,
};
use crate::cli::command::{genesis::Args, OutputPath};
use alloy_sol_types::SolValue;
use sp1_ics07_tendermint_prover::programs::{
MembershipProgram, MisbehaviourProgram, SP1Program, UpdateClientAndMembershipProgram,
UpdateClientProgram,
};
use sp1_ics07_tendermint_solidity::IICS07TendermintMsgs::ConsensusState as SolConsensusState;
use sp1_ics07_tendermint_utils::{light_block::LightBlockExt, rpc::TendermintRpcExt};
use sp1_sdk::{utils::setup_logger, HashableKey};
use std::path::PathBuf;
use tendermint_light_client_verifier::types::{LightBlock, TrustThreshold};
Expand Down
Loading
Loading