Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 95d7a21d58 | |||
| 67811bc2b9 | |||
| 2cf4393386 |
Generated
+1
@@ -3735,6 +3735,7 @@ version = "0.1.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"hex-literal",
|
"hex-literal",
|
||||||
|
"once_cell",
|
||||||
"serde",
|
"serde",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"url",
|
"url",
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
use crate::{validator_api, ValidatorClientError};
|
use crate::{validator_api, ValidatorClientError};
|
||||||
use coconut_interface::{BlindSignRequestBody, BlindedSignatureResponse, VerificationKeyResponse};
|
use coconut_interface::{BlindSignRequestBody, BlindedSignatureResponse, VerificationKeyResponse};
|
||||||
use mixnet_contract_common::{GatewayBond, IdentityKeyRef, MixNodeBond};
|
use mixnet_contract_common::{GatewayBond, IdentityKeyRef, MixNodeBond};
|
||||||
|
use network_defaults::DEFAULT_NETWORK;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
use validator_api_requests::models::{
|
use validator_api_requests::models::{
|
||||||
CoreNodeStatusResponse, MixnodeStatusResponse, RewardEstimationResponse,
|
CoreNodeStatusResponse, MixnodeStatusResponse, RewardEstimationResponse,
|
||||||
@@ -29,6 +30,7 @@ use std::str::FromStr;
|
|||||||
|
|
||||||
#[cfg(feature = "nymd-client")]
|
#[cfg(feature = "nymd-client")]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
network: network_defaults::all::Network,
|
network: network_defaults::all::Network,
|
||||||
api_url: Url,
|
api_url: Url,
|
||||||
@@ -159,12 +161,10 @@ impl Client<QueryNymdClient> {
|
|||||||
let nymd_client = NymdClient::connect(
|
let nymd_client = NymdClient::connect(
|
||||||
config.nymd_url.as_str(),
|
config.nymd_url.as_str(),
|
||||||
Some(config.mixnet_contract_address.clone().unwrap_or_else(|| {
|
Some(config.mixnet_contract_address.clone().unwrap_or_else(|| {
|
||||||
cosmrs::AccountId::from_str(network_defaults::DEFAULT_MIXNET_CONTRACT_ADDRESS)
|
cosmrs::AccountId::from_str(DEFAULT_NETWORK.mixnet_contract_address()).unwrap()
|
||||||
.unwrap()
|
|
||||||
})),
|
})),
|
||||||
Some(config.vesting_contract_address.clone().unwrap_or_else(|| {
|
Some(config.vesting_contract_address.clone().unwrap_or_else(|| {
|
||||||
cosmrs::AccountId::from_str(network_defaults::DEFAULT_VESTING_CONTRACT_ADDRESS)
|
cosmrs::AccountId::from_str(DEFAULT_NETWORK.vesting_contract_address()).unwrap()
|
||||||
.unwrap()
|
|
||||||
})),
|
})),
|
||||||
Some(
|
Some(
|
||||||
config
|
config
|
||||||
@@ -172,7 +172,7 @@ impl Client<QueryNymdClient> {
|
|||||||
.clone()
|
.clone()
|
||||||
.unwrap_or_else(|| {
|
.unwrap_or_else(|| {
|
||||||
cosmrs::AccountId::from_str(
|
cosmrs::AccountId::from_str(
|
||||||
network_defaults::DEFAULT_BANDWIDTH_CLAIM_CONTRACT_ADDRESS,
|
DEFAULT_NETWORK.bandwidth_claim_contract_address(),
|
||||||
)
|
)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ impl FromStr for GasPrice {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl GasPrice {
|
impl GasPrice {
|
||||||
pub fn new_with_default_price(denom: String) -> Result<Self, NymdError> {
|
pub fn new_with_default_price(denom: &str) -> Result<Self, NymdError> {
|
||||||
format!("{}{}", defaults::GAS_PRICE_AMOUNT, denom).parse()
|
format!("{}{}", defaults::GAS_PRICE_AMOUNT, denom).parse()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -83,8 +83,8 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn default_gas_price_is_valid() {
|
fn default_gas_price_is_valid() {
|
||||||
let denom = "unym".parse().unwrap();
|
let denom = "unym";
|
||||||
let _ = GasPrice::new_with_default_price(denom);
|
GasPrice::new_with_default_price(denom).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -57,16 +57,16 @@ pub struct DirectSecp256k1HdWallet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl DirectSecp256k1HdWallet {
|
impl DirectSecp256k1HdWallet {
|
||||||
pub fn builder(prefix: String) -> DirectSecp256k1HdWalletBuilder {
|
pub fn builder(prefix: &str) -> DirectSecp256k1HdWalletBuilder {
|
||||||
DirectSecp256k1HdWalletBuilder::new(prefix)
|
DirectSecp256k1HdWalletBuilder::new(prefix)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Restores a wallet from the given BIP39 mnemonic using default options.
|
/// Restores a wallet from the given BIP39 mnemonic using default options.
|
||||||
pub fn from_mnemonic(prefix: String, mnemonic: bip39::Mnemonic) -> Result<Self, NymdError> {
|
pub fn from_mnemonic(prefix: &str, mnemonic: bip39::Mnemonic) -> Result<Self, NymdError> {
|
||||||
DirectSecp256k1HdWalletBuilder::new(prefix).build(mnemonic)
|
DirectSecp256k1HdWalletBuilder::new(prefix).build(mnemonic)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn generate(prefix: String, word_count: usize) -> Result<Self, NymdError> {
|
pub fn generate(prefix: &str, word_count: usize) -> Result<Self, NymdError> {
|
||||||
let mneomonic = bip39::Mnemonic::generate(word_count)?;
|
let mneomonic = bip39::Mnemonic::generate(word_count)?;
|
||||||
Self::from_mnemonic(prefix, mneomonic)
|
Self::from_mnemonic(prefix, mneomonic)
|
||||||
}
|
}
|
||||||
@@ -146,11 +146,11 @@ pub struct DirectSecp256k1HdWalletBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl DirectSecp256k1HdWalletBuilder {
|
impl DirectSecp256k1HdWalletBuilder {
|
||||||
pub fn new(prefix: String) -> Self {
|
pub fn new(prefix: &str) -> Self {
|
||||||
DirectSecp256k1HdWalletBuilder {
|
DirectSecp256k1HdWalletBuilder {
|
||||||
bip39_password: String::new(),
|
bip39_password: String::new(),
|
||||||
hd_paths: vec![defaults::COSMOS_DERIVATION_PATH.parse().unwrap()],
|
hd_paths: vec![defaults::COSMOS_DERIVATION_PATH.parse().unwrap()],
|
||||||
prefix,
|
prefix: prefix.into(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,11 +197,11 @@ impl DirectSecp256k1HdWalletBuilder {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use network_defaults::{default_network, BECH32_PREFIX};
|
use network_defaults::DEFAULT_NETWORK;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn generating_account_addresses() {
|
fn generating_account_addresses() {
|
||||||
let (addr1, addr2, addr3) = match BECH32_PREFIX {
|
let (addr1, addr2, addr3) = match DEFAULT_NETWORK.bech32_prefix() {
|
||||||
"punk" => (
|
"punk" => (
|
||||||
"punk1jw6mp7d5xqc7w6xm79lha27glmd0vdt32a3fj2",
|
"punk1jw6mp7d5xqc7w6xm79lha27glmd0vdt32a3fj2",
|
||||||
"punk1h5hgn94nsq4kh99rjj794hr5h5q6yfm22mcqqn",
|
"punk1h5hgn94nsq4kh99rjj794hr5h5q6yfm22mcqqn",
|
||||||
@@ -222,7 +222,7 @@ mod tests {
|
|||||||
];
|
];
|
||||||
|
|
||||||
for (mnemonic, address) in mnemonic_address.into_iter() {
|
for (mnemonic, address) in mnemonic_address.into_iter() {
|
||||||
let prefix = default_network().bech32_prefix();
|
let prefix = DEFAULT_NETWORK.bech32_prefix();
|
||||||
let wallet =
|
let wallet =
|
||||||
DirectSecp256k1HdWallet::from_mnemonic(prefix, mnemonic.parse().unwrap()).unwrap();
|
DirectSecp256k1HdWallet::from_mnemonic(prefix, mnemonic.parse().unwrap()).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use config::defaults;
|
use config::defaults::DEFAULT_NETWORK;
|
||||||
use subtle_encoding::bech32;
|
use subtle_encoding::bech32;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
@@ -18,12 +18,12 @@ pub fn try_bech32_decode(address: &str) -> Result<String, Bech32Error> {
|
|||||||
pub fn validate_bech32_prefix(address: &str) -> Result<(), Bech32Error> {
|
pub fn validate_bech32_prefix(address: &str) -> Result<(), Bech32Error> {
|
||||||
let prefix = try_bech32_decode(address)?;
|
let prefix = try_bech32_decode(address)?;
|
||||||
|
|
||||||
if prefix == defaults::BECH32_PREFIX {
|
if prefix == DEFAULT_NETWORK.bech32_prefix() {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
Err(Bech32Error::WrongPrefix(format!(
|
Err(Bech32Error::WrongPrefix(format!(
|
||||||
"your bech32 address prefix should be {}, not {}",
|
"your bech32 address prefix should be {}, not {}",
|
||||||
defaults::BECH32_PREFIX,
|
DEFAULT_NETWORK.bech32_prefix(),
|
||||||
prefix
|
prefix
|
||||||
)))
|
)))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ edition = "2021"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
cfg-if = "1.0.0"
|
cfg-if = "1.0.0"
|
||||||
hex-literal = "0.3.3"
|
hex-literal = "0.3.3"
|
||||||
|
once_cell = "1.7.2"
|
||||||
serde = {version = "1.0", features = ["derive"]}
|
serde = {version = "1.0", features = ["derive"]}
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
url = "2.2"
|
url = "2.2"
|
||||||
|
|||||||
@@ -2,9 +2,11 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::{collections::HashMap, fmt, str::FromStr};
|
use std::{collections::HashMap, fmt, ops::Deref, str::FromStr};
|
||||||
|
|
||||||
use crate::{mainnet, qa, sandbox, ValidatorDetails};
|
use crate::{
|
||||||
|
DefaultNetworkDetails, ValidatorDetails, MAINNET_DEFAULTS, QA_DEFAULTS, SANDBOX_DEFAULTS,
|
||||||
|
};
|
||||||
|
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
@@ -22,20 +24,40 @@ pub enum Network {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Network {
|
impl Network {
|
||||||
pub fn bech32_prefix(&self) -> String {
|
fn details(&self) -> &DefaultNetworkDetails<'_> {
|
||||||
match self {
|
match self {
|
||||||
Self::QA => String::from(qa::BECH32_PREFIX),
|
Self::QA => &QA_DEFAULTS,
|
||||||
Self::SANDBOX => String::from(sandbox::BECH32_PREFIX),
|
Self::SANDBOX => &SANDBOX_DEFAULTS,
|
||||||
Self::MAINNET => String::from(mainnet::BECH32_PREFIX),
|
Self::MAINNET => &MAINNET_DEFAULTS,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn denom(&self) -> String {
|
pub fn bech32_prefix(&self) -> &str {
|
||||||
match self {
|
self.details().bech32_prefix
|
||||||
Self::QA => String::from(qa::DENOM),
|
}
|
||||||
Self::SANDBOX => String::from(sandbox::DENOM),
|
|
||||||
Self::MAINNET => String::from(mainnet::DENOM),
|
pub fn denom(&self) -> &str {
|
||||||
}
|
self.details().denom
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn mixnet_contract_address(&self) -> &str {
|
||||||
|
self.details().mixnet_contract_address
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vesting_contract_address(&self) -> &str {
|
||||||
|
self.details().vesting_contract_address
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn bandwidth_claim_contract_address(&self) -> &str {
|
||||||
|
self.details().bandwidth_claim_contract_address
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn rewarding_validator_address(&self) -> &str {
|
||||||
|
self.details().rewarding_validator_address
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn validators(&self) -> impl Iterator<Item = &ValidatorDetails> {
|
||||||
|
self.details().validators.iter()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,6 +97,20 @@ pub struct NetworkDetails {
|
|||||||
validators: Vec<ValidatorDetails>,
|
validators: Vec<ValidatorDetails>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<&DefaultNetworkDetails<'_>> for NetworkDetails {
|
||||||
|
fn from(details: &DefaultNetworkDetails) -> Self {
|
||||||
|
NetworkDetails {
|
||||||
|
bech32_prefix: details.bech32_prefix.into(),
|
||||||
|
denom: details.denom.into(),
|
||||||
|
mixnet_contract_address: details.mixnet_contract_address.into(),
|
||||||
|
vesting_contract_address: details.vesting_contract_address.into(),
|
||||||
|
bandwidth_claim_contract_address: details.bandwidth_claim_contract_address.into(),
|
||||||
|
rewarding_validator_address: details.rewarding_validator_address.into(),
|
||||||
|
validators: details.validators.clone(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct SupportedNetworks {
|
pub struct SupportedNetworks {
|
||||||
networks: HashMap<Network, NetworkDetails>,
|
networks: HashMap<Network, NetworkDetails>,
|
||||||
@@ -86,53 +122,13 @@ impl SupportedNetworks {
|
|||||||
|
|
||||||
for network in support {
|
for network in support {
|
||||||
match network {
|
match network {
|
||||||
Network::MAINNET => networks.insert(
|
Network::MAINNET => {
|
||||||
Network::MAINNET,
|
networks.insert(Network::MAINNET, MAINNET_DEFAULTS.deref().into())
|
||||||
NetworkDetails {
|
}
|
||||||
bech32_prefix: String::from(mainnet::BECH32_PREFIX),
|
Network::SANDBOX => {
|
||||||
denom: String::from(mainnet::DENOM),
|
networks.insert(Network::SANDBOX, SANDBOX_DEFAULTS.deref().into())
|
||||||
mixnet_contract_address: String::from(mainnet::MIXNET_CONTRACT_ADDRESS),
|
}
|
||||||
vesting_contract_address: String::from(mainnet::VESTING_CONTRACT_ADDRESS),
|
Network::QA => networks.insert(Network::QA, QA_DEFAULTS.deref().into()),
|
||||||
bandwidth_claim_contract_address: String::from(
|
|
||||||
mainnet::BANDWIDTH_CLAIM_CONTRACT_ADDRESS,
|
|
||||||
),
|
|
||||||
rewarding_validator_address: String::from(
|
|
||||||
mainnet::REWARDING_VALIDATOR_ADDRESS,
|
|
||||||
),
|
|
||||||
validators: mainnet::validators(),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
|
|
||||||
Network::SANDBOX => networks.insert(
|
|
||||||
Network::SANDBOX,
|
|
||||||
NetworkDetails {
|
|
||||||
bech32_prefix: String::from(sandbox::BECH32_PREFIX),
|
|
||||||
denom: String::from(sandbox::DENOM),
|
|
||||||
mixnet_contract_address: String::from(sandbox::MIXNET_CONTRACT_ADDRESS),
|
|
||||||
vesting_contract_address: String::from(sandbox::VESTING_CONTRACT_ADDRESS),
|
|
||||||
bandwidth_claim_contract_address: String::from(
|
|
||||||
sandbox::BANDWIDTH_CLAIM_CONTRACT_ADDRESS,
|
|
||||||
),
|
|
||||||
rewarding_validator_address: String::from(
|
|
||||||
sandbox::REWARDING_VALIDATOR_ADDRESS,
|
|
||||||
),
|
|
||||||
validators: sandbox::validators(),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
Network::QA => networks.insert(
|
|
||||||
Network::QA,
|
|
||||||
NetworkDetails {
|
|
||||||
bech32_prefix: String::from(qa::BECH32_PREFIX),
|
|
||||||
denom: String::from(qa::DENOM),
|
|
||||||
mixnet_contract_address: String::from(qa::MIXNET_CONTRACT_ADDRESS),
|
|
||||||
vesting_contract_address: String::from(qa::VESTING_CONTRACT_ADDRESS),
|
|
||||||
bandwidth_claim_contract_address: String::from(
|
|
||||||
qa::BANDWIDTH_CLAIM_CONTRACT_ADDRESS,
|
|
||||||
),
|
|
||||||
rewarding_validator_address: String::from(qa::REWARDING_VALIDATOR_ADDRESS),
|
|
||||||
validators: qa::validators(),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
SupportedNetworks { networks }
|
SupportedNetworks { networks }
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
// Copyright 2020 - Nym Technologies SA <contact@nymtech.net>
|
// Copyright 2020 - Nym Technologies SA <contact@nymtech.net>
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use once_cell::sync::Lazy;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
@@ -9,64 +11,79 @@ pub mod mainnet;
|
|||||||
pub mod qa;
|
pub mod qa;
|
||||||
pub mod sandbox;
|
pub mod sandbox;
|
||||||
|
|
||||||
|
// The set of defaults that are decided at compile time. Ideally we want to reduce these to a
|
||||||
|
// minimum.
|
||||||
|
// Keep DENOM around mostly for use in contracts. (TODO: consider moving it there, or renaming?)
|
||||||
cfg_if::cfg_if! {
|
cfg_if::cfg_if! {
|
||||||
if #[cfg(network = "mainnet")] {
|
if #[cfg(network = "mainnet")] {
|
||||||
pub const BECH32_PREFIX: &str = mainnet::BECH32_PREFIX;
|
pub const DEFAULT_NETWORK: all::Network = all::Network::MAINNET;
|
||||||
pub const DENOM: &str = mainnet::DENOM;
|
pub const DENOM: &str = mainnet::DENOM;
|
||||||
|
|
||||||
pub const DEFAULT_MIXNET_CONTRACT_ADDRESS: &str = mainnet::MIXNET_CONTRACT_ADDRESS;
|
|
||||||
pub const DEFAULT_VESTING_CONTRACT_ADDRESS: &str = mainnet::VESTING_CONTRACT_ADDRESS;
|
|
||||||
pub const DEFAULT_BANDWIDTH_CLAIM_CONTRACT_ADDRESS: &str = mainnet::BANDWIDTH_CLAIM_CONTRACT_ADDRESS;
|
|
||||||
pub const ETH_CONTRACT_ADDRESS: [u8; 20] = mainnet::_ETH_CONTRACT_ADDRESS;
|
pub const ETH_CONTRACT_ADDRESS: [u8; 20] = mainnet::_ETH_CONTRACT_ADDRESS;
|
||||||
pub const ETH_ERC20_CONTRACT_ADDRESS: [u8; 20] = mainnet::_ETH_ERC20_CONTRACT_ADDRESS;
|
pub const ETH_ERC20_CONTRACT_ADDRESS: [u8; 20] = mainnet::_ETH_ERC20_CONTRACT_ADDRESS;
|
||||||
pub const DEFAULT_REWARDING_VALIDATOR_ADDRESS: &str = mainnet::REWARDING_VALIDATOR_ADDRESS;
|
|
||||||
|
|
||||||
pub fn default_validators() -> Vec<ValidatorDetails> {
|
|
||||||
mainnet::validators()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn default_network() -> all::Network {
|
|
||||||
all::Network::MAINNET
|
|
||||||
}
|
|
||||||
} else if #[cfg(network = "qa")] {
|
} else if #[cfg(network = "qa")] {
|
||||||
pub const BECH32_PREFIX: &str = qa::BECH32_PREFIX;
|
pub const DEFAULT_NETWORK: all::Network = all::Network::QA;
|
||||||
pub const DENOM: &str = qa::DENOM;
|
pub const DENOM: &str = qa::DENOM;
|
||||||
|
|
||||||
pub const DEFAULT_MIXNET_CONTRACT_ADDRESS: &str = qa::MIXNET_CONTRACT_ADDRESS;
|
|
||||||
pub const DEFAULT_VESTING_CONTRACT_ADDRESS: &str = qa::VESTING_CONTRACT_ADDRESS;
|
|
||||||
pub const DEFAULT_BANDWIDTH_CLAIM_CONTRACT_ADDRESS: &str = qa::BANDWIDTH_CLAIM_CONTRACT_ADDRESS;
|
|
||||||
pub const ETH_CONTRACT_ADDRESS: [u8; 20] = qa::_ETH_CONTRACT_ADDRESS;
|
pub const ETH_CONTRACT_ADDRESS: [u8; 20] = qa::_ETH_CONTRACT_ADDRESS;
|
||||||
pub const ETH_ERC20_CONTRACT_ADDRESS: [u8; 20] = qa::_ETH_ERC20_CONTRACT_ADDRESS;
|
pub const ETH_ERC20_CONTRACT_ADDRESS: [u8; 20] = qa::_ETH_ERC20_CONTRACT_ADDRESS;
|
||||||
pub const DEFAULT_REWARDING_VALIDATOR: &str = qa::REWARDING_VALIDATOR_ADDRESS;
|
|
||||||
|
|
||||||
pub fn default_validators() -> Vec<ValidatorDetails> {
|
|
||||||
qa::validators()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn default_network() -> all::Network {
|
|
||||||
all::Network::QA
|
|
||||||
}
|
|
||||||
} else if #[cfg(network = "sandbox")] {
|
} else if #[cfg(network = "sandbox")] {
|
||||||
pub const BECH32_PREFIX: &str = sandbox::BECH32_PREFIX;
|
pub const DEFAULT_NETWORK: all::Network = all::Network::SANDBOX;
|
||||||
pub const DENOM: &str = sandbox::DENOM;
|
pub const DENOM: &str = sandbox::DENOM;
|
||||||
|
|
||||||
pub const DEFAULT_MIXNET_CONTRACT_ADDRESS: &str = sandbox::MIXNET_CONTRACT_ADDRESS;
|
|
||||||
pub const DEFAULT_VESTING_CONTRACT_ADDRESS: &str = sandbox::VESTING_CONTRACT_ADDRESS;
|
|
||||||
pub const DEFAULT_BANDWIDTH_CLAIM_CONTRACT_ADDRESS: &str = sandbox::BANDWIDTH_CLAIM_CONTRACT_ADDRESS;
|
|
||||||
pub const ETH_CONTRACT_ADDRESS: [u8; 20] = sandbox::_ETH_CONTRACT_ADDRESS;
|
pub const ETH_CONTRACT_ADDRESS: [u8; 20] = sandbox::_ETH_CONTRACT_ADDRESS;
|
||||||
pub const ETH_ERC20_CONTRACT_ADDRESS: [u8; 20] = sandbox::_ETH_ERC20_CONTRACT_ADDRESS;
|
pub const ETH_ERC20_CONTRACT_ADDRESS: [u8; 20] = sandbox::_ETH_ERC20_CONTRACT_ADDRESS;
|
||||||
pub const DEFAULT_REWARDING_VALIDATOR: &str = sandbox::REWARDING_VALIDATOR_ADDRESS;
|
|
||||||
|
|
||||||
pub fn default_validators() -> Vec<ValidatorDetails> {
|
|
||||||
sandbox::validators()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn default_network() -> all::Network {
|
|
||||||
all::Network::SANDBOX
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Since these are lazily constructed, we can afford to switch some of them to stronger types in the
|
||||||
|
// future. If we do this, and also get rid of the references we could potentially unify with
|
||||||
|
// `NetworkDetails`.
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct DefaultNetworkDetails<'a> {
|
||||||
|
bech32_prefix: &'a str,
|
||||||
|
denom: &'a str,
|
||||||
|
mixnet_contract_address: &'a str,
|
||||||
|
vesting_contract_address: &'a str,
|
||||||
|
bandwidth_claim_contract_address: &'a str,
|
||||||
|
rewarding_validator_address: &'a str,
|
||||||
|
validators: Vec<ValidatorDetails>,
|
||||||
|
}
|
||||||
|
|
||||||
|
static MAINNET_DEFAULTS: Lazy<DefaultNetworkDetails<'static>> =
|
||||||
|
Lazy::new(|| DefaultNetworkDetails {
|
||||||
|
bech32_prefix: mainnet::BECH32_PREFIX,
|
||||||
|
denom: mainnet::DENOM,
|
||||||
|
mixnet_contract_address: mainnet::MIXNET_CONTRACT_ADDRESS,
|
||||||
|
vesting_contract_address: mainnet::VESTING_CONTRACT_ADDRESS,
|
||||||
|
bandwidth_claim_contract_address: mainnet::BANDWIDTH_CLAIM_CONTRACT_ADDRESS,
|
||||||
|
rewarding_validator_address: mainnet::REWARDING_VALIDATOR_ADDRESS,
|
||||||
|
validators: mainnet::validators(),
|
||||||
|
});
|
||||||
|
|
||||||
|
static SANDBOX_DEFAULTS: Lazy<DefaultNetworkDetails<'static>> =
|
||||||
|
Lazy::new(|| DefaultNetworkDetails {
|
||||||
|
bech32_prefix: sandbox::BECH32_PREFIX,
|
||||||
|
denom: sandbox::DENOM,
|
||||||
|
mixnet_contract_address: sandbox::MIXNET_CONTRACT_ADDRESS,
|
||||||
|
vesting_contract_address: sandbox::VESTING_CONTRACT_ADDRESS,
|
||||||
|
bandwidth_claim_contract_address: sandbox::BANDWIDTH_CLAIM_CONTRACT_ADDRESS,
|
||||||
|
rewarding_validator_address: sandbox::REWARDING_VALIDATOR_ADDRESS,
|
||||||
|
validators: sandbox::validators(),
|
||||||
|
});
|
||||||
|
|
||||||
|
static QA_DEFAULTS: Lazy<DefaultNetworkDetails<'static>> = Lazy::new(|| DefaultNetworkDetails {
|
||||||
|
bech32_prefix: qa::BECH32_PREFIX,
|
||||||
|
denom: qa::DENOM,
|
||||||
|
mixnet_contract_address: qa::MIXNET_CONTRACT_ADDRESS,
|
||||||
|
vesting_contract_address: qa::VESTING_CONTRACT_ADDRESS,
|
||||||
|
bandwidth_claim_contract_address: qa::BANDWIDTH_CLAIM_CONTRACT_ADDRESS,
|
||||||
|
rewarding_validator_address: qa::REWARDING_VALIDATOR_ADDRESS,
|
||||||
|
validators: qa::validators(),
|
||||||
|
});
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct ValidatorDetails {
|
pub struct ValidatorDetails {
|
||||||
// it is assumed those values are always valid since they're being provided in our defaults file
|
// it is assumed those values are always valid since they're being provided in our defaults file
|
||||||
@@ -99,15 +116,15 @@ impl ValidatorDetails {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn default_nymd_endpoints() -> Vec<Url> {
|
pub fn default_nymd_endpoints() -> Vec<Url> {
|
||||||
default_validators()
|
DEFAULT_NETWORK
|
||||||
.iter()
|
.validators()
|
||||||
.map(|validator| validator.nymd_url())
|
.map(|validator| validator.nymd_url())
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn default_api_endpoints() -> Vec<Url> {
|
pub fn default_api_endpoints() -> Vec<Url> {
|
||||||
default_validators()
|
DEFAULT_NETWORK
|
||||||
.iter()
|
.validators()
|
||||||
.filter_map(|validator| validator.api_url())
|
.filter_map(|validator| validator.api_url())
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+506
-15
@@ -27,6 +27,17 @@ version = "0.3.6"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
|
checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "async-trait"
|
||||||
|
version = "0.1.52"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "autocfg"
|
name = "autocfg"
|
||||||
version = "1.0.1"
|
version = "1.0.1"
|
||||||
@@ -60,12 +71,42 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "base16ct"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "base64"
|
name = "base64"
|
||||||
version = "0.13.0"
|
version = "0.13.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
|
checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "base64ct"
|
||||||
|
version = "1.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "874f8444adcb4952a8bc51305c8be95c8ec8237bb0d2e78d2e039f771f8828a0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bip32"
|
||||||
|
version = "0.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "873faa4363bfc54c36a48321da034c92a0645a363eed34d948683ffc1706e37f"
|
||||||
|
dependencies = [
|
||||||
|
"bs58",
|
||||||
|
"hmac",
|
||||||
|
"k256 0.10.2",
|
||||||
|
"once_cell",
|
||||||
|
"pbkdf2",
|
||||||
|
"rand_core 0.6.3",
|
||||||
|
"ripemd160",
|
||||||
|
"sha2",
|
||||||
|
"subtle 2.4.1",
|
||||||
|
"zeroize",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
version = "1.3.2"
|
version = "1.3.2"
|
||||||
@@ -90,7 +131,7 @@ version = "0.7.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b"
|
checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"block-padding",
|
"block-padding 0.1.5",
|
||||||
"byte-tools",
|
"byte-tools",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"generic-array 0.12.4",
|
"generic-array 0.12.4",
|
||||||
@@ -102,6 +143,7 @@ version = "0.9.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
|
checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"block-padding 0.2.1",
|
||||||
"generic-array 0.14.5",
|
"generic-array 0.14.5",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -114,11 +156,20 @@ dependencies = [
|
|||||||
"byte-tools",
|
"byte-tools",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "block-padding"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bs58"
|
name = "bs58"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3"
|
checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3"
|
||||||
|
dependencies = [
|
||||||
|
"sha2",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bumpalo"
|
name = "bumpalo"
|
||||||
@@ -144,6 +195,12 @@ version = "1.4.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
|
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bytes"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.0.72"
|
version = "1.0.72"
|
||||||
@@ -209,6 +266,12 @@ version = "0.6.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9d6f2aa4d0537bcc1c74df8755072bd31c1ef1a3a1b85a68e8404a8c353b7b8b"
|
checksum = "9d6f2aa4d0537bcc1c74df8755072bd31c1ef1a3a1b85a68e8404a8c353b7b8b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "const-oid"
|
||||||
|
version = "0.7.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "contracts-common"
|
name = "contracts-common"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -216,6 +279,39 @@ dependencies = [
|
|||||||
"cosmwasm-std",
|
"cosmwasm-std",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cosmos-sdk-proto"
|
||||||
|
version = "0.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c0254ffee603f5301d6a66963d9e1cc5091479c22e2e925e1f7689c8027a0828"
|
||||||
|
dependencies = [
|
||||||
|
"prost",
|
||||||
|
"prost-types",
|
||||||
|
"tendermint-proto",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cosmrs"
|
||||||
|
version = "0.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "505ea048e9ff2f906d6b954f9f8157d903ca468bfb301d906b40ecc25ba6838d"
|
||||||
|
dependencies = [
|
||||||
|
"bip32",
|
||||||
|
"cosmos-sdk-proto",
|
||||||
|
"ecdsa 0.13.4",
|
||||||
|
"eyre",
|
||||||
|
"getrandom 0.2.3",
|
||||||
|
"k256 0.10.2",
|
||||||
|
"prost",
|
||||||
|
"prost-types",
|
||||||
|
"rand_core 0.6.3",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"subtle-encoding",
|
||||||
|
"tendermint",
|
||||||
|
"thiserror",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmwasm-crypto"
|
name = "cosmwasm-crypto"
|
||||||
version = "1.0.0-beta4"
|
version = "1.0.0-beta4"
|
||||||
@@ -224,7 +320,7 @@ checksum = "f903ebbabc0d4880dbc76148efb8be8fc29fa4bf294c440c3d70da1c8bcafff7"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"digest 0.9.0",
|
"digest 0.9.0",
|
||||||
"ed25519-zebra",
|
"ed25519-zebra",
|
||||||
"k256",
|
"k256 0.9.6",
|
||||||
"rand_core 0.5.1",
|
"rand_core 0.5.1",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
@@ -315,6 +411,18 @@ dependencies = [
|
|||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "crypto-bigint"
|
||||||
|
version = "0.3.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21"
|
||||||
|
dependencies = [
|
||||||
|
"generic-array 0.14.5",
|
||||||
|
"rand_core 0.6.3",
|
||||||
|
"subtle 2.4.1",
|
||||||
|
"zeroize",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crypto-mac"
|
name = "crypto-mac"
|
||||||
version = "0.7.0"
|
version = "0.7.0"
|
||||||
@@ -374,7 +482,16 @@ version = "0.4.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "79b71cca7d95d7681a4b3b9cdf63c8dbc3730d0584c2c74e31416d64a90493f4"
|
checksum = "79b71cca7d95d7681a4b3b9cdf63c8dbc3730d0584c2c74e31416d64a90493f4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"const-oid",
|
"const-oid 0.6.2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "der"
|
||||||
|
version = "0.5.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c"
|
||||||
|
dependencies = [
|
||||||
|
"const-oid 0.7.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -407,12 +524,24 @@ version = "0.12.4"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "43ee23aa5b4f68c7a092b5c3beb25f50c406adc75e2363634f242f28ab255372"
|
checksum = "43ee23aa5b4f68c7a092b5c3beb25f50c406adc75e2363634f242f28ab255372"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"der",
|
"der 0.4.5",
|
||||||
"elliptic-curve",
|
"elliptic-curve 0.10.6",
|
||||||
"hmac",
|
"hmac",
|
||||||
"signature",
|
"signature",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ecdsa"
|
||||||
|
version = "0.13.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9"
|
||||||
|
dependencies = [
|
||||||
|
"der 0.5.1",
|
||||||
|
"elliptic-curve 0.11.12",
|
||||||
|
"rfc6979",
|
||||||
|
"signature",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ed25519"
|
name = "ed25519"
|
||||||
version = "1.4.0"
|
version = "1.4.0"
|
||||||
@@ -450,22 +579,46 @@ dependencies = [
|
|||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "either"
|
||||||
|
version = "1.6.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "elliptic-curve"
|
name = "elliptic-curve"
|
||||||
version = "0.10.6"
|
version = "0.10.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "beca177dcb8eb540133e7680baff45e7cc4d93bf22002676cec549f82343721b"
|
checksum = "beca177dcb8eb540133e7680baff45e7cc4d93bf22002676cec549f82343721b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crypto-bigint",
|
"crypto-bigint 0.2.11",
|
||||||
"ff",
|
"ff 0.10.1",
|
||||||
"generic-array 0.14.5",
|
"generic-array 0.14.5",
|
||||||
"group",
|
"group 0.10.0",
|
||||||
"pkcs8",
|
"pkcs8 0.7.6",
|
||||||
"rand_core 0.6.3",
|
"rand_core 0.6.3",
|
||||||
"subtle 2.4.1",
|
"subtle 2.4.1",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "elliptic-curve"
|
||||||
|
version = "0.11.12"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6"
|
||||||
|
dependencies = [
|
||||||
|
"base16ct",
|
||||||
|
"crypto-bigint 0.3.2",
|
||||||
|
"der 0.5.1",
|
||||||
|
"ff 0.11.0",
|
||||||
|
"generic-array 0.14.5",
|
||||||
|
"group 0.11.0",
|
||||||
|
"rand_core 0.6.3",
|
||||||
|
"sec1",
|
||||||
|
"subtle 2.4.1",
|
||||||
|
"zeroize",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "enum-iterator"
|
name = "enum-iterator"
|
||||||
version = "0.7.0"
|
version = "0.7.0"
|
||||||
@@ -486,6 +639,16 @@ dependencies = [
|
|||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "eyre"
|
||||||
|
version = "0.6.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9289ed2c0440a6536e65119725cf91fc2c6b5e513bfd2e36e1134d7cca6ca12f"
|
||||||
|
dependencies = [
|
||||||
|
"indenter",
|
||||||
|
"once_cell",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fake-simd"
|
name = "fake-simd"
|
||||||
version = "0.1.2"
|
version = "0.1.2"
|
||||||
@@ -502,6 +665,16 @@ dependencies = [
|
|||||||
"subtle 2.4.1",
|
"subtle 2.4.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ff"
|
||||||
|
version = "0.11.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b2958d04124b9f27f175eaeb9a9f383d026098aa837eadd8ba22c11f13a05b9e"
|
||||||
|
dependencies = [
|
||||||
|
"rand_core 0.6.3",
|
||||||
|
"subtle 2.4.1",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fixed"
|
name = "fixed"
|
||||||
version = "1.11.0"
|
version = "1.11.0"
|
||||||
@@ -515,6 +688,16 @@ dependencies = [
|
|||||||
"typenum",
|
"typenum",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "flex-error"
|
||||||
|
version = "0.4.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c606d892c9de11507fa0dcffc116434f94e105d0bbdc4e405b61519464c49d7b"
|
||||||
|
dependencies = [
|
||||||
|
"eyre",
|
||||||
|
"paste",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "form_urlencoded"
|
name = "form_urlencoded"
|
||||||
version = "1.0.1"
|
version = "1.0.1"
|
||||||
@@ -525,6 +708,67 @@ dependencies = [
|
|||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures"
|
||||||
|
version = "0.3.21"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e"
|
||||||
|
dependencies = [
|
||||||
|
"futures-channel",
|
||||||
|
"futures-core",
|
||||||
|
"futures-io",
|
||||||
|
"futures-sink",
|
||||||
|
"futures-task",
|
||||||
|
"futures-util",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-channel"
|
||||||
|
version = "0.3.21"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010"
|
||||||
|
dependencies = [
|
||||||
|
"futures-core",
|
||||||
|
"futures-sink",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-core"
|
||||||
|
version = "0.3.21"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-io"
|
||||||
|
version = "0.3.21"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-sink"
|
||||||
|
version = "0.3.21"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-task"
|
||||||
|
version = "0.3.21"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-util"
|
||||||
|
version = "0.3.21"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a"
|
||||||
|
dependencies = [
|
||||||
|
"futures-core",
|
||||||
|
"futures-sink",
|
||||||
|
"futures-task",
|
||||||
|
"pin-project-lite",
|
||||||
|
"pin-utils",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "generic-array"
|
name = "generic-array"
|
||||||
version = "0.12.4"
|
version = "0.12.4"
|
||||||
@@ -564,8 +808,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
|
checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
|
"js-sys",
|
||||||
"libc",
|
"libc",
|
||||||
"wasi 0.10.2+wasi-snapshot-preview1",
|
"wasi 0.10.2+wasi-snapshot-preview1",
|
||||||
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -599,7 +845,18 @@ version = "0.10.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1c363a5301b8f153d80747126a04b3c82073b9fe3130571a9d170cacdeaf7912"
|
checksum = "1c363a5301b8f153d80747126a04b3c82073b9fe3130571a9d170cacdeaf7912"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ff",
|
"ff 0.10.1",
|
||||||
|
"rand_core 0.6.3",
|
||||||
|
"subtle 2.4.1",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "group"
|
||||||
|
version = "0.11.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89"
|
||||||
|
dependencies = [
|
||||||
|
"ff 0.11.0",
|
||||||
"rand_core 0.6.3",
|
"rand_core 0.6.3",
|
||||||
"subtle 2.4.1",
|
"subtle 2.4.1",
|
||||||
]
|
]
|
||||||
@@ -683,6 +940,21 @@ dependencies = [
|
|||||||
"unicode-normalization",
|
"unicode-normalization",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "indenter"
|
||||||
|
version = "0.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "itertools"
|
||||||
|
version = "0.10.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3"
|
||||||
|
dependencies = [
|
||||||
|
"either",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itoa"
|
name = "itoa"
|
||||||
version = "1.0.1"
|
version = "1.0.1"
|
||||||
@@ -714,11 +986,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "903ae2481bcdfdb7b68e0a9baa4b7c9aff600b9ae2e8e5bb5833b8c91ab851ea"
|
checksum = "903ae2481bcdfdb7b68e0a9baa4b7c9aff600b9ae2e8e5bb5833b8c91ab851ea"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"ecdsa",
|
"ecdsa 0.12.4",
|
||||||
"elliptic-curve",
|
"elliptic-curve 0.10.6",
|
||||||
"sha2",
|
"sha2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "k256"
|
||||||
|
version = "0.10.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1cc5937366afd3b38071f400d1ce5bd8b1d40b5083cc14e6f8dbcc4032a7f5bb"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"ecdsa 0.13.4",
|
||||||
|
"elliptic-curve 0.11.12",
|
||||||
|
"sec1",
|
||||||
|
"sha2",
|
||||||
|
"sha3",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "keccak"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "keystream"
|
name = "keystream"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
@@ -845,12 +1137,25 @@ name = "network-defaults"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
|
"cosmrs",
|
||||||
"hex-literal",
|
"hex-literal",
|
||||||
|
"once_cell",
|
||||||
"serde",
|
"serde",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num-derive"
|
||||||
|
version = "0.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-integer"
|
name = "num-integer"
|
||||||
version = "0.1.44"
|
version = "0.1.44"
|
||||||
@@ -905,6 +1210,21 @@ version = "0.3.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
|
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "paste"
|
||||||
|
version = "1.0.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pbkdf2"
|
||||||
|
version = "0.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f05894bce6a1ba4be299d0c5f29563e08af2bc18bb7d48313113bed71e904739"
|
||||||
|
dependencies = [
|
||||||
|
"crypto-mac 0.11.1",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pem"
|
name = "pem"
|
||||||
version = "0.8.3"
|
version = "0.8.3"
|
||||||
@@ -972,14 +1292,37 @@ dependencies = [
|
|||||||
"sha-1",
|
"sha-1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pin-project-lite"
|
||||||
|
version = "0.2.8"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pin-utils"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pkcs8"
|
name = "pkcs8"
|
||||||
version = "0.7.6"
|
version = "0.7.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ee3ef9b64d26bad0536099c816c6734379e45bbd5f14798def6809e5cc350447"
|
checksum = "ee3ef9b64d26bad0536099c816c6734379e45bbd5f14798def6809e5cc350447"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"der",
|
"der 0.4.5",
|
||||||
"spki",
|
"spki 0.4.1",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pkcs8"
|
||||||
|
version = "0.8.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0"
|
||||||
|
dependencies = [
|
||||||
|
"der 0.5.1",
|
||||||
|
"spki 0.5.4",
|
||||||
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1027,6 +1370,39 @@ dependencies = [
|
|||||||
"unicode-xid",
|
"unicode-xid",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "prost"
|
||||||
|
version = "0.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001"
|
||||||
|
dependencies = [
|
||||||
|
"bytes",
|
||||||
|
"prost-derive",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "prost-derive"
|
||||||
|
version = "0.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"itertools",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "prost-types"
|
||||||
|
version = "0.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a"
|
||||||
|
dependencies = [
|
||||||
|
"bytes",
|
||||||
|
"prost",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quick-error"
|
name = "quick-error"
|
||||||
version = "2.0.1"
|
version = "2.0.1"
|
||||||
@@ -1117,6 +1493,28 @@ version = "0.6.25"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
|
checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rfc6979"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525"
|
||||||
|
dependencies = [
|
||||||
|
"crypto-bigint 0.3.2",
|
||||||
|
"hmac",
|
||||||
|
"zeroize",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ripemd160"
|
||||||
|
version = "0.9.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2eca4ecc81b7f313189bf73ce724400a07da2a6dac19588b03c8bd76a2dcc251"
|
||||||
|
dependencies = [
|
||||||
|
"block-buffer 0.9.0",
|
||||||
|
"digest 0.9.0",
|
||||||
|
"opaque-debug 0.3.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc_version"
|
name = "rustc_version"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
@@ -1162,6 +1560,19 @@ dependencies = [
|
|||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sec1"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1"
|
||||||
|
dependencies = [
|
||||||
|
"der 0.5.1",
|
||||||
|
"generic-array 0.14.5",
|
||||||
|
"pkcs8 0.8.0",
|
||||||
|
"subtle 2.4.1",
|
||||||
|
"zeroize",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "semver"
|
name = "semver"
|
||||||
version = "1.0.4"
|
version = "1.0.4"
|
||||||
@@ -1186,6 +1597,15 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde_bytes"
|
||||||
|
version = "0.11.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.133"
|
version = "1.0.133"
|
||||||
@@ -1255,6 +1675,18 @@ dependencies = [
|
|||||||
"opaque-debug 0.3.0",
|
"opaque-debug 0.3.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sha3"
|
||||||
|
version = "0.9.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809"
|
||||||
|
dependencies = [
|
||||||
|
"block-buffer 0.9.0",
|
||||||
|
"digest 0.9.0",
|
||||||
|
"keccak",
|
||||||
|
"opaque-debug 0.3.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "signature"
|
name = "signature"
|
||||||
version = "1.3.2"
|
version = "1.3.2"
|
||||||
@@ -1294,7 +1726,17 @@ version = "0.4.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5c01a0c15da1b0b0e1494112e7af814a678fec9bd157881b49beac661e9b6f32"
|
checksum = "5c01a0c15da1b0b0e1494112e7af814a678fec9bd157881b49beac661e9b6f32"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"der",
|
"der 0.4.5",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "spki"
|
||||||
|
version = "0.5.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27"
|
||||||
|
dependencies = [
|
||||||
|
"base64ct",
|
||||||
|
"der 0.5.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1347,6 +1789,55 @@ dependencies = [
|
|||||||
"unicode-xid",
|
"unicode-xid",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tendermint"
|
||||||
|
version = "0.23.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a9ef686b8ecd36550d0581f0989c9d8607090b23005df479d8e6ba348b5800b9"
|
||||||
|
dependencies = [
|
||||||
|
"async-trait",
|
||||||
|
"bytes",
|
||||||
|
"ed25519",
|
||||||
|
"ed25519-dalek",
|
||||||
|
"flex-error",
|
||||||
|
"futures",
|
||||||
|
"k256 0.10.2",
|
||||||
|
"num-traits",
|
||||||
|
"once_cell",
|
||||||
|
"prost",
|
||||||
|
"prost-types",
|
||||||
|
"ripemd160",
|
||||||
|
"serde",
|
||||||
|
"serde_bytes",
|
||||||
|
"serde_json",
|
||||||
|
"serde_repr",
|
||||||
|
"sha2",
|
||||||
|
"signature",
|
||||||
|
"subtle 2.4.1",
|
||||||
|
"subtle-encoding",
|
||||||
|
"tendermint-proto",
|
||||||
|
"time 0.3.6",
|
||||||
|
"zeroize",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tendermint-proto"
|
||||||
|
version = "0.23.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a9e0a0251fd81bed7420bea0f4d91c2a58f6c9fa34d5b2f70bed0ba8890de5aa"
|
||||||
|
dependencies = [
|
||||||
|
"bytes",
|
||||||
|
"flex-error",
|
||||||
|
"num-derive",
|
||||||
|
"num-traits",
|
||||||
|
"prost",
|
||||||
|
"prost-types",
|
||||||
|
"serde",
|
||||||
|
"serde_bytes",
|
||||||
|
"subtle-encoding",
|
||||||
|
"time 0.3.6",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror"
|
name = "thiserror"
|
||||||
version = "1.0.30"
|
version = "1.0.30"
|
||||||
|
|||||||
@@ -335,7 +335,7 @@ pub fn migrate(_deps: DepsMut<'_>, _env: Env, _msg: MigrateMsg) -> Result<Respon
|
|||||||
pub mod tests {
|
pub mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::support::tests;
|
use crate::support::tests;
|
||||||
use config::defaults::DENOM;
|
use config::defaults::{DEFAULT_NETWORK, DENOM};
|
||||||
use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info};
|
use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info};
|
||||||
use cosmwasm_std::{coins, from_binary};
|
use cosmwasm_std::{coins, from_binary};
|
||||||
use mixnet_contract_common::PagedMixnodeResponse;
|
use mixnet_contract_common::PagedMixnodeResponse;
|
||||||
@@ -345,7 +345,7 @@ pub mod tests {
|
|||||||
let mut deps = mock_dependencies();
|
let mut deps = mock_dependencies();
|
||||||
let env = mock_env();
|
let env = mock_env();
|
||||||
let msg = InstantiateMsg {
|
let msg = InstantiateMsg {
|
||||||
rewarding_validator_address: config::defaults::DEFAULT_REWARDING_VALIDATOR.to_string(),
|
rewarding_validator_address: DEFAULT_NETWORK.rewarding_validator_address().to_string(),
|
||||||
};
|
};
|
||||||
let info = mock_info("creator", &[]);
|
let info = mock_info("creator", &[]);
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ pub mod test_helpers {
|
|||||||
use crate::mixnodes::storage as mixnodes_storage;
|
use crate::mixnodes::storage as mixnodes_storage;
|
||||||
use crate::mixnodes::transactions::try_add_mixnode;
|
use crate::mixnodes::transactions::try_add_mixnode;
|
||||||
use crate::support::tests;
|
use crate::support::tests;
|
||||||
use config::defaults::DENOM;
|
use config::defaults::{DEFAULT_NETWORK, DENOM};
|
||||||
use cosmwasm_std::testing::mock_dependencies;
|
use cosmwasm_std::testing::mock_dependencies;
|
||||||
use cosmwasm_std::testing::mock_env;
|
use cosmwasm_std::testing::mock_env;
|
||||||
use cosmwasm_std::testing::mock_info;
|
use cosmwasm_std::testing::mock_info;
|
||||||
@@ -83,7 +83,7 @@ pub mod test_helpers {
|
|||||||
pub fn init_contract() -> OwnedDeps<MemoryStorage, MockApi, MockQuerier<Empty>> {
|
pub fn init_contract() -> OwnedDeps<MemoryStorage, MockApi, MockQuerier<Empty>> {
|
||||||
let mut deps = mock_dependencies();
|
let mut deps = mock_dependencies();
|
||||||
let msg = InstantiateMsg {
|
let msg = InstantiateMsg {
|
||||||
rewarding_validator_address: config::defaults::DEFAULT_REWARDING_VALIDATOR.to_string(),
|
rewarding_validator_address: DEFAULT_NETWORK.rewarding_validator_address().to_string(),
|
||||||
};
|
};
|
||||||
let env = mock_env();
|
let env = mock_env();
|
||||||
let info = mock_info("creator", &[]);
|
let info = mock_info("creator", &[]);
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
use network_defaults::{
|
use network_defaults::{default_api_endpoints, default_nymd_endpoints, DEFAULT_NETWORK};
|
||||||
default_api_endpoints, default_network, default_nymd_endpoints, DEFAULT_MIXNET_CONTRACT_ADDRESS,
|
|
||||||
};
|
|
||||||
use validator_client::nymd::QueryNymdClient;
|
use validator_client::nymd::QueryNymdClient;
|
||||||
|
|
||||||
pub(crate) fn new_nymd_client() -> validator_client::Client<QueryNymdClient> {
|
pub(crate) fn new_nymd_client() -> validator_client::Client<QueryNymdClient> {
|
||||||
let network = default_network();
|
let network = DEFAULT_NETWORK;
|
||||||
let mixnet_contract = DEFAULT_MIXNET_CONTRACT_ADDRESS.to_string();
|
let mixnet_contract = network.mixnet_contract_address().to_string();
|
||||||
let nymd_url = default_nymd_endpoints()[0].clone();
|
let nymd_url = default_nymd_endpoints()[0].clone();
|
||||||
let api_url = default_api_endpoints()[0].clone();
|
let api_url = default_api_endpoints()[0].clone();
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
use bip39::core::str::FromStr;
|
use bip39::core::str::FromStr;
|
||||||
use bip39::Mnemonic;
|
use bip39::Mnemonic;
|
||||||
|
use config::defaults::DEFAULT_NETWORK;
|
||||||
use rand::seq::SliceRandom;
|
use rand::seq::SliceRandom;
|
||||||
use rand::thread_rng;
|
use rand::thread_rng;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
@@ -19,10 +20,7 @@ use bandwidth_claim_contract::payment::LinkPaymentData;
|
|||||||
use credentials::token::bandwidth::TokenCredential;
|
use credentials::token::bandwidth::TokenCredential;
|
||||||
use crypto::asymmetric::identity::{PublicKey, Signature, SIGNATURE_LENGTH};
|
use crypto::asymmetric::identity::{PublicKey, Signature, SIGNATURE_LENGTH};
|
||||||
use gateway_client::bandwidth::eth_contract;
|
use gateway_client::bandwidth::eth_contract;
|
||||||
use network_defaults::{
|
use network_defaults::{ETH_EVENT_NAME, ETH_MIN_BLOCK_DEPTH};
|
||||||
DEFAULT_BANDWIDTH_CLAIM_CONTRACT_ADDRESS, DEFAULT_MIXNET_CONTRACT_ADDRESS, ETH_EVENT_NAME,
|
|
||||||
ETH_MIN_BLOCK_DEPTH,
|
|
||||||
};
|
|
||||||
use validator_client::nymd::{AccountId, NymdClient, SigningNymdClient};
|
use validator_client::nymd::{AccountId, NymdClient, SigningNymdClient};
|
||||||
|
|
||||||
pub(crate) struct ERC20Bridge {
|
pub(crate) struct ERC20Bridge {
|
||||||
@@ -42,11 +40,11 @@ impl ERC20Bridge {
|
|||||||
let mnemonic =
|
let mnemonic =
|
||||||
Mnemonic::from_str(&cosmos_mnemonic).expect("Invalid Cosmos mnemonic provided");
|
Mnemonic::from_str(&cosmos_mnemonic).expect("Invalid Cosmos mnemonic provided");
|
||||||
let nymd_client = NymdClient::connect_with_mnemonic(
|
let nymd_client = NymdClient::connect_with_mnemonic(
|
||||||
config::defaults::default_network(),
|
DEFAULT_NETWORK,
|
||||||
nymd_url.as_ref(),
|
nymd_url.as_ref(),
|
||||||
AccountId::from_str(DEFAULT_MIXNET_CONTRACT_ADDRESS).ok(),
|
AccountId::from_str(DEFAULT_NETWORK.mixnet_contract_address()).ok(),
|
||||||
None,
|
None,
|
||||||
AccountId::from_str(DEFAULT_BANDWIDTH_CLAIM_CONTRACT_ADDRESS).ok(),
|
AccountId::from_str(DEFAULT_NETWORK.bandwidth_claim_contract_address()).ok(),
|
||||||
mnemonic,
|
mnemonic,
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
|
|||||||
Generated
+1
@@ -2781,6 +2781,7 @@ version = "0.1.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"hex-literal",
|
"hex-literal",
|
||||||
|
"once_cell",
|
||||||
"serde",
|
"serde",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"url",
|
"url",
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ async fn _connect_with_mnemonic(
|
|||||||
mnemonic: Mnemonic,
|
mnemonic: Mnemonic,
|
||||||
state: tauri::State<'_, Arc<RwLock<State>>>,
|
state: tauri::State<'_, Arc<RwLock<State>>>,
|
||||||
) -> Result<Account, BackendError> {
|
) -> Result<Account, BackendError> {
|
||||||
let default_network = Network::try_from(config::defaults::default_network())?;
|
let default_network = Network::try_from(config::defaults::DEFAULT_NETWORK)?;
|
||||||
let mut default_account = None;
|
let mut default_account = None;
|
||||||
for network in Network::iter() {
|
for network in Network::iter() {
|
||||||
let client = {
|
let client = {
|
||||||
@@ -162,6 +162,7 @@ async fn _connect_with_mnemonic(
|
|||||||
w_state.add_client(network, client);
|
w_state.add_client(network, client);
|
||||||
}
|
}
|
||||||
|
|
||||||
default_account
|
default_account.ok_or(BackendError::NetworkNotSupported(
|
||||||
.ok_or_else(|| BackendError::NetworkNotSupported(config::defaults::default_network()))
|
config::defaults::DEFAULT_NETWORK,
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
use crate::config::template::config_template;
|
use crate::config::template::config_template;
|
||||||
use config::defaults::{default_api_endpoints, DEFAULT_MIXNET_CONTRACT_ADDRESS};
|
use config::defaults::{default_api_endpoints, DEFAULT_NETWORK};
|
||||||
use config::NymConfig;
|
use config::NymConfig;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
@@ -97,7 +97,7 @@ impl Default for Base {
|
|||||||
local_validator: DEFAULT_LOCAL_VALIDATOR
|
local_validator: DEFAULT_LOCAL_VALIDATOR
|
||||||
.parse()
|
.parse()
|
||||||
.expect("default local validator is malformed!"),
|
.expect("default local validator is malformed!"),
|
||||||
mixnet_contract_address: DEFAULT_MIXNET_CONTRACT_ADDRESS.to_string(),
|
mixnet_contract_address: DEFAULT_NETWORK.mixnet_contract_address().to_string(),
|
||||||
#[cfg(feature = "coconut")]
|
#[cfg(feature = "coconut")]
|
||||||
keypair_bs58: String::default(),
|
keypair_bs58: String::default(),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use crate::rewarding::{error::RewardingError, IntervalRewardParams, MixnodeToReward};
|
use crate::rewarding::{error::RewardingError, IntervalRewardParams, MixnodeToReward};
|
||||||
use config::defaults::{default_network, DEFAULT_VALIDATOR_API_PORT};
|
use config::defaults::{DEFAULT_NETWORK, DEFAULT_VALIDATOR_API_PORT};
|
||||||
use mixnet_contract_common::{
|
use mixnet_contract_common::{
|
||||||
ContractStateParams, Delegation, ExecuteMsg, GatewayBond, IdentityKey, Interval, MixNodeBond,
|
ContractStateParams, Delegation, ExecuteMsg, GatewayBond, IdentityKey, Interval, MixNodeBond,
|
||||||
MixnodeRewardingStatusResponse, RewardedSetNodeStatus, RewardedSetUpdateDetails,
|
MixnodeRewardingStatusResponse, RewardedSetNodeStatus, RewardedSetUpdateDetails,
|
||||||
@@ -37,7 +37,7 @@ impl Client<QueryNymdClient> {
|
|||||||
.parse()
|
.parse()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let nymd_url = config.get_nymd_validator_url();
|
let nymd_url = config.get_nymd_validator_url();
|
||||||
let network = default_network();
|
let network = DEFAULT_NETWORK;
|
||||||
|
|
||||||
let mixnet_contract = config
|
let mixnet_contract = config
|
||||||
.get_mixnet_contract_address()
|
.get_mixnet_contract_address()
|
||||||
@@ -67,7 +67,7 @@ impl Client<SigningNymdClient> {
|
|||||||
.parse()
|
.parse()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let nymd_url = config.get_nymd_validator_url();
|
let nymd_url = config.get_nymd_validator_url();
|
||||||
let network = default_network();
|
let network = DEFAULT_NETWORK;
|
||||||
|
|
||||||
let mixnet_contract = config
|
let mixnet_contract = config
|
||||||
.get_mixnet_contract_address()
|
.get_mixnet_contract_address()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use crate::storage::models::{
|
|||||||
FailedMixnodeRewardChunk, PossiblyUnrewardedMixnode, RewardingReport,
|
FailedMixnodeRewardChunk, PossiblyUnrewardedMixnode, RewardingReport,
|
||||||
};
|
};
|
||||||
use crate::storage::ValidatorApiStorage;
|
use crate::storage::ValidatorApiStorage;
|
||||||
use config::defaults::DENOM;
|
use config::defaults::DEFAULT_NETWORK;
|
||||||
use log::{error, info};
|
use log::{error, info};
|
||||||
use mixnet_contract_common::mixnode::NodeRewardParams;
|
use mixnet_contract_common::mixnode::NodeRewardParams;
|
||||||
use mixnet_contract_common::{
|
use mixnet_contract_common::{
|
||||||
@@ -201,15 +201,18 @@ impl Rewarder {
|
|||||||
info!("Rewarding pool stats");
|
info!("Rewarding pool stats");
|
||||||
info!(
|
info!(
|
||||||
"-- Reward pool: {} {}",
|
"-- Reward pool: {} {}",
|
||||||
interval_reward_params.reward_pool, DENOM
|
interval_reward_params.reward_pool,
|
||||||
|
DEFAULT_NETWORK.denom()
|
||||||
);
|
);
|
||||||
info!(
|
info!(
|
||||||
"---- Interval reward pool: {} {}",
|
"---- Interval reward pool: {} {}",
|
||||||
interval_reward_params.period_reward_pool, DENOM
|
interval_reward_params.period_reward_pool,
|
||||||
|
DEFAULT_NETWORK.denom()
|
||||||
);
|
);
|
||||||
info!(
|
info!(
|
||||||
"-- Circulating supply: {} {}",
|
"-- Circulating supply: {} {}",
|
||||||
interval_reward_params.circulating_supply, DENOM
|
interval_reward_params.circulating_supply,
|
||||||
|
DEFAULT_NETWORK.denom()
|
||||||
);
|
);
|
||||||
|
|
||||||
// 1. get list of all currently bonded nodes
|
// 1. get list of all currently bonded nodes
|
||||||
|
|||||||
Reference in New Issue
Block a user