Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6564be90f3 |
@@ -313,6 +313,11 @@ fn try_update_staking_address(
|
||||
info: MessageInfo,
|
||||
deps: DepsMut<'_>,
|
||||
) -> Result<Response, ContractError> {
|
||||
if let Some(ref to_address) = to_address {
|
||||
if let Ok(_account) = account_from_address(&to_address, deps.storage, deps.api) {
|
||||
return Err(ContractError::StakingAccountExists(to_address.to_string()));
|
||||
}
|
||||
}
|
||||
let address = info.sender.clone();
|
||||
let to_address = to_address.and_then(|x| deps.api.addr_validate(&x).ok());
|
||||
let mut account = account_from_address(info.sender.as_str(), deps.storage, deps.api)?;
|
||||
|
||||
@@ -52,4 +52,6 @@ pub enum ContractError {
|
||||
LockedPledgeCapReached { current: Uint128, cap: Uint128 },
|
||||
#[error("VESTING: ({}: Account owned by {owner} has unpopulated vesting periods!", line!())]
|
||||
UnpopulatedVestingPeriods { owner: Addr },
|
||||
#[error("VESTING: Vesting account associated with {0} already exists, only addresses with not existing vesting accounts can be added as staking addresses")]
|
||||
StakingAccountExists(String),
|
||||
}
|
||||
|
||||
Generated
+680
-1939
File diff suppressed because it is too large
Load Diff
@@ -66,14 +66,6 @@ vesting-contract = { path = "../../contracts/vesting" }
|
||||
nym-types = { path = "../../common/types" }
|
||||
nym-wallet-types = { path = "../nym-wallet-types" }
|
||||
|
||||
# Tracing
|
||||
tracing = "0.1.37"
|
||||
tracing-subscriber = { version = "0.3.16", features = ["env-filter"] }
|
||||
tracing-tree = "0.2.2"
|
||||
opentelemetry = "0.18.0"
|
||||
opentelemetry-jaeger = { version = "0.17.0", features = ["full"] }
|
||||
tracing-opentelemetry = "0.18.0"
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = "3.3.0"
|
||||
ts-rs = "6.1.2"
|
||||
|
||||
@@ -4,68 +4,47 @@ use fern::colors::ColoredLevelConfig;
|
||||
use serde::Serialize;
|
||||
use serde_repr::{Deserialize_repr, Serialize_repr};
|
||||
use tauri::Manager;
|
||||
use tracing_subscriber::EnvFilter;
|
||||
use tracing_subscriber::Registry;
|
||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||
use tracing_tree::HierarchicalLayer;
|
||||
|
||||
pub fn setup_logging(app_handle: tauri::AppHandle) -> Result<(), log::SetLoggerError> {
|
||||
let tracer = opentelemetry_jaeger::new_agent_pipeline()
|
||||
.with_service_name("nym-wallet")
|
||||
.install_simple()
|
||||
.unwrap();
|
||||
let colors = ColoredLevelConfig::new();
|
||||
let base_config = fern::Dispatch::new()
|
||||
.level(global_level())
|
||||
.filter_lowlevel_external_components()
|
||||
.show_operations();
|
||||
|
||||
let telemetry = tracing_opentelemetry::layer().with_tracer(tracer);
|
||||
let stdout_config = fern::Dispatch::new()
|
||||
.format(move |out, message, record| {
|
||||
out.finish(format_args!(
|
||||
"{}[{}][{}] {}",
|
||||
chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S]"),
|
||||
record.target(),
|
||||
colors.color(record.level()),
|
||||
message,
|
||||
))
|
||||
})
|
||||
.chain(std::io::stdout());
|
||||
|
||||
Registry::default()
|
||||
.with(EnvFilter::from_default_env())
|
||||
.with(
|
||||
HierarchicalLayer::new(4)
|
||||
.with_targets(true)
|
||||
.with_bracketed_fields(true),
|
||||
)
|
||||
.with(telemetry)
|
||||
.init();
|
||||
// let colors = ColoredLevelConfig::new();
|
||||
// let base_config = fern::Dispatch::new()
|
||||
// .level(global_level())
|
||||
// .filter_lowlevel_external_components()
|
||||
// .show_operations();
|
||||
let tauri_event_config = fern::Dispatch::new()
|
||||
.format(move |out, message, record| {
|
||||
out.finish(format_args!(
|
||||
"{}[{}] {}",
|
||||
chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S]"),
|
||||
record.target(),
|
||||
message,
|
||||
))
|
||||
})
|
||||
.chain(fern::Output::call(move |record| {
|
||||
let msg = LogMessage {
|
||||
message: record.args().to_string(),
|
||||
level: record.level().into(),
|
||||
};
|
||||
app_handle.emit_all("log://log", msg).unwrap();
|
||||
}));
|
||||
|
||||
// let stdout_config = fern::Dispatch::new()
|
||||
// .format(move |out, message, record| {
|
||||
// out.finish(format_args!(
|
||||
// "{}[{}][{}] {}",
|
||||
// chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S]"),
|
||||
// record.target(),
|
||||
// colors.color(record.level()),
|
||||
// message,
|
||||
// ))
|
||||
// })
|
||||
// .chain(std::io::stdout());
|
||||
|
||||
// let tauri_event_config = fern::Dispatch::new()
|
||||
// .format(move |out, message, record| {
|
||||
// out.finish(format_args!(
|
||||
// "{}[{}] {}",
|
||||
// chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S]"),
|
||||
// record.target(),
|
||||
// message,
|
||||
// ))
|
||||
// })
|
||||
// .chain(fern::Output::call(move |record| {
|
||||
// let msg = LogMessage {
|
||||
// message: record.args().to_string(),
|
||||
// level: record.level().into(),
|
||||
// };
|
||||
// app_handle.emit_all("log://log", msg).unwrap();
|
||||
// }));
|
||||
|
||||
// base_config
|
||||
// .chain(stdout_config)
|
||||
// .chain(tauri_event_config)
|
||||
// .apply()
|
||||
Ok(())
|
||||
base_config
|
||||
.chain(stdout_config)
|
||||
.chain(tauri_event_config)
|
||||
.apply()
|
||||
}
|
||||
|
||||
trait FernExt {
|
||||
|
||||
@@ -172,6 +172,4 @@ fn main() {
|
||||
.setup(|app| Ok(log::setup_logging(app.app_handle())?))
|
||||
.run(context)
|
||||
.expect("error while running tauri application");
|
||||
|
||||
opentelemetry::global::shutdown_tracer_provider();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ pub async fn connect_with_mnemonic(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn get_balance(state: tauri::State<'_, WalletState>) -> Result<Balance, BackendError> {
|
||||
let guard = state.read().await;
|
||||
let client = guard.current_client()?;
|
||||
@@ -49,19 +48,16 @@ pub async fn get_balance(state: tauri::State<'_, WalletState>) -> Result<Balance
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument]
|
||||
pub fn create_new_mnemonic() -> String {
|
||||
random_mnemonic().to_string()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(mnemonic))]
|
||||
pub fn validate_mnemonic(mnemonic: &str) -> bool {
|
||||
Mnemonic::from_str(mnemonic).is_ok()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn switch_network(
|
||||
state: tauri::State<'_, WalletState>,
|
||||
network: WalletNetwork,
|
||||
@@ -81,19 +77,16 @@ pub async fn switch_network(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn logout(state: tauri::State<'_, WalletState>) -> Result<(), BackendError> {
|
||||
state.write().await.logout();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tracing::instrument()]
|
||||
fn random_mnemonic() -> Mnemonic {
|
||||
let mut rng = rand::thread_rng();
|
||||
Mnemonic::generate_in_with(&mut rng, Language::English, 24).unwrap()
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(state, mnemonic))]
|
||||
async fn _connect_with_mnemonic(
|
||||
mnemonic: Mnemonic,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -176,7 +169,6 @@ async fn _connect_with_mnemonic(
|
||||
account_for_default_network
|
||||
}
|
||||
|
||||
#[tracing::instrument]
|
||||
async fn run_connection_test(
|
||||
untested_nymd_urls: HashMap<WalletNetwork, Vec<Url>>,
|
||||
untested_api_urls: HashMap<WalletNetwork, Vec<Url>>,
|
||||
@@ -205,7 +197,6 @@ async fn run_connection_test(
|
||||
.await
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(mnemonic))]
|
||||
fn create_clients(
|
||||
nymd_urls: &HashMap<NymNetworkDetails, Vec<(Url, bool)>>,
|
||||
api_urls: &HashMap<NymNetworkDetails, Vec<(Url, bool)>>,
|
||||
@@ -267,7 +258,6 @@ fn create_clients(
|
||||
Ok(clients)
|
||||
}
|
||||
|
||||
#[tracing::instrument()]
|
||||
fn select_random_responding_url(
|
||||
urls: &HashMap<NymNetworkDetails, Vec<(Url, bool)>>,
|
||||
network: WalletNetwork,
|
||||
@@ -293,7 +283,6 @@ fn select_first_responding_url(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument]
|
||||
pub fn does_password_file_exist() -> Result<bool, BackendError> {
|
||||
log::info!("Checking wallet file");
|
||||
let file = wallet_storage::wallet_login_filepath()?;
|
||||
@@ -307,7 +296,6 @@ pub fn does_password_file_exist() -> Result<bool, BackendError> {
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(mnemonic, password))]
|
||||
pub fn create_password(mnemonic: &str, password: String) -> Result<(), BackendError> {
|
||||
if does_password_file_exist()? {
|
||||
return Err(BackendError::WalletFileAlreadyExists);
|
||||
@@ -323,7 +311,6 @@ pub fn create_password(mnemonic: &str, password: String) -> Result<(), BackendEr
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state, password))]
|
||||
pub async fn sign_in_with_password(
|
||||
password: String,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -343,7 +330,6 @@ pub async fn sign_in_with_password(
|
||||
_connect_with_mnemonic(mnemonic, state).await
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(stored_login))]
|
||||
fn extract_first_mnemonic(
|
||||
stored_login: &wallet_storage::StoredLogin,
|
||||
) -> Result<Mnemonic, BackendError> {
|
||||
@@ -364,7 +350,6 @@ fn extract_first_mnemonic(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state, password))]
|
||||
pub async fn sign_in_with_password_and_account_id(
|
||||
account_id: &str,
|
||||
password: &str,
|
||||
@@ -386,7 +371,6 @@ pub async fn sign_in_with_password_and_account_id(
|
||||
_connect_with_mnemonic(mnemonic, state).await
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(stored_login))]
|
||||
fn extract_mnemonic(
|
||||
stored_login: &wallet_storage::StoredLogin,
|
||||
account_id: &wallet_storage::AccountId,
|
||||
@@ -405,7 +389,6 @@ fn extract_mnemonic(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument]
|
||||
pub fn remove_password() -> Result<(), BackendError> {
|
||||
log::info!("Removing password");
|
||||
let login_id = wallet_storage::LoginId::new(DEFAULT_LOGIN_ID.to_string());
|
||||
@@ -413,13 +396,11 @@ pub fn remove_password() -> Result<(), BackendError> {
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument]
|
||||
pub fn archive_wallet_file() -> Result<(), BackendError> {
|
||||
wallet_storage::archive_wallet_file()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state, mnemonic, password))]
|
||||
pub async fn add_account_for_password(
|
||||
mnemonic: &str,
|
||||
password: &str,
|
||||
@@ -463,7 +444,6 @@ pub async fn add_account_for_password(
|
||||
}
|
||||
|
||||
// The first `AccoundId` when converting is the `LoginId` for the entry that was loaded.
|
||||
#[tracing::instrument(skip(state, stored_login))]
|
||||
async fn set_state_with_all_accounts(
|
||||
stored_login: wallet_storage::StoredLogin,
|
||||
first_id_when_converting: wallet_storage::AccountId,
|
||||
@@ -509,7 +489,6 @@ async fn set_state_with_all_accounts(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state, password))]
|
||||
pub async fn remove_account_for_password(
|
||||
password: &str,
|
||||
account_id: &str,
|
||||
@@ -530,7 +509,6 @@ pub async fn remove_account_for_password(
|
||||
set_state_with_all_accounts(stored_login, first_account_id_when_converting, state).await
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(mnemonic, prefix))]
|
||||
fn derive_address(
|
||||
mnemonic: bip39::Mnemonic,
|
||||
prefix: &str,
|
||||
@@ -544,7 +522,6 @@ fn derive_address(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn list_accounts(
|
||||
state: tauri::State<'_, WalletState>,
|
||||
) -> Result<Vec<AccountEntry>, BackendError> {
|
||||
@@ -568,7 +545,6 @@ pub async fn list_accounts(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(password))]
|
||||
pub fn show_mnemonic_for_account_in_password(
|
||||
account_id: String,
|
||||
password: String,
|
||||
@@ -581,7 +557,6 @@ pub fn show_mnemonic_for_account_in_password(
|
||||
Ok(mnemonic.to_string())
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(password))]
|
||||
fn _show_mnemonic_for_account_in_password(
|
||||
login_id: &wallet_storage::LoginId,
|
||||
account_id: &wallet_storage::AccountId,
|
||||
|
||||
@@ -10,7 +10,6 @@ use validator_client::nymd::traits::{MixnetQueryClient, MixnetSigningClient};
|
||||
use validator_client::nymd::Fee;
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn get_contract_settings(
|
||||
state: tauri::State<'_, WalletState>,
|
||||
) -> Result<TauriContractStateParams, BackendError> {
|
||||
@@ -27,7 +26,6 @@ pub async fn get_contract_settings(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn update_contract_settings(
|
||||
params: TauriContractStateParams,
|
||||
fee: Option<Fee>,
|
||||
|
||||
@@ -23,7 +23,6 @@ pub struct NodeDescription {
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn bond_gateway(
|
||||
gateway: Gateway,
|
||||
pledge: DecCoin,
|
||||
@@ -55,7 +54,6 @@ pub async fn bond_gateway(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn unbond_gateway(
|
||||
fee: Option<Fee>,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -72,7 +70,6 @@ pub async fn unbond_gateway(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn bond_mixnode(
|
||||
mixnode: MixNode,
|
||||
cost_params: MixNodeCostParams,
|
||||
@@ -106,7 +103,6 @@ pub async fn bond_mixnode(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn pledge_more(
|
||||
fee: Option<Fee>,
|
||||
additional_pledge: DecCoin,
|
||||
@@ -134,7 +130,6 @@ pub async fn pledge_more(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn unbond_mixnode(
|
||||
fee: Option<Fee>,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -151,7 +146,6 @@ pub async fn unbond_mixnode(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn update_mixnode_cost_params(
|
||||
new_costs: MixNodeCostParams,
|
||||
fee: Option<Fee>,
|
||||
@@ -179,7 +173,6 @@ pub async fn update_mixnode_cost_params(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn update_mixnode_config(
|
||||
update: MixNodeConfigUpdate,
|
||||
fee: Option<Fee>,
|
||||
@@ -205,7 +198,6 @@ pub async fn update_mixnode_config(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn get_mixnode_avg_uptime(
|
||||
state: tauri::State<'_, WalletState>,
|
||||
) -> Result<Option<u8>, BackendError> {
|
||||
@@ -232,7 +224,6 @@ pub async fn get_mixnode_avg_uptime(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn mixnode_bond_details(
|
||||
state: tauri::State<'_, WalletState>,
|
||||
) -> Result<Option<MixNodeDetails>, BackendError> {
|
||||
@@ -261,7 +252,6 @@ pub async fn mixnode_bond_details(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn gateway_bond_details(
|
||||
state: tauri::State<'_, WalletState>,
|
||||
) -> Result<Option<GatewayBond>, BackendError> {
|
||||
@@ -288,7 +278,6 @@ pub async fn gateway_bond_details(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn get_pending_operator_rewards(
|
||||
address: String,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -326,7 +315,6 @@ pub async fn get_pending_operator_rewards(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn get_number_of_mixnode_delegators(
|
||||
mix_id: MixId,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -340,7 +328,6 @@ pub async fn get_number_of_mixnode_delegators(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument]
|
||||
pub async fn get_mix_node_description(
|
||||
host: &str,
|
||||
port: u16,
|
||||
@@ -356,7 +343,6 @@ pub async fn get_mix_node_description(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn get_mixnode_uptime(
|
||||
mix_id: MixId,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
|
||||
@@ -144,7 +144,6 @@ pub async fn undelegate_all_from_mixnode(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn get_all_mix_delegations(
|
||||
state: tauri::State<'_, WalletState>,
|
||||
) -> Result<Vec<DelegationWithEverything>, BackendError> {
|
||||
|
||||
@@ -5,7 +5,6 @@ use validator_client::nymd::traits::MixnetSigningClient;
|
||||
use validator_client::nymd::Fee;
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn create_family(
|
||||
signature: String,
|
||||
label: String,
|
||||
@@ -25,7 +24,6 @@ pub async fn create_family(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn join_family(
|
||||
signature: String,
|
||||
family_head: String,
|
||||
@@ -45,7 +43,6 @@ pub async fn join_family(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn leave_family(
|
||||
signature: String,
|
||||
family_head: String,
|
||||
@@ -65,7 +62,6 @@ pub async fn leave_family(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn kick_family_member(
|
||||
signature: String,
|
||||
member: String,
|
||||
|
||||
@@ -9,7 +9,6 @@ use nym_wallet_types::interval::Interval;
|
||||
use validator_client::nymd::traits::MixnetQueryClient;
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn get_current_interval(
|
||||
state: tauri::State<'_, WalletState>,
|
||||
) -> Result<Interval, BackendError> {
|
||||
@@ -20,7 +19,6 @@ pub async fn get_current_interval(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn get_pending_epoch_events(
|
||||
state: tauri::State<'_, WalletState>,
|
||||
) -> Result<Vec<PendingEpochEvent>, BackendError> {
|
||||
@@ -40,7 +38,6 @@ pub async fn get_pending_epoch_events(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn get_pending_interval_events(
|
||||
state: tauri::State<'_, WalletState>,
|
||||
) -> Result<Vec<PendingIntervalEvent>, BackendError> {
|
||||
|
||||
@@ -7,7 +7,6 @@ use validator_client::nymd::traits::{MixnetQueryClient, MixnetSigningClient};
|
||||
use validator_client::nymd::Fee;
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn claim_operator_reward(
|
||||
fee: Option<Fee>,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -29,7 +28,6 @@ pub async fn claim_operator_reward(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn claim_delegator_reward(
|
||||
mix_id: MixId,
|
||||
fee: Option<Fee>,
|
||||
@@ -51,7 +49,6 @@ pub async fn claim_delegator_reward(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn claim_locked_and_unlocked_delegator_reward(
|
||||
mix_id: MixId,
|
||||
fee: Option<Fee>,
|
||||
@@ -100,7 +97,6 @@ pub async fn claim_locked_and_unlocked_delegator_reward(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn get_current_rewarding_parameters(
|
||||
state: tauri::State<'_, WalletState>,
|
||||
) -> Result<RewardingParams, BackendError> {
|
||||
|
||||
@@ -6,7 +6,6 @@ use std::str::FromStr;
|
||||
use validator_client::nymd::{AccountId, Fee};
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn send(
|
||||
address: &str,
|
||||
amount: DecCoin,
|
||||
|
||||
@@ -12,7 +12,6 @@ use validator_client::models::{
|
||||
};
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn mixnode_core_node_status(
|
||||
mix_id: MixId,
|
||||
since: Option<i64>,
|
||||
@@ -24,7 +23,6 @@ pub async fn mixnode_core_node_status(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn gateway_core_node_status(
|
||||
identity: IdentityKeyRef<'_>,
|
||||
since: Option<i64>,
|
||||
@@ -36,7 +34,6 @@ pub async fn gateway_core_node_status(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn gateway_report(
|
||||
identity: IdentityKeyRef<'_>,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -45,7 +42,6 @@ pub async fn gateway_report(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn mixnode_status(
|
||||
mix_id: MixId,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -54,7 +50,6 @@ pub async fn mixnode_status(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn mixnode_reward_estimation(
|
||||
mix_id: MixId,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -65,7 +60,6 @@ pub async fn mixnode_reward_estimation(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn compute_mixnode_reward_estimation(
|
||||
mix_id: u32,
|
||||
performance: Option<Performance>,
|
||||
@@ -89,7 +83,6 @@ pub async fn compute_mixnode_reward_estimation(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn mixnode_stake_saturation(
|
||||
mix_id: MixId,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -100,7 +93,6 @@ pub async fn mixnode_stake_saturation(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn mixnode_inclusion_probability(
|
||||
mix_id: MixId,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
|
||||
@@ -17,7 +17,6 @@ pub struct SignatureOutputJson {
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn sign(
|
||||
message: String,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -43,7 +42,6 @@ pub async fn sign(
|
||||
Ok(output_json)
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(state))]
|
||||
async fn get_pubkey_from_account_address(
|
||||
address: &AccountId,
|
||||
state: &tauri::State<'_, WalletState>,
|
||||
@@ -76,7 +74,6 @@ enum VerifyInputKind {
|
||||
impl TryFrom<Option<String>> for VerifyInputKind {
|
||||
type Error = BackendError;
|
||||
|
||||
#[tracing::instrument]
|
||||
fn try_from(value: Option<String>) -> Result<Self, Self::Error> {
|
||||
let key = match value {
|
||||
Some(key) => key,
|
||||
@@ -103,7 +100,6 @@ impl TryFrom<Option<String>> for VerifyInputKind {
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn verify(
|
||||
public_key_as_json_or_account_address: Option<String>,
|
||||
signature_as_hex: String,
|
||||
|
||||
@@ -8,7 +8,6 @@ use mixnet_contract_common::{ContractStateParams, ExecuteMsg};
|
||||
use nym_wallet_types::admin::TauriContractStateParams;
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_update_contract_settings(
|
||||
params: TauriContractStateParams,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
|
||||
@@ -9,7 +9,6 @@ use std::str::FromStr;
|
||||
use validator_client::nymd::{AccountId, MsgSend};
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_send(
|
||||
address: &str,
|
||||
amount: DecCoin,
|
||||
|
||||
@@ -9,7 +9,6 @@ use mixnet_contract_common::{ExecuteMsg, Gateway, MixId, MixNode};
|
||||
use nym_types::currency::DecCoin;
|
||||
use nym_types::mixnode::MixNodeCostParams;
|
||||
|
||||
#[tracing::instrument(skip(state))]
|
||||
async fn simulate_mixnet_operation(
|
||||
msg: ExecuteMsg,
|
||||
raw_funds: Option<DecCoin>,
|
||||
@@ -37,7 +36,6 @@ async fn simulate_mixnet_operation(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_bond_gateway(
|
||||
gateway: Gateway,
|
||||
pledge: DecCoin,
|
||||
@@ -56,7 +54,6 @@ pub async fn simulate_bond_gateway(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_unbond_gateway(
|
||||
state: tauri::State<'_, WalletState>,
|
||||
) -> Result<FeeDetails, BackendError> {
|
||||
@@ -64,7 +61,6 @@ pub async fn simulate_unbond_gateway(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_bond_mixnode(
|
||||
mixnode: MixNode,
|
||||
cost_params: MixNodeCostParams,
|
||||
@@ -89,7 +85,6 @@ pub async fn simulate_bond_mixnode(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_pledge_more(
|
||||
additional_pledge: DecCoin,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -98,7 +93,6 @@ pub async fn simulate_pledge_more(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_unbond_mixnode(
|
||||
state: tauri::State<'_, WalletState>,
|
||||
) -> Result<FeeDetails, BackendError> {
|
||||
@@ -106,7 +100,6 @@ pub async fn simulate_unbond_mixnode(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_update_mixnode_cost_params(
|
||||
new_costs: MixNodeCostParams,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -124,7 +117,6 @@ pub async fn simulate_update_mixnode_cost_params(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_update_mixnode_config(
|
||||
update: MixNodeConfigUpdate,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -138,7 +130,6 @@ pub async fn simulate_update_mixnode_config(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_delegate_to_mixnode(
|
||||
mix_id: MixId,
|
||||
amount: DecCoin,
|
||||
@@ -153,7 +144,6 @@ pub async fn simulate_delegate_to_mixnode(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_undelegate_from_mixnode(
|
||||
mix_id: MixId,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -162,7 +152,6 @@ pub async fn simulate_undelegate_from_mixnode(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_claim_operator_reward(
|
||||
state: tauri::State<'_, WalletState>,
|
||||
) -> Result<FeeDetails, BackendError> {
|
||||
@@ -170,7 +159,6 @@ pub async fn simulate_claim_operator_reward(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_claim_delegator_reward(
|
||||
mix_id: MixId,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
|
||||
@@ -24,7 +24,6 @@ pub(crate) struct SimulateResult {
|
||||
}
|
||||
|
||||
impl SimulateResult {
|
||||
#[tracing::instrument]
|
||||
pub fn new(
|
||||
gas_info: Option<GasInfo>,
|
||||
gas_price: GasPrice,
|
||||
|
||||
@@ -10,7 +10,6 @@ use nym_types::currency::DecCoin;
|
||||
use nym_types::mixnode::MixNodeCostParams;
|
||||
use vesting_contract_common::ExecuteMsg;
|
||||
|
||||
#[tracing::instrument(skip(state))]
|
||||
async fn simulate_vesting_operation(
|
||||
msg: ExecuteMsg,
|
||||
raw_funds: Option<DecCoin>,
|
||||
@@ -38,7 +37,6 @@ async fn simulate_vesting_operation(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_vesting_bond_gateway(
|
||||
gateway: Gateway,
|
||||
pledge: DecCoin,
|
||||
@@ -61,7 +59,6 @@ pub async fn simulate_vesting_bond_gateway(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_vesting_unbond_gateway(
|
||||
state: tauri::State<'_, WalletState>,
|
||||
) -> Result<FeeDetails, BackendError> {
|
||||
@@ -69,7 +66,6 @@ pub async fn simulate_vesting_unbond_gateway(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_vesting_bond_mixnode(
|
||||
mixnode: MixNode,
|
||||
cost_params: MixNodeCostParams,
|
||||
@@ -96,7 +92,6 @@ pub async fn simulate_vesting_bond_mixnode(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_vesting_pledge_more(
|
||||
additional_pledge: DecCoin,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -110,7 +105,6 @@ pub async fn simulate_vesting_pledge_more(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_vesting_unbond_mixnode(
|
||||
state: tauri::State<'_, WalletState>,
|
||||
) -> Result<FeeDetails, BackendError> {
|
||||
@@ -118,7 +112,6 @@ pub async fn simulate_vesting_unbond_mixnode(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_vesting_update_mixnode_cost_params(
|
||||
new_costs: MixNodeCostParams,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -136,7 +129,6 @@ pub async fn simulate_vesting_update_mixnode_cost_params(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_vesting_update_mixnode_config(
|
||||
update: MixNodeConfigUpdate,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -150,7 +142,6 @@ pub async fn simulate_vesting_update_mixnode_config(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_vesting_delegate_to_mixnode(
|
||||
mix_id: MixId,
|
||||
amount: DecCoin,
|
||||
@@ -168,7 +159,6 @@ pub async fn simulate_vesting_delegate_to_mixnode(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_vesting_undelegate_from_mixnode(
|
||||
mix_id: MixId,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -177,7 +167,6 @@ pub async fn simulate_vesting_undelegate_from_mixnode(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_withdraw_vested_coins(
|
||||
amount: DecCoin,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -188,7 +177,6 @@ pub async fn simulate_withdraw_vested_coins(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_vesting_claim_operator_reward(
|
||||
state: tauri::State<'_, WalletState>,
|
||||
) -> Result<FeeDetails, BackendError> {
|
||||
@@ -196,7 +184,6 @@ pub async fn simulate_vesting_claim_operator_reward(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn simulate_vesting_claim_delegator_reward(
|
||||
mix_id: MixId,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
|
||||
@@ -10,7 +10,6 @@ use nym_types::transaction::TransactionExecuteResult;
|
||||
use validator_client::nymd::{Fee, VestingSigningClient};
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn vesting_bond_gateway(
|
||||
gateway: Gateway,
|
||||
pledge: DecCoin,
|
||||
@@ -42,7 +41,6 @@ pub async fn vesting_bond_gateway(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn vesting_unbond_gateway(
|
||||
fee: Option<Fee>,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -62,7 +60,6 @@ pub async fn vesting_unbond_gateway(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn vesting_bond_mixnode(
|
||||
mixnode: MixNode,
|
||||
cost_params: MixNodeCostParams,
|
||||
@@ -97,7 +94,6 @@ pub async fn vesting_bond_mixnode(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn vesting_pledge_more(
|
||||
fee: Option<Fee>,
|
||||
additional_pledge: DecCoin,
|
||||
@@ -125,7 +121,6 @@ pub async fn vesting_pledge_more(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn vesting_unbond_mixnode(
|
||||
fee: Option<Fee>,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -149,7 +144,6 @@ pub async fn vesting_unbond_mixnode(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn withdraw_vested_coins(
|
||||
amount: DecCoin,
|
||||
fee: Option<Fee>,
|
||||
@@ -178,7 +172,6 @@ pub async fn withdraw_vested_coins(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn vesting_update_mixnode_cost_params(
|
||||
new_costs: MixNodeCostParams,
|
||||
fee: Option<Fee>,
|
||||
@@ -207,7 +200,6 @@ pub async fn vesting_update_mixnode_cost_params(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn vesting_update_mixnode_config(
|
||||
update: MixNodeConfigUpdate,
|
||||
fee: Option<Fee>,
|
||||
|
||||
@@ -9,7 +9,6 @@ use nym_types::transaction::TransactionExecuteResult;
|
||||
use validator_client::nymd::{Fee, VestingSigningClient};
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn vesting_delegate_to_mixnode(
|
||||
mix_id: MixId,
|
||||
amount: DecCoin,
|
||||
@@ -40,7 +39,6 @@ pub async fn vesting_delegate_to_mixnode(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn vesting_undelegate_from_mixnode(
|
||||
mix_id: MixId,
|
||||
fee: Option<Fee>,
|
||||
|
||||
@@ -173,7 +173,6 @@ pub async fn delegated_free(
|
||||
|
||||
/// Returns the total amount of delegated tokens that have vested
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn delegated_vesting(
|
||||
block_time: Option<u64>,
|
||||
vesting_account_address: &str,
|
||||
@@ -197,7 +196,6 @@ pub async fn delegated_vesting(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn vesting_get_mixnode_pledge(
|
||||
address: &str,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -219,7 +217,6 @@ pub async fn vesting_get_mixnode_pledge(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn vesting_get_gateway_pledge(
|
||||
address: &str,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -241,7 +238,6 @@ pub async fn vesting_get_gateway_pledge(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn get_current_vesting_period(
|
||||
address: &str,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -255,7 +251,6 @@ pub async fn get_current_vesting_period(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn get_account_info(
|
||||
address: &str,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
|
||||
@@ -8,7 +8,6 @@ use nym_types::transaction::TransactionExecuteResult;
|
||||
use validator_client::nymd::Fee;
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn vesting_claim_operator_reward(
|
||||
fee: Option<Fee>,
|
||||
state: tauri::State<'_, WalletState>,
|
||||
@@ -29,7 +28,6 @@ pub async fn vesting_claim_operator_reward(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state))]
|
||||
pub async fn vesting_claim_delegator_reward(
|
||||
mix_id: MixId,
|
||||
fee: Option<Fee>,
|
||||
|
||||
Reference in New Issue
Block a user