Skip to content

Commit

Permalink
feat(ucli): support memo when submitting eth txs
Browse files Browse the repository at this point in the history
  • Loading branch information
PoisonPhang authored and aeryz committed Jun 5, 2024
1 parent 7ffd2ba commit 82d1332
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ucli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ pub enum EthereumTx {
amount: u64,
#[arg(long)]
denom: String,
#[arg(long)]
memo: String,
},
}

Expand Down
5 changes: 5 additions & 0 deletions ucli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ async fn main() {
receiver,
amount,
denom,
memo,
} => match config.ethereum {
cli::EthereumChainConfig::Mainnet(config) => {
handle_transfer::<Mainnet>(
Expand All @@ -67,6 +68,7 @@ async fn main() {
receiver,
amount,
denom,
memo,
)
.await
}
Expand All @@ -78,6 +80,7 @@ async fn main() {
receiver,
amount,
denom,
memo,
)
.await
}
Expand Down Expand Up @@ -204,6 +207,7 @@ async fn handle_transfer<C: ChainSpec>(
receiver: String,
amount: u64,
denom: String,
memo: String,
) {
let signer_middleware = Arc::new(SignerMiddleware::new(
ethereum.provider.clone(),
Expand Down Expand Up @@ -243,6 +247,7 @@ async fn handle_transfer<C: ChainSpec>(
amount: amount.into(),
}]
.into(),
memo,
Height {
revision_number: 0,
revision_height: 0,
Expand Down
3 changes: 2 additions & 1 deletion zerg/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 82d1332

Please sign in to comment.