From b77a10ea7ec33b9c7f522cb7b3d7be13128aa1d7 Mon Sep 17 00:00:00 2001 From: primata Date: Tue, 20 Aug 2024 19:01:53 -0300 Subject: [PATCH] functional call --- protocol-units/bridge/cli/src/clap.rs | 2 +- protocol-units/bridge/cli/src/clap/eth_to_movement.rs | 8 ++++---- protocol-units/bridge/cli/src/eth_to_moveth.rs | 4 ++-- protocol-units/bridge/cli/src/main.rs | 2 +- protocol-units/bridge/cli/src/types.rs | 2 +- protocol-units/bridge/cli/tests/integration_tests.rs | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/protocol-units/bridge/cli/src/clap.rs b/protocol-units/bridge/cli/src/clap.rs index f29287d77..aa42febaf 100644 --- a/protocol-units/bridge/cli/src/clap.rs +++ b/protocol-units/bridge/cli/src/clap.rs @@ -13,6 +13,6 @@ pub struct CliOptions { pub enum Commands { /// Ethereum to Movement Labs bridge commands #[command(subcommand)] - BridgeETHtoMOVETH(eth_to_movement::Commands), + Bridge(eth_to_movement::Commands), } diff --git a/protocol-units/bridge/cli/src/clap/eth_to_movement.rs b/protocol-units/bridge/cli/src/clap/eth_to_movement.rs index af4573af7..dc0cbb131 100644 --- a/protocol-units/bridge/cli/src/clap/eth_to_movement.rs +++ b/protocol-units/bridge/cli/src/clap/eth_to_movement.rs @@ -9,7 +9,7 @@ use url::Url; pub struct EthSharedArgs { /// Private key of the Ethereum signer #[arg(long)] - pub eth_signer_private_key: PrivateKeySigner, + pub eth_private_key: PrivateKeySigner, /// URL for the Ethereum RPC #[arg(long, default_value = "http://localhost:8545")] @@ -35,7 +35,7 @@ pub struct EthSharedArgs { #[derive(Args, Clone, Debug)] pub struct MoveSharedArgs { #[arg(long)] - pub move_signer_private_key: String, + pub move_private_key: String, /// URL for the Ethereum RPC #[arg(long, default_value = "http://localhost:8545")] @@ -73,7 +73,7 @@ pub struct CombinedArgs { #[derive(Subcommand)] pub enum Commands { /// Initiate a bridge transfer from Ethereum - BridgeToMovement { + ToMovement { #[command(flatten)] args: EthSharedArgs, /// The recipient address on the movement labs chain @@ -82,7 +82,7 @@ pub enum Commands { amount: u64, }, /// Initiate a bridge transfer from Movement - BridgeToEthereum { + ToEthereum { #[command(flatten)] args: MoveSharedArgs, /// The recipient address on the Ethereum chain diff --git a/protocol-units/bridge/cli/src/eth_to_moveth.rs b/protocol-units/bridge/cli/src/eth_to_moveth.rs index c28a0e070..3c8d795a5 100644 --- a/protocol-units/bridge/cli/src/eth_to_moveth.rs +++ b/protocol-units/bridge/cli/src/eth_to_moveth.rs @@ -14,8 +14,8 @@ use movement_bridge::MovementClient; pub async fn execute(command: &Commands) -> Result<()> { match command { Commands::IniatializeUser { args } => Ok(()), - Commands::BridgeToEthereum { args, recipient, amount } => bridge_to_ethereum(args, recipient, *amount).await, - Commands::BridgeToMovement { args, recipient, amount } => bridge_to_movement(args, recipient, *amount).await, + Commands::ToEthereum { args, recipient, amount } => bridge_to_ethereum(args, recipient, *amount).await, + Commands::ToMovement { args, recipient, amount } => bridge_to_movement(args, recipient, *amount).await, Commands::Resume { args, transfer_id } => resume_swap(args, transfer_id).await, } } diff --git a/protocol-units/bridge/cli/src/main.rs b/protocol-units/bridge/cli/src/main.rs index 79a531321..64ae2983c 100644 --- a/protocol-units/bridge/cli/src/main.rs +++ b/protocol-units/bridge/cli/src/main.rs @@ -13,7 +13,7 @@ async fn inner_main() -> anyhow::Result<()> { let cli = CliOptions::parse(); match &cli.command { - Commands::BridgeETHtoMOVETH(command) => { + Commands::Bridge(command) => { bridge_cli::eth_to_moveth::execute(command).await?; } } diff --git a/protocol-units/bridge/cli/src/types.rs b/protocol-units/bridge/cli/src/types.rs index 208eaff3b..5cdaf5433 100644 --- a/protocol-units/bridge/cli/src/types.rs +++ b/protocol-units/bridge/cli/src/types.rs @@ -13,7 +13,7 @@ impl From for Config { Self { rpc_url: args.eth_rpc_url, ws_url: args.eth_ws_url, - signer_private_key: args.eth_signer_private_key, + signer_private_key: args.eth_private_key, initiator_contract: Some(args.eth_initiator_contract.0), counterparty_contract: Some(args.eth_counterparty_contract.0), gas_limit: args.eth_gas_limit, diff --git a/protocol-units/bridge/cli/tests/integration_tests.rs b/protocol-units/bridge/cli/tests/integration_tests.rs index dc58a45ca..c0ecb5beb 100644 --- a/protocol-units/bridge/cli/tests/integration_tests.rs +++ b/protocol-units/bridge/cli/tests/integration_tests.rs @@ -26,7 +26,7 @@ async fn test_swap() -> eyre::Result<()> { // Set up EthSharedArgs let eth_shared_args = EthSharedArgs { - eth_signer_private_key: wallet.into(), + eth_private_key: wallet.into(), eth_rpc_url: Url::parse(&anvil.endpoint()).unwrap(), eth_ws_url: Url::parse(&anvil.endpoint().replace("http", "ws")).unwrap(), eth_initiator_contract: EthAddress(*initiator_contract.address()),