Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing system-level tests
Browse files Browse the repository at this point in the history
hansieodendaal committed Nov 24, 2023
1 parent 3e0880d commit 0de8fef
Showing 9 changed files with 1,710 additions and 1,667 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

18 changes: 10 additions & 8 deletions applications/minotari_node/src/config.rs
Original file line number Diff line number Diff line change
@@ -273,14 +273,16 @@ mod tests {

#[test]
fn it_deserializes_enums() {
let config_str = r#"name = "blockchain champion"
inner_config.deny_methods = [
"list_headers",
"get_constants",
# "get_blocks"
"identify",
# "get_shard_key"
]"#;
let config_str = r#"
name = "blockchain champion"
inner_config.deny_methods = [
"list_headers",
"get_constants",
# "get_blocks"
"identify",
# "get_shard_key"
]
"#;
let config = toml::from_str::<TestConfig>(config_str).unwrap();

// Enums in the config
1 change: 1 addition & 0 deletions base_layer/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -86,6 +86,7 @@ libsqlite3-sys = { version = "0.25.1", features = ["bundled"] }
config = { version = "0.13.0" }
env_logger = "0.7.0"
tempfile = "3.1.0"
toml = { version = "0.5" }

[build-dependencies]
tari_common = { path = "../../common", features = ["build"] }
910 changes: 455 additions & 455 deletions base_layer/core/src/blocks/faucets/esmeralda_faucet.json

Large diffs are not rendered by default.

2,400 changes: 1,200 additions & 1,200 deletions base_layer/core/src/blocks/faucets/igor_faucet.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@ use serde::{Deserialize, Serialize};
Debug, Clone, Copy, Hash, PartialEq, Deserialize, Serialize, Eq, BorshSerialize, FromPrimitive, BorshDeserialize,
)]
#[repr(u8)]
#[serde(rename_all = "snake_case")]
pub enum RangeProofType {
/// Range proof is a BulletProofPlus
BulletProofPlus = 0,
@@ -91,4 +92,29 @@ mod tests {
assert_eq!(RangeProofType::BulletProofPlus.to_string(), "BulletProofPlus");
assert_eq!(RangeProofType::RevealedValue.to_string(), "RevealedValue");
}

#[derive(Clone, Serialize, Deserialize, Debug)]
#[allow(clippy::struct_excessive_bools)]
struct TestConfig {
name: String,
range_proof_type: RangeProofType,
}

#[test]
fn it_deserializes_enums() {
let config_str_1 = r#"
name = "blockchain champion"
range_proof_type = "revealed_value"
"#;
let config_1 = toml::from_str::<TestConfig>(config_str_1).unwrap();
let config_str_2 = r#"
name = "blockchain champion"
range_proof_type = "bullet_proof_plus"
"#;
let config_2 = toml::from_str::<TestConfig>(config_str_2).unwrap();

// Enums in the config
assert_eq!(config_1.range_proof_type, RangeProofType::RevealedValue);
assert_eq!(config_2.range_proof_type, RangeProofType::BulletProofPlus);
}
}
3 changes: 3 additions & 0 deletions common/config/presets/c_base_node.toml
Original file line number Diff line number Diff line change
@@ -33,6 +33,9 @@ identity_file = "config/base_node_id_nextnet.json"
# Set to false to disable the base node GRPC server (default = true)
#grpc_enabled = true

# The socket to expose for the gRPC base node server (default = "/ip4/127.0.0.1/tcp/18142")
#grpc_address = "/ip4/127.0.0.1/tcp/18142"

# gRPC authentication method (default = "none")
#grpc_authentication = { username = "admin", password = "xxxx" }

9 changes: 7 additions & 2 deletions common/config/presets/f_merge_mining_proxy.toml
Original file line number Diff line number Diff line change
@@ -64,10 +64,15 @@ monerod_url = [# stagenet
# The maximum amount of VMs that RandomX will be use (default = 5)
#max_randomx_vms = 5

# The extra data to store in the coinbase, usually some data about the mining pool.
# Note that this data is publicly readable, but it is suggested you populate it so that
# pool dominance can be seen before any one party has more than 51%. (default = "tari_merge_mining_proxy")
#coinbase_extra = "tari_merge_mining_proxy"

# The Tari wallet address (valid address in hex) where the mining funds will be sent to - must be assigned
# e.g. "78e724f466d202abdee0f23c261289074e4a2fc9eb61e83e0179eead76ce2d3f17"
#wallet_payment_address = "YOUR_WALLET_TARI_ADDRESS"
# Stealth payment yes or no (default: true)
#stealth_payment = true
# Range proof type - revealed_value or bullet_proof_plus: (default = bullet_proof_plus)
#pub range_proof_type = bullet_proof_plus
# Range proof type - revealed_value or bullet_proof_plus: (default = "bullet_proof_plus")
#range_proof_type = "bullet_proof_plus"
9 changes: 7 additions & 2 deletions common/config/presets/g_miner.toml
Original file line number Diff line number Diff line change
@@ -40,10 +40,15 @@
# Base node reconnect timeout after any GRPC or miner error (default: 10 s)
#wait_timeout_on_error = 10

# The extra data to store in the coinbase, usually some data about the mining pool.
# Note that this data is publicly readable, but it is suggested you populate it so that
# pool dominance can be seen before any one party has more than 51%. (default = "minotari_miner")
#coinbase_extra = "minotari_miner"

# The Tari wallet address (valid address in hex) where the mining funds will be sent to - must be assigned
# e.g. "78e724f466d202abdee0f23c261289074e4a2fc9eb61e83e0179eead76ce2d3f17"
#wallet_payment_address = "YOUR_WALLET_TARI_ADDRESS"
# Stealth payment yes or no (default: true)
#stealth_payment = true
# Range proof type - revealed_value or bullet_proof_plus: (default = bullet_proof_plus)
#pub range_proof_type = bullet_proof_plus
# Range proof type - revealed_value or bullet_proof_plus: (default = "bullet_proof_plus")
#range_proof_type = "bullet_proof_plus"

0 comments on commit 0de8fef

Please sign in to comment.