-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add client update CLI * Revert cargo.lock itertools version downgrade * Rename build_from_chain.rs to build.rs * Fix renaming
- Loading branch information
Showing
11 changed files
with
121 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod subcommand; |
23 changes: 23 additions & 0 deletions
23
relayer/crates/starknet-cli/src/commands/client/subcommand.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use hermes_cli_components::impls::commands::client::update::UpdateClientArgs; | ||
use hermes_cli_components::traits::command::{CanRunCommand, CommandRunner}; | ||
|
||
#[derive(Debug, clap::Subcommand)] | ||
pub enum ClientSubCommand { | ||
UpdateClient(UpdateClientArgs), | ||
} | ||
|
||
pub struct RunClientSubCommand; | ||
|
||
impl<App> CommandRunner<App, ClientSubCommand> for RunClientSubCommand | ||
where | ||
App: CanRunCommand<UpdateClientArgs>, | ||
{ | ||
async fn run_command( | ||
app: &App, | ||
subcommand: &ClientSubCommand, | ||
) -> Result<App::Output, App::Error> { | ||
match subcommand { | ||
ClientSubCommand::UpdateClient(args) => app.run_command(args).await, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pub mod client; | ||
pub mod query; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod relay; |
35 changes: 35 additions & 0 deletions
35
relayer/crates/starknet-relayer/src/build/components/relay/build.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use core::marker::PhantomData; | ||
|
||
use hermes_error::HermesError; | ||
use hermes_relayer_components::build::traits::builders::relay_builder::RelayBuilder; | ||
use hermes_relayer_components::multi::types::index::Index; | ||
use hermes_starknet_chain_components::types::client_id::ClientId as StarknetClientId; | ||
use ibc::core::host::types::identifiers::{ChainId, ClientId as CosmosClientId}; | ||
use starknet::core::types::Felt; | ||
|
||
use crate::contexts::builder::{StarknetBuildComponents, StarknetBuilder}; | ||
use crate::contexts::starknet_to_cosmos_relay::StarknetToCosmosRelay; | ||
|
||
impl RelayBuilder<StarknetBuilder, Index<0>, Index<1>> for StarknetBuildComponents { | ||
async fn build_relay( | ||
build: &StarknetBuilder, | ||
_index: PhantomData<(Index<0>, Index<1>)>, | ||
_src_chain_id: &Felt, | ||
dst_chain_id: &ChainId, | ||
src_client_id: &StarknetClientId, | ||
dst_client_id: &CosmosClientId, | ||
) -> Result<StarknetToCosmosRelay, HermesError> { | ||
let src_chain = build.build_chain().await?; | ||
|
||
let dst_chain = build.cosmos_builder.build_chain(dst_chain_id).await?; | ||
|
||
Ok( | ||
build.build_starknet_to_cosmos_relay( | ||
src_chain, | ||
dst_chain, | ||
src_client_id, | ||
dst_client_id, | ||
), | ||
) | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
relayer/crates/starknet-relayer/src/build/components/relay/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod build; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod components; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
extern crate alloc; | ||
|
||
pub mod build; | ||
pub mod contexts; | ||
pub mod impls; | ||
pub mod presets; |