From 82d1332c5ef42ca4c8e16075ebe85ee414d60932 Mon Sep 17 00:00:00 2001 From: poisonphang <17688291+PoisonPhang@users.noreply.github.com> Date: Wed, 5 Jun 2024 01:14:48 -0500 Subject: [PATCH] feat(ucli): support memo when submitting eth txs --- ucli/src/cli.rs | 2 ++ ucli/src/main.rs | 5 +++++ zerg/src/context.rs | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ucli/src/cli.rs b/ucli/src/cli.rs index 1c073e54fd..ef9d5d5b7d 100644 --- a/ucli/src/cli.rs +++ b/ucli/src/cli.rs @@ -71,6 +71,8 @@ pub enum EthereumTx { amount: u64, #[arg(long)] denom: String, + #[arg(long)] + memo: String, }, } diff --git a/ucli/src/main.rs b/ucli/src/main.rs index ed4a1b5e43..cd01adcd16 100644 --- a/ucli/src/main.rs +++ b/ucli/src/main.rs @@ -58,6 +58,7 @@ async fn main() { receiver, amount, denom, + memo, } => match config.ethereum { cli::EthereumChainConfig::Mainnet(config) => { handle_transfer::( @@ -67,6 +68,7 @@ async fn main() { receiver, amount, denom, + memo, ) .await } @@ -78,6 +80,7 @@ async fn main() { receiver, amount, denom, + memo, ) .await } @@ -204,6 +207,7 @@ async fn handle_transfer( receiver: String, amount: u64, denom: String, + memo: String, ) { let signer_middleware = Arc::new(SignerMiddleware::new( ethereum.provider.clone(), @@ -243,6 +247,7 @@ async fn handle_transfer( amount: amount.into(), }] .into(), + memo, Height { revision_number: 0, revision_height: 0, diff --git a/zerg/src/context.rs b/zerg/src/context.rs index 01698c0e8c..90f9e6ae14 100644 --- a/zerg/src/context.rs +++ b/zerg/src/context.rs @@ -28,7 +28,7 @@ use queue_msg::{Engine, InMemoryQueue, Queue}; use tendermint_rpc::Client; use tokio::sync::Mutex; use ucs01_relay::msg::{ExecuteMsg, TransferMsg}; -use ucs01_relay_api::types::Ucs01TransferPacket; +use ucs01_relay_api::types::{TransferPacket, Ucs01TransferPacket}; use unionlabs::{ cosmos::base::coin::Coin, cosmwasm::wasm::msg_execute_contract::MsgExecuteContract, ethereum::config::Minimal, events::IbcEvent, google::protobuf::any::Any, traits::Chain, @@ -295,6 +295,7 @@ impl Context { denom: self.denom_address, amount: transfer.tokens()[0].amount.u128(), }], + transfer.extension().to_owned(), ucs01relay::IbcCoreClientV1HeightData { revision_number: 0, revision_height: 3,