Skip to content

Commit

Permalink
Refacotor create vp client (#473)
Browse files Browse the repository at this point in the history
* add todo note

* fix cargo check

* refactor error handler

* should build_* function return Option<Any> value

* Add refactor create client add only-init-vp optional

* remove relate create vp client code

* revert should build_* function return Option<Any> value modify

* Update

---------

Co-authored-by: Yuanchao Sun <[email protected]>
  • Loading branch information
DaviRain-Su and en authored Dec 27, 2023
1 parent 6d37853 commit eea78d0
Show file tree
Hide file tree
Showing 20 changed files with 1,122 additions and 848 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions crates/relayer-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ telemetry = ["ibc-relayer/telemetry", "ibc-telemetry"]
rest-server = ["ibc-relayer-rest"]

[dependencies]
ibc-proto = { version = "0.38.0", features = ["serde"] }
ibc-relayer-types = { version = "0.26.3", path = "../relayer-types" }
ibc-relayer = { version = "0.26.3", path = "../relayer" }
ibc-telemetry = { version = "0.26.3", path = "../telemetry", optional = true }
Expand Down Expand Up @@ -55,6 +56,9 @@ tokio = { version = "1.0", features = ["full"] }
tracing = "0.1.36"
tracing-subscriber = { version = "0.3.14", features = ["fmt", "env-filter", "json"]}
time = "0.3"
prost = { version = "0.12" }
ic-agent = { version = "0.29.0", features = ["pem"] }

[dependencies.tendermint]
version = "0.34.0"
features = ["secp256k1"]
Expand Down
8 changes: 4 additions & 4 deletions crates/relayer-cli/src/commands/keys/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ use crate::conclude::Output;
#[derive(Clone, Command, Debug, Parser, PartialEq, Eq)]
#[clap(override_usage = "Add a key from a Comet keyring file:
hermes keys add [OPTIONS] --chain <CHAIN_ID> --key-file <KEY_FILE>
Add a key from a file containing its mnemonic:
hermes keys add [OPTIONS] --chain <CHAIN_ID> --mnemonic-file <MNEMONIC_FILE>
On *nix platforms, both flags also accept `/dev/stdin` as a value, which will read the key or the mnemonic from stdin.")]
pub struct KeysAddCmd {
#[clap(
Expand Down Expand Up @@ -205,7 +205,7 @@ pub fn add_key(
overwrite: bool,
) -> eyre::Result<AnySigningKeyPair> {
let key_pair = match config.r#type {
ChainType::CosmosSdk | ChainType::Vp => {
ChainType::CosmosSdk => {
let mut keyring = KeyRing::new_secp256k1(
Store::Test,
&config.account_prefix,
Expand Down Expand Up @@ -256,7 +256,7 @@ pub fn restore_key(
fs::read_to_string(mnemonic).map_err(|_| eyre!("error reading the mnemonic file"))?;

let key_pair = match config.r#type {
ChainType::CosmosSdk | ChainType::Vp => {
ChainType::CosmosSdk => {
let mut keyring = KeyRing::new_secp256k1(
Store::Test,
&config.account_prefix,
Expand Down
4 changes: 2 additions & 2 deletions crates/relayer-cli/src/commands/keys/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl Runnable for KeysDeleteCmd {

pub fn delete_key(config: &ChainConfig, key_name: &str) -> eyre::Result<()> {
match config.r#type {
ChainType::CosmosSdk | ChainType::Vp => {
ChainType::CosmosSdk => {
let mut keyring = KeyRing::new_secp256k1(
Store::Test,
&config.account_prefix,
Expand All @@ -138,7 +138,7 @@ pub fn delete_key(config: &ChainConfig, key_name: &str) -> eyre::Result<()> {

pub fn delete_all_keys(config: &ChainConfig) -> eyre::Result<()> {
match config.r#type {
ChainType::CosmosSdk | ChainType::Vp => {
ChainType::CosmosSdk => {
let mut keyring = KeyRing::new_secp256k1(
Store::Test,
&config.account_prefix,
Expand Down
Loading

0 comments on commit eea78d0

Please sign in to comment.