diff --git a/common/execute/src/lib.rs b/common/execute/src/lib.rs index 7d150077ad..795a72822d 100644 --- a/common/execute/src/lib.rs +++ b/common/execute/src/lib.rs @@ -83,7 +83,7 @@ pub fn execute(attr: TokenStream, item: TokenStream) -> TokenStream { let execute_block = quote! { { let (req, fee) = self.#name(#(#execute_args),*); - let fee = Fee::Auto(Some(self.simulated_gas_multiplier)); + let fee = fee.unwrap_or(Fee::Auto(Some(self.simulated_gas_multiplier))); self.client .execute( self.address(), diff --git a/nym-wallet/src-tauri/src/operations/mixnet/rewards.rs b/nym-wallet/src-tauri/src/operations/mixnet/rewards.rs index 94c6dfc802..adc4612a34 100644 --- a/nym-wallet/src-tauri/src/operations/mixnet/rewards.rs +++ b/nym-wallet/src-tauri/src/operations/mixnet/rewards.rs @@ -4,23 +4,26 @@ use crate::state::State; use mixnet_contract_common::IdentityKey; use std::sync::Arc; use tokio::sync::RwLock; +use validator_client::nymd::Fee; #[tauri::command] pub async fn claim_operator_reward( + fee: Option, state: tauri::State<'_, Arc>>, ) -> Result<(), BackendError> { nymd_client!(state) - .execute_claim_operator_reward(None) + .execute_claim_operator_reward(fee) .await?; Ok(()) } #[tauri::command] pub async fn compound_operator_reward( + fee: Option, state: tauri::State<'_, Arc>>, ) -> Result<(), BackendError> { nymd_client!(state) - .execute_compound_operator_reward(None) + .execute_compound_operator_reward(fee) .await?; Ok(()) } @@ -28,10 +31,11 @@ pub async fn compound_operator_reward( #[tauri::command] pub async fn claim_delegator_reward( mix_identity: IdentityKey, + fee: Option, state: tauri::State<'_, Arc>>, ) -> Result<(), BackendError> { nymd_client!(state) - .execute_claim_delegator_reward(mix_identity, None) + .execute_claim_delegator_reward(mix_identity, fee) .await?; Ok(()) } @@ -39,10 +43,11 @@ pub async fn claim_delegator_reward( #[tauri::command] pub async fn compound_delegator_reward( mix_identity: IdentityKey, + fee: Option, state: tauri::State<'_, Arc>>, ) -> Result<(), BackendError> { nymd_client!(state) - .execute_compound_delegator_reward(mix_identity, None) + .execute_compound_delegator_reward(mix_identity, fee) .await?; Ok(()) } diff --git a/nym-wallet/src-tauri/src/operations/vesting/rewards.rs b/nym-wallet/src-tauri/src/operations/vesting/rewards.rs index 7bebcceb51..e6b27fa78f 100644 --- a/nym-wallet/src-tauri/src/operations/vesting/rewards.rs +++ b/nym-wallet/src-tauri/src/operations/vesting/rewards.rs @@ -4,6 +4,7 @@ use crate::state::State; use mixnet_contract_common::IdentityKey; use std::sync::Arc; use tokio::sync::RwLock; +use validator_client::nymd::Fee; #[tauri::command] pub async fn vesting_claim_operator_reward( @@ -17,10 +18,11 @@ pub async fn vesting_claim_operator_reward( #[tauri::command] pub async fn vesting_compound_operator_reward( + fee: Option, state: tauri::State<'_, Arc>>, ) -> Result<(), BackendError> { nymd_client!(state) - .execute_vesting_compound_operator_reward(None) + .execute_vesting_compound_operator_reward(fee) .await?; Ok(()) } @@ -28,10 +30,11 @@ pub async fn vesting_compound_operator_reward( #[tauri::command] pub async fn vesting_claim_delegator_reward( mix_identity: IdentityKey, + fee: Option, state: tauri::State<'_, Arc>>, ) -> Result<(), BackendError> { nymd_client!(state) - .execute_vesting_claim_delegator_reward(mix_identity, None) + .execute_vesting_claim_delegator_reward(mix_identity, fee) .await?; Ok(()) } @@ -39,10 +42,11 @@ pub async fn vesting_claim_delegator_reward( #[tauri::command] pub async fn vesting_compound_delegator_reward( mix_identity: IdentityKey, + fee: Option, state: tauri::State<'_, Arc>>, ) -> Result<(), BackendError> { nymd_client!(state) - .execute_vesting_compound_delegator_reward(mix_identity, None) + .execute_vesting_compound_delegator_reward(mix_identity, fee) .await?; Ok(()) }