PR comments

This commit is contained in:
durch
2022-06-06 12:38:33 +02:00
parent 184dd7767d
commit 282b18660f
3 changed files with 17 additions and 8 deletions
+1 -1
View File
@@ -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(),
@@ -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<Fee>,
state: tauri::State<'_, Arc<RwLock<State>>>,
) -> 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<Fee>,
state: tauri::State<'_, Arc<RwLock<State>>>,
) -> 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<Fee>,
state: tauri::State<'_, Arc<RwLock<State>>>,
) -> 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<Fee>,
state: tauri::State<'_, Arc<RwLock<State>>>,
) -> Result<(), BackendError> {
nymd_client!(state)
.execute_compound_delegator_reward(mix_identity, None)
.execute_compound_delegator_reward(mix_identity, fee)
.await?;
Ok(())
}
@@ -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<Fee>,
state: tauri::State<'_, Arc<RwLock<State>>>,
) -> 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<Fee>,
state: tauri::State<'_, Arc<RwLock<State>>>,
) -> 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<Fee>,
state: tauri::State<'_, Arc<RwLock<State>>>,
) -> Result<(), BackendError> {
nymd_client!(state)
.execute_vesting_compound_delegator_reward(mix_identity, None)
.execute_vesting_compound_delegator_reward(mix_identity, fee)
.await?;
Ok(())
}