From 898070bc87f0450246b2fafa118a89ab5fc0c730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogdan-=C8=98tefan=20Neac=C8=99u?= Date: Thu, 13 Jan 2022 13:49:21 +0200 Subject: [PATCH] Rename some defaults --- common/network-defaults/src/lib.rs | 12 ++++++------ contracts/mixnet/src/contract.rs | 2 +- contracts/mixnet/src/support/tests/mod.rs | 2 +- .../websocket/connection_handler/eth_events.rs | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/common/network-defaults/src/lib.rs b/common/network-defaults/src/lib.rs index 18af77031e..261f067c33 100644 --- a/common/network-defaults/src/lib.rs +++ b/common/network-defaults/src/lib.rs @@ -17,8 +17,8 @@ cfg_if::cfg_if! { pub const DEFAULT_MIXNET_CONTRACT_ADDRESS: &str = milhon::MIXNET_CONTRACT_ADDRESS; pub const DEFAULT_VESTING_CONTRACT_ADDRESS: &str = milhon::VESTING_CONTRACT_ADDRESS; - pub const BANDWIDTH_CLAIM_CONTRACT_ADDRESS: &str = milhon::BANDWIDTH_CLAIM_CONTRACT_ADDRESS; - pub const REWARDING_VALIDATOR_ADDRESS: &str = milhon::REWARDING_VALIDATOR_ADDRESS; + pub const DEFAULT_BANDWIDTH_CLAIM_CONTRACT_ADDRESS: &str = milhon::BANDWIDTH_CLAIM_CONTRACT_ADDRESS; + pub const DEFAULT_REWARDING_VALIDATOR_ADDRESS: &str = milhon::REWARDING_VALIDATOR_ADDRESS; pub fn default_validators() -> Vec { milhon::validators() @@ -29,8 +29,8 @@ cfg_if::cfg_if! { pub const DEFAULT_MIXNET_CONTRACT_ADDRESS: &str = qa::MIXNET_CONTRACT_ADDRESS; pub const DEFAULT_VESTING_CONTRACT_ADDRESS: &str = qa::VESTING_CONTRACT_ADDRESS; - pub const BANDWIDTH_CLAIM_CONTRACT_ADDRESS: &str = qa::BANDWIDTH_CLAIM_CONTRACT_ADDRESS; - pub const REWARDING_VALIDATOR_ADDRESS: &str = qa::REWARDING_VALIDATOR_ADDRESS; + pub const DEFAULT_BANDWIDTH_CLAIM_CONTRACT_ADDRESS: &str = qa::BANDWIDTH_CLAIM_CONTRACT_ADDRESS; + pub const DEFAULT_REWARDING_VALIDATOR: &str = qa::REWARDING_VALIDATOR_ADDRESS; pub fn default_validators() -> Vec { qa::validators() @@ -41,8 +41,8 @@ cfg_if::cfg_if! { pub const DEFAULT_MIXNET_CONTRACT_ADDRESS: &str = sandbox::MIXNET_CONTRACT_ADDRESS; pub const DEFAULT_VESTING_CONTRACT_ADDRESS: &str = sandbox::VESTING_CONTRACT_ADDRESS; - pub const BANDWIDTH_CLAIM_CONTRACT_ADDRESS: &str = sandbox::BANDWIDTH_CLAIM_CONTRACT_ADDRESS; - pub const REWARDING_VALIDATOR_ADDRESS: &str = sandbox::REWARDING_VALIDATOR_ADDRESS; + pub const DEFAULT_BANDWIDTH_CLAIM_CONTRACT_ADDRESS: &str = sandbox::BANDWIDTH_CLAIM_CONTRACT_ADDRESS; + pub const DEFAULT_REWARDING_VALIDATOR: &str = sandbox::REWARDING_VALIDATOR_ADDRESS; pub fn default_validators() -> Vec { sandbox::validators() diff --git a/contracts/mixnet/src/contract.rs b/contracts/mixnet/src/contract.rs index badd8d12c6..9013f55848 100644 --- a/contracts/mixnet/src/contract.rs +++ b/contracts/mixnet/src/contract.rs @@ -363,7 +363,7 @@ pub mod tests { let mut deps = mock_dependencies(); let env = mock_env(); let msg = InstantiateMsg { - rewarding_validator_address: config::defaults::REWARDING_VALIDATOR_ADDRESS.to_string(), + rewarding_validator_address: config::defaults::DEFAULT_REWARDING_VALIDATOR.to_string(), }; let info = mock_info("creator", &[]); diff --git a/contracts/mixnet/src/support/tests/mod.rs b/contracts/mixnet/src/support/tests/mod.rs index 3218b72162..547c68ffdd 100644 --- a/contracts/mixnet/src/support/tests/mod.rs +++ b/contracts/mixnet/src/support/tests/mod.rs @@ -81,7 +81,7 @@ pub mod test_helpers { pub fn init_contract() -> OwnedDeps> { let mut deps = mock_dependencies(); let msg = InstantiateMsg { - rewarding_validator_address: config::defaults::REWARDING_VALIDATOR_ADDRESS.to_string(), + rewarding_validator_address: config::defaults::DEFAULT_REWARDING_VALIDATOR.to_string(), }; let env = mock_env(); let info = mock_info("creator", &[]); diff --git a/gateway/src/node/client_handling/websocket/connection_handler/eth_events.rs b/gateway/src/node/client_handling/websocket/connection_handler/eth_events.rs index 2c0cb6e8ea..f163daae6b 100644 --- a/gateway/src/node/client_handling/websocket/connection_handler/eth_events.rs +++ b/gateway/src/node/client_handling/websocket/connection_handler/eth_events.rs @@ -20,7 +20,7 @@ use credentials::token::bandwidth::TokenCredential; use crypto::asymmetric::identity::{PublicKey, Signature}; use gateway_client::bandwidth::eth_contract; use network_defaults::{ - BANDWIDTH_CLAIM_CONTRACT_ADDRESS, DENOM, ETH_EVENT_NAME, ETH_MIN_BLOCK_DEPTH, + DEFAULT_BANDWIDTH_CLAIM_CONTRACT_ADDRESS, DENOM, ETH_EVENT_NAME, ETH_MIN_BLOCK_DEPTH, }; use validator_client::nymd::{ AccountId, CosmosCoin, Decimal, Denom, NymdClient, SigningNymdClient, @@ -44,7 +44,7 @@ impl ERC20Bridge { Mnemonic::from_str(&cosmos_mnemonic).expect("Invalid Cosmos mnemonic provided"); let nymd_client = NymdClient::connect_with_mnemonic( nymd_url.as_ref(), - AccountId::from_str(BANDWIDTH_CLAIM_CONTRACT_ADDRESS).ok(), + AccountId::from_str(DEFAULT_BANDWIDTH_CLAIM_CONTRACT_ADDRESS).ok(), None, mnemonic, None,