Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions automap/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion automap/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "automap"
version = "0.8.2"
version = "0.9.0"
authors = ["Dan Wiebe <[email protected]>", "MASQ"]
license = "GPL-3.0-only"
description = "Library full of code to make routers map ports through firewalls"
Expand Down
4 changes: 2 additions & 2 deletions dns_utility/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dns_utility/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dns_utility"
version = "0.8.2"
version = "0.9.0"
license = "GPL-3.0-only"
authors = ["Dan Wiebe <[email protected]>", "MASQ"]
copyright = "Copyright (c) 2019, MASQ (https://masq.ai) and/or its affiliates. All rights reserved."
Expand Down
2 changes: 1 addition & 1 deletion masq/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "masq"
version = "0.8.2"
version = "0.9.0"
authors = ["Dan Wiebe <[email protected]>", "MASQ"]
license = "GPL-3.0-only"
description = "Reference implementation of user interface for MASQ Node"
Expand Down
2 changes: 1 addition & 1 deletion masq_lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "masq_lib"
version = "0.8.2"
version = "0.9.0"
authors = ["Dan Wiebe <[email protected]>", "MASQ"]
license = "GPL-3.0-only"
description = "Code common to Node and masq; also, temporarily, to dns_utility"
Expand Down
33 changes: 32 additions & 1 deletion masq_lib/src/blockchains/blockchain_records.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,68 @@ use crate::constants::{
};
use ethereum_types::{Address, H160};

