Skip to content

Commit

Permalink
functional call
Browse files Browse the repository at this point in the history
  • Loading branch information
Primata committed Aug 20, 2024
1 parent faa93ff commit b77a10e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion protocol-units/bridge/cli/src/clap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),

}
8 changes: 4 additions & 4 deletions protocol-units/bridge/cli/src/clap/eth_to_movement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand All @@ -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")]
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions protocol-units/bridge/cli/src/eth_to_moveth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
Expand Down
2 changes: 1 addition & 1 deletion protocol-units/bridge/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
}
}
Expand Down
2 changes: 1 addition & 1 deletion protocol-units/bridge/cli/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl From<EthSharedArgs> 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,
Expand Down
2 changes: 1 addition & 1 deletion protocol-units/bridge/cli/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit b77a10e

Please sign in to comment.