fix remaining lint and cargo clippy errors
This commit is contained in:
@@ -253,6 +253,7 @@ impl Config {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::to_string_in_format_args)]
|
||||
pub fn set_default_nyxd_url(&mut self, nyxd_url: Url, network: &WalletNetwork) {
|
||||
log::debug!(
|
||||
"set default nyxd URL for {network} {}",
|
||||
@@ -310,7 +311,7 @@ impl Config {
|
||||
self.networks.get(&network.as_key()).and_then(|config| {
|
||||
log::debug!(
|
||||
"get selected nyxd url for {} {:?}",
|
||||
network.to_string(),
|
||||
network,
|
||||
config.selected_nyxd_url,
|
||||
);
|
||||
config.selected_nyxd_url.clone()
|
||||
@@ -321,7 +322,7 @@ impl Config {
|
||||
self.networks.get(&network.as_key()).and_then(|config| {
|
||||
log::debug!(
|
||||
"get default nyxd url for {} {:?}",
|
||||
network.to_string(),
|
||||
network,
|
||||
config.default_nyxd_url,
|
||||
);
|
||||
config.default_nyxd_url.clone()
|
||||
|
||||
@@ -129,7 +129,6 @@ fn main() {
|
||||
nym_api::status::compute_mixnode_reward_estimation,
|
||||
nym_api::status::gateway_core_node_status,
|
||||
nym_api::status::mixnode_core_node_status,
|
||||
nym_api::status::mixnode_inclusion_probability,
|
||||
nym_api::status::mixnode_reward_estimation,
|
||||
nym_api::status::mixnode_stake_saturation,
|
||||
nym_api::status::mixnode_status,
|
||||
|
||||
@@ -4,6 +4,7 @@ use tauri::menu::{MenuBuilder, MenuItemBuilder, SubmenuBuilder};
|
||||
pub const SHOW_LOG_WINDOW: &str = "show_log_window";
|
||||
|
||||
pub trait AddDefaultSubmenus {
|
||||
#[allow(dead_code)]
|
||||
fn add_default_app_submenus(self) -> Self;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ pub async fn send(
|
||||
.nyxd
|
||||
.send(&to_address, vec![amount_base], memo, fee)
|
||||
.await?;
|
||||
log::info!("<<< tx hash = {}", raw_res.hash.to_string());
|
||||
log::info!("<<< tx hash = {}", raw_res.hash);
|
||||
let res = SendTxResult::new(
|
||||
raw_res,
|
||||
TransactionDetails::new(amount, from_address, to_address.to_string()),
|
||||
|
||||
@@ -109,18 +109,6 @@ pub async fn mixnode_stake_saturation(
|
||||
.await?)
|
||||
}
|
||||
|
||||
// TODO: fix later (yeah...)
|
||||
#[allow(deprecated)]
|
||||
#[tauri::command]
|
||||
pub async fn mixnode_inclusion_probability(
|
||||
mix_id: NodeId,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
) -> Result<nym_validator_client::models::InclusionProbabilityResponse, BackendError> {
|
||||
Ok(api_client!(state)
|
||||
.get_mixnode_inclusion_probability(mix_id)
|
||||
.await?)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn get_nymnode_role(
|
||||
node_id: NodeId,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useState } from 'react';
|
||||
import { useSnackbar } from 'notistack';
|
||||
import { decimalToPercentage, InclusionProbabilityResponse, MixnodeStatus } from '@nymproject/types';
|
||||
import { getInclusionProbability, getMixnodeStakeSaturation, getMixnodeStatus } from '../../requests';
|
||||
import { getMixnodeStakeSaturation, getMixnodeStatus } from '../../requests';
|
||||
|
||||
export const useSettingsState = () => {
|
||||
const [status, setStatus] = useState<MixnodeStatus>('not_found');
|
||||
@@ -27,14 +27,6 @@ export const useSettingsState = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const getMixnodeInclusionProbability = async (mixId: number) => {
|
||||
const probability = await getInclusionProbability(mixId);
|
||||
if (probability) {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
setInclusionProbability({ in_active: probability.in_active, in_reserve: probability.in_reserve });
|
||||
}
|
||||
};
|
||||
|
||||
const reset = () => {
|
||||
setStatus('not_found');
|
||||
setSaturation('-');
|
||||
@@ -46,7 +38,6 @@ export const useSettingsState = () => {
|
||||
try {
|
||||
await getStatus(mixId);
|
||||
await getStakeSaturation(mixId);
|
||||
await getMixnodeInclusionProbability(mixId);
|
||||
} catch (e) {
|
||||
enqueueSnackbar(e as string, { variant: 'error', preventDuplicate: true });
|
||||
reset();
|
||||
|
||||
@@ -14,7 +14,6 @@ import {
|
||||
getMixnodeUptime,
|
||||
getMixnodeStakeSaturation,
|
||||
getMixnodeRewardEstimation,
|
||||
getInclusionProbability,
|
||||
getMixnodeAvgUptime,
|
||||
getMixNodeDescription as getNodeDescriptionRequest,
|
||||
getPendingOperatorRewards,
|
||||
@@ -80,14 +79,6 @@ async function getAdditionalMixnodeDetails(mixId: number, host: string, port: nu
|
||||
},
|
||||
};
|
||||
|
||||
const inclusionReq: TauriReq<typeof getInclusionProbability> = {
|
||||
name: 'getInclusionProbability',
|
||||
request: () => getInclusionProbability(mixId),
|
||||
onFulfilled: (value) => {
|
||||
details.setProbability = value;
|
||||
},
|
||||
};
|
||||
|
||||
const avgUptimeReq: TauriReq<typeof getMixnodeAvgUptime> = {
|
||||
name: 'getMixnodeAvgUptime',
|
||||
request: () => getMixnodeAvgUptime(),
|
||||
@@ -117,7 +108,6 @@ async function getAdditionalMixnodeDetails(mixId: number, host: string, port: nu
|
||||
uptimeReq,
|
||||
stakeSaturationReq,
|
||||
rewardReq,
|
||||
inclusionReq,
|
||||
avgUptimeReq,
|
||||
nodeDescReq,
|
||||
operatorRewardsReq,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {
|
||||
DecCoin,
|
||||
InclusionProbabilityResponse,
|
||||
MixnodeStatusResponse,
|
||||
PendingIntervalEvent,
|
||||
RewardEstimationResponse,
|
||||
@@ -33,9 +32,6 @@ export const checkGatewayOwnership = async () => invokeWrapper<boolean>('owns_ga
|
||||
|
||||
export const checkNymNodeOwnership = async () => invokeWrapper<boolean>('owns_nym_node');
|
||||
|
||||
export const getInclusionProbability = async (mixId: number) =>
|
||||
invokeWrapper<InclusionProbabilityResponse>('mixnode_inclusion_probability', { mixId });
|
||||
|
||||
export const getCurrentInterval = async () => invokeWrapper<Interval>('get_current_interval');
|
||||
|
||||
export const getNumberOfMixnodeDelegators = async (mixId: number) =>
|
||||
|
||||
Reference in New Issue
Block a user