This commit is contained in:
Jędrzej Stuczyński
2023-08-01 18:13:17 +01:00
parent 3c8dd7a72b
commit 15bc4ae272
3 changed files with 16 additions and 18 deletions
+9 -9
View File
@@ -3,24 +3,24 @@
use wasm_bindgen::prelude::*;
// #[cfg(target_arch = "wasm32")]
#[cfg(target_arch = "wasm32")]
mod client;
// #[cfg(target_arch = "wasm32")]
#[cfg(target_arch = "wasm32")]
pub mod encoded_payload_helper;
// #[cfg(target_arch = "wasm32")]
#[cfg(target_arch = "wasm32")]
pub mod error;
// #[cfg(target_arch = "wasm32")]
#[cfg(target_arch = "wasm32")]
pub mod gateway_selector;
// #[cfg(target_arch = "wasm32")]
#[cfg(target_arch = "wasm32")]
pub mod storage;
// #[cfg(target_arch = "wasm32")]
#[cfg(target_arch = "wasm32")]
pub mod tester;
// #[cfg(target_arch = "wasm32")]
#[cfg(target_arch = "wasm32")]
pub mod topology;
// #[cfg(target_arch = "wasm32")]
#[cfg(target_arch = "wasm32")]
pub mod validation;
// #[cfg(target_arch = "wasm32")]
#[cfg(target_arch = "wasm32")]
mod helpers;
mod constants;
@@ -35,11 +35,9 @@ nym-network-defaults = { path = "../../network-defaults" }
nym-api-requests = { path = "../../../nym-api/nym-api-requests" }
async-trait = { workspace = true }
#bip39 = { workspace = true, features = ["rand"], optional = true }
bip39 = { workspace = true, features = ["rand"] }
nym-config = { path = "../../config" }
cosmrs = { workspace = true, features = ["bip32", "cosmwasm"] }
#cosmrs = { workspace = true, features = ["bip32", "rpc", "cosmwasm"], optional = true }
# note that this has the same version as used by cosmrs
# import it just for the `Client` trait
+7 -7
View File
@@ -106,7 +106,7 @@ impl Client {
cosmwasm_addr
.clone()
.parse()
.map_err(|_| NyxdError::MalformedAccountAddress(cosmwasm_addr).into())
.map_err(|_| NyxdError::MalformedAccountAddress(cosmwasm_addr))
}
// a helper function for the future to obtain the current block timestamp
@@ -145,17 +145,17 @@ impl Client {
}
pub(crate) async fn get_current_interval(&self) -> Result<CurrentIntervalResponse, NyxdError> {
Ok(self.0.read().await.get_current_interval_details().await?)
self.0.read().await.get_current_interval_details().await
}
pub(crate) async fn get_current_epoch_status(&self) -> Result<EpochStatus, NyxdError> {
Ok(self.0.read().await.get_current_epoch_status().await?)
self.0.read().await.get_current_epoch_status().await
}
pub(crate) async fn get_current_rewarding_parameters(
&self,
) -> Result<RewardingParams, NyxdError> {
Ok(self.0.read().await.get_rewarding_parameters().await?)
self.0.read().await.get_rewarding_parameters().await
}
pub(crate) async fn get_rewarded_set_mixnodes(
@@ -179,13 +179,13 @@ impl Client {
return Ok(0);
}
Ok(serde_json::from_slice(&res).map_err(NyxdError::from)?)
serde_json::from_slice(&res).map_err(NyxdError::from)
}
pub(crate) async fn get_all_vesting_coins(
&self,
) -> Result<Vec<AccountVestingCoins>, NyxdError> {
Ok(self.0.read().await.get_all_accounts_vesting_coins().await?)
self.0.read().await.get_all_accounts_vesting_coins().await
}
pub(crate) async fn get_all_family_members(
@@ -241,7 +241,7 @@ impl Client {
guard
.execute_multiple(
&mixnet_contract,
mixnet_contract,
msgs,
Default::default(),
format!("rewarding {} mixnodes", nodes.len()),