// TODO these should probably be a static, and dynamic initialization should then also be allowed
pub const CHAINS: [BlockchainRecord; 7] = [
BlockchainRecord {
self_id: Chain::PolyMainnet,
num_chain_id: 137,
literal_identifier: POLYGON_MAINNET_FULL_IDENTIFIER,
gas_price_default_margin_percents: 30,
gas_price_safe_ceiling_minor: 200_000_000_000,
contract: POLYGON_MAINNET_CONTRACT_ADDRESS,
contract_creation_block: POLYGON_MAINNET_CONTRACT_CREATION_BLOCK,
},
BlockchainRecord {
self_id: Chain::EthMainnet,
num_chain_id: 1,
literal_identifier: ETH_MAINNET_FULL_IDENTIFIER,
gas_price_default_margin_percents: 30,
gas_price_safe_ceiling_minor: 100_000_000_000,
contract: ETH_MAINNET_CONTRACT_ADDRESS,
contract_creation_block: ETH_MAINNET_CONTRACT_CREATION_BLOCK,
},
BlockchainRecord {
self_id: Chain::BaseMainnet,
num_chain_id: 8453,
literal_identifier: BASE_MAINNET_FULL_IDENTIFIER,
gas_price_default_margin_percents: 30,
gas_price_safe_ceiling_minor: 50_000_000_000,
contract: BASE_MAINNET_CONTRACT_ADDRESS,
contract_creation_block: BASE_MAINNET_CONTRACT_CREATION_BLOCK,
},
BlockchainRecord {
self_id: Chain::BaseSepolia,
num_chain_id: 84532,
literal_identifier: BASE_SEPOLIA_FULL_IDENTIFIER,
gas_price_default_margin_percents: 30,
gas_price_safe_ceiling_minor: 50_000_000_000,
contract: BASE_SEPOLIA_TESTNET_CONTRACT_ADDRESS,
contract_creation_block: BASE_SEPOLIA_CONTRACT_CREATION_BLOCK,
},
BlockchainRecord {
self_id: Chain::PolyAmoy,
num_chain_id: 80002,
literal_identifier: POLYGON_AMOY_FULL_IDENTIFIER,
gas_price_default_margin_percents: 30,
gas_price_safe_ceiling_minor: 200_000_000_000,
contract: POLYGON_AMOY_TESTNET_CONTRACT_ADDRESS,
contract_creation_block: POLYGON_AMOY_CONTRACT_CREATION_BLOCK,
},
BlockchainRecord {
self_id: Chain::EthRopsten,
num_chain_id: 3,
literal_identifier: ETH_ROPSTEN_FULL_IDENTIFIER,
gas_price_default_margin_percents: 30,
gas_price_safe_ceiling_minor: 100_000_000_000,
contract: ETH_ROPSTEN_TESTNET_CONTRACT_ADDRESS,
contract_creation_block: ETH_ROPSTEN_CONTRACT_CREATION_BLOCK,
},
BlockchainRecord {
self_id: Chain::Dev,
num_chain_id: 2,
literal_identifier: DEV_CHAIN_FULL_IDENTIFIER,
gas_price_default_margin_percents: 30,
gas_price_safe_ceiling_minor: 200_000_000_000,
contract: MULTINODE_TESTNET_CONTRACT_ADDRESS,
contract_creation_block: MULTINODE_TESTNET_CONTRACT_CREATION_BLOCK,
},
Expand All @@ -69,6 +84,8 @@ pub struct BlockchainRecord {
pub self_id: Chain,
pub num_chain_id: u64,
pub literal_identifier: &'static str,
pub gas_price_default_margin_percents: u8,
pub gas_price_safe_ceiling_minor: u128,
pub contract: Address,
pub contract_creation_block: u64,
}
Expand Down Expand Up @@ -115,7 +132,7 @@ const POLYGON_MAINNET_CONTRACT_ADDRESS: Address = H160([
mod tests {
use super::*;
use crate::blockchains::chains::chain_from_chain_identifier_opt;
use crate::constants::BASE_MAINNET_CONTRACT_CREATION_BLOCK;
use crate::constants::{BASE_MAINNET_CONTRACT_CREATION_BLOCK, WEIS_IN_GWEI};
use std::collections::HashSet;
use std::iter::FromIterator;

Expand Down Expand Up @@ -195,6 +212,8 @@ mod tests {
num_chain_id: 1,
self_id: examined_chain,
literal_identifier: "eth-mainnet",
gas_price_default_margin_percents: 30,
gas_price_safe_ceiling_minor: 100 * WEIS_IN_GWEI as u128,
contract: ETH_MAINNET_CONTRACT_ADDRESS,
contract_creation_block: ETH_MAINNET_CONTRACT_CREATION_BLOCK,
}
Expand All @@ -211,6 +230,8 @@ mod tests {
num_chain_id: 3,
self_id: examined_chain,
literal_identifier: "eth-ropsten",
gas_price_default_margin_percents: 30,
gas_price_safe_ceiling_minor: 100 * WEIS_IN_GWEI as u128,
contract: ETH_ROPSTEN_TESTNET_CONTRACT_ADDRESS,
contract_creation_block: ETH_ROPSTEN_CONTRACT_CREATION_BLOCK,
}
Expand All @@ -227,6 +248,8 @@ mod tests {
num_chain_id: 137,
self_id: examined_chain,
literal_identifier: "polygon-mainnet",
gas_price_default_margin_percents: 30,
gas_price_safe_ceiling_minor: 200 * WEIS_IN_GWEI as u128,
contract: POLYGON_MAINNET_CONTRACT_ADDRESS,
contract_creation_block: POLYGON_MAINNET_CONTRACT_CREATION_BLOCK,
}
Expand All @@ -243,6 +266,8 @@ mod tests {
num_chain_id: 80002,
self_id: examined_chain,
literal_identifier: "polygon-amoy",
gas_price_default_margin_percents: 30,
gas_price_safe_ceiling_minor: 200 * WEIS_IN_GWEI as u128,
contract: POLYGON_AMOY_TESTNET_CONTRACT_ADDRESS,
contract_creation_block: POLYGON_AMOY_CONTRACT_CREATION_BLOCK,
}
Expand All @@ -259,6 +284,8 @@ mod tests {
num_chain_id: 8453,
self_id: examined_chain,
literal_identifier: "base-mainnet",
gas_price_default_margin_percents: 30,
gas_price_safe_ceiling_minor: 50 * WEIS_IN_GWEI as u128,
contract: BASE_MAINNET_CONTRACT_ADDRESS,
contract_creation_block: BASE_MAINNET_CONTRACT_CREATION_BLOCK,
}
Expand All @@ -275,6 +302,8 @@ mod tests {
num_chain_id: 84532,
self_id: examined_chain,
literal_identifier: "base-sepolia",
gas_price_default_margin_percents: 30,
gas_price_safe_ceiling_minor: 50 * WEIS_IN_GWEI as u128,
contract: BASE_SEPOLIA_TESTNET_CONTRACT_ADDRESS,
contract_creation_block: BASE_SEPOLIA_CONTRACT_CREATION_BLOCK,
}
Expand All @@ -291,6 +320,8 @@ mod tests {
num_chain_id: 2,
self_id: examined_chain,
literal_identifier: "dev",
gas_price_default_margin_percents: 30,
gas_price_safe_ceiling_minor: 200 * WEIS_IN_GWEI as u128,
contract: MULTINODE_TESTNET_CONTRACT_ADDRESS,
contract_creation_block: MULTINODE_TESTNET_CONTRACT_CREATION_BLOCK,
}
Expand Down
2 changes: 2 additions & 0 deletions masq_lib/src/blockchains/chains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ mod tests {
num_chain_id: 0,
self_id: Chain::PolyMainnet,
literal_identifier: "",
gas_price_default_margin_percents: 0,
gas_price_safe_ceiling_minor: 0,
contract: Default::default(),
contract_creation_block: 0,
}
Expand Down
2 changes: 1 addition & 1 deletion masq_lib/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::data_version::DataVersion;
use const_format::concatcp;

pub const DEFAULT_CHAIN: Chain = Chain::PolyMainnet;
pub const CURRENT_SCHEMA_VERSION: usize = 10;
pub const CURRENT_SCHEMA_VERSION: usize = 11;

pub const HIGHEST_RANDOM_CLANDESTINE_PORT: u16 = 9999;
pub const HTTP_PORT: u16 = 80;
Expand Down
1 change: 0 additions & 1 deletion masq_lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@ pub mod data_version;
pub mod exit_locations;
pub mod shared_schema;
pub mod test_utils;
pub mod type_obfuscation;
pub mod ui_gateway;
pub mod ui_traffic_converter;
16 changes: 8 additions & 8 deletions masq_lib/src/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,10 +527,10 @@ pub struct UiRatePack {

#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
pub struct UiScanIntervals {
#[serde(rename = "pendingPayableSec")]
pub pending_payable_sec: u64,
#[serde(rename = "payableSec")]
pub payable_sec: u64,
#[serde(rename = "pendingPayableSec")]
pub pending_payable_sec: u64,
#[serde(rename = "receivableSec")]
pub receivable_sec: u64,
}
Expand Down Expand Up @@ -783,8 +783,8 @@ conversation_message!(UiRecoverWalletsResponse, "recoverWallets");
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone, Copy, Hash)]
pub enum ScanType {
Payables,
Receivables,
PendingPayables,
Receivables,
}

impl FromStr for ScanType {
Expand All @@ -793,8 +793,8 @@ impl FromStr for ScanType {
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
s if &s.to_lowercase() == "payables" => Ok(ScanType::Payables),
s if &s.to_lowercase() == "receivables" => Ok(ScanType::Receivables),
s if &s.to_lowercase() == "pendingpayables" => Ok(ScanType::PendingPayables),
s if &s.to_lowercase() == "receivables" => Ok(ScanType::Receivables),
s => Err(format!("Unrecognized ScanType: '{}'", s)),
}
}
Expand Down Expand Up @@ -1225,10 +1225,10 @@ mod tests {
let result: Vec<ScanType> = vec![
"Payables",
"pAYABLES",
"Receivables",
"rECEIVABLES",
"PendingPayables",
"pENDINGpAYABLES",
"Receivables",
"rECEIVABLES",
]
.into_iter()
.map(|s| ScanType::from_str(s).unwrap())
Expand All @@ -1239,10 +1239,10 @@ mod tests {
vec![
ScanType::Payables,
ScanType::Payables,
ScanType::Receivables,
ScanType::Receivables,
ScanType::PendingPayables,
ScanType::PendingPayables,
ScanType::Receivables,
ScanType::Receivables,
]
)
}
Expand Down
2 changes: 1 addition & 1 deletion masq_lib/src/test_utils/mock_blockchain_client_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl MockBlockchainClientServer {
Err(e) if e.kind() == ErrorKind::TimedOut => (),
Err(e) => panic!("MBCS accept() failed: {:?}", e),
};
thread::sleep(Duration::from_millis(100));
thread::sleep(Duration::from_millis(50));
};
drop(listener);
conn.set_nonblocking(true).unwrap();
Expand Down
83 changes: 0 additions & 83 deletions masq_lib/src/type_obfuscation.rs

This file was deleted.

Loading
Loading