From 6cb58d1f1ce2e63e242ad260ce73bfa3bda02c21 Mon Sep 17 00:00:00 2001 From: futurechimp Date: Wed, 1 Dec 2021 18:19:14 +0000 Subject: [PATCH 1/3] Adding tx_hash to wallet response --- nym-wallet/src-tauri/src/operations/send.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nym-wallet/src-tauri/src/operations/send.rs b/nym-wallet/src-tauri/src/operations/send.rs index a94b9cbda9..e0bdab4b43 100644 --- a/nym-wallet/src-tauri/src/operations/send.rs +++ b/nym-wallet/src-tauri/src/operations/send.rs @@ -17,6 +17,7 @@ pub struct TauriTxResult { gas_used: u64, block_height: u64, details: TransactionDetails, + tx_hash: String, } #[cfg_attr(test, derive(ts_rs::TS))] @@ -34,6 +35,7 @@ impl TauriTxResult { gas_wanted: t.check_tx.gas_wanted.value(), gas_used: t.check_tx.gas_used.value(), block_height: t.height.value(), + tx_hash: t.hash.to_string(), details, } } From c5cdbd5bfe4ce22d15002eb3bc71ba121af1969d Mon Sep 17 00:00:00 2001 From: Dave Hrycyszyn Date: Wed, 1 Dec 2021 18:23:11 +0000 Subject: [PATCH 2/3] Params formatting --- nym-wallet/src-tauri/src/operations/send.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/nym-wallet/src-tauri/src/operations/send.rs b/nym-wallet/src-tauri/src/operations/send.rs index e0bdab4b43..444302ca56 100644 --- a/nym-wallet/src-tauri/src/operations/send.rs +++ b/nym-wallet/src-tauri/src/operations/send.rs @@ -12,31 +12,31 @@ use validator_client::nymd::{AccountId, CosmosCoin}; #[cfg_attr(test, derive(ts_rs::TS))] #[derive(Deserialize, Serialize)] pub struct TauriTxResult { - code: u32, - gas_wanted: u64, - gas_used: u64, block_height: u64, + code: u32, details: TransactionDetails, + gas_used: u64, + gas_wanted: u64, tx_hash: String, } #[cfg_attr(test, derive(ts_rs::TS))] #[derive(Deserialize, Serialize)] pub struct TransactionDetails { + amount: Coin, from_address: String, to_address: String, - amount: Coin, } impl TauriTxResult { fn new(t: Response, details: TransactionDetails) -> TauriTxResult { TauriTxResult { - code: t.check_tx.code.value(), - gas_wanted: t.check_tx.gas_wanted.value(), - gas_used: t.check_tx.gas_used.value(), block_height: t.height.value(), - tx_hash: t.hash.to_string(), + code: t.check_tx.code.value(), details, + gas_used: t.check_tx.gas_used.value(), + gas_wanted: t.check_tx.gas_wanted.value(), + tx_hash: t.hash.to_string(), } } } From b88153a2bdd2594fbd6130349e4e33426348178d Mon Sep 17 00:00:00 2001 From: futurechimp Date: Wed, 1 Dec 2021 18:30:05 +0000 Subject: [PATCH 3/3] [ci skip] Generate TS types --- nym-wallet/src/types/rust/tauritxresult.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/nym-wallet/src/types/rust/tauritxresult.ts b/nym-wallet/src/types/rust/tauritxresult.ts index 5f4ebf3fb0..fd29ca9de3 100644 --- a/nym-wallet/src/types/rust/tauritxresult.ts +++ b/nym-wallet/src/types/rust/tauritxresult.ts @@ -6,4 +6,5 @@ export interface TauriTxResult { gas_used: bigint; block_height: bigint; details: TransactionDetails; + tx_hash: string; } \ No newline at end of file