diff options
author | Zachary Michaels <mikezackles@gmail.com> | 2014-09-04 22:14:36 -0400 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2014-09-15 15:53:10 +0200 |
commit | fb4146fa343399229c754331ecc78fe0c759ec7c (patch) | |
tree | 18dbbb427c846d83590bcf4f959d759dd81b7e5e /tests/unit_tests | |
parent | Add testnet constants (diff) | |
download | monero-fb4146fa343399229c754331ecc78fe0c759ec7c.tar.xz |
Reorganize testnet constants
Diffstat (limited to 'tests/unit_tests')
-rw-r--r-- | tests/unit_tests/base58.cpp | 6 | ||||
-rw-r--r-- | tests/unit_tests/test_format_utils.cpp | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/tests/unit_tests/base58.cpp b/tests/unit_tests/base58.cpp index 5b82fb987..f61bb1b96 100644 --- a/tests/unit_tests/base58.cpp +++ b/tests/unit_tests/base58.cpp @@ -506,7 +506,7 @@ TEST(get_account_address_from_str, fails_on_invalid_address_prefix) TEST(get_account_address_from_str, fails_on_invalid_address_content) { - std::string addr_str = base58::encode_addr(CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX, test_serialized_keys.substr(1)); + std::string addr_str = base58::encode_addr(config::CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX, test_serialized_keys.substr(1)); cryptonote::account_public_address addr; ASSERT_FALSE(cryptonote::get_account_address_from_str(addr, addr_str)); @@ -516,7 +516,7 @@ TEST(get_account_address_from_str, fails_on_invalid_address_spend_key) { std::string serialized_keys_copy = test_serialized_keys; serialized_keys_copy[0] = '\0'; - std::string addr_str = base58::encode_addr(CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX, serialized_keys_copy); + std::string addr_str = base58::encode_addr(config::CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX, serialized_keys_copy); cryptonote::account_public_address addr; ASSERT_FALSE(cryptonote::get_account_address_from_str(addr, addr_str)); @@ -526,7 +526,7 @@ TEST(get_account_address_from_str, fails_on_invalid_address_view_key) { std::string serialized_keys_copy = test_serialized_keys; serialized_keys_copy.back() = '\x01'; - std::string addr_str = base58::encode_addr(CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX, serialized_keys_copy); + std::string addr_str = base58::encode_addr(config::CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX, serialized_keys_copy); cryptonote::account_public_address addr; ASSERT_FALSE(cryptonote::get_account_address_from_str(addr, addr_str)); diff --git a/tests/unit_tests/test_format_utils.cpp b/tests/unit_tests/test_format_utils.cpp index bed19c315..857b5b09f 100644 --- a/tests/unit_tests/test_format_utils.cpp +++ b/tests/unit_tests/test_format_utils.cpp @@ -35,6 +35,10 @@ #include "common/util.h" #include "cryptonote_core/cryptonote_format_utils.h" +namespace +{ + uint64_t const TEST_FEE = 5000000000; // 5 * 10^9 +} TEST(parse_tx_extra, handles_empty_extra) { @@ -135,7 +139,7 @@ TEST(parse_and_validate_tx_extra, is_valid_tx_extra_parsed) cryptonote::account_base acc; acc.generate(); cryptonote::blobdata b = "dsdsdfsdfsf"; - ASSERT_TRUE(cryptonote::construct_miner_tx(0, 0, 10000000000000, 1000, DEFAULT_FEE, acc.get_keys().m_account_address, tx, b, 1)); + ASSERT_TRUE(cryptonote::construct_miner_tx(0, 0, 10000000000000, 1000, TEST_FEE, acc.get_keys().m_account_address, tx, b, 1)); crypto::public_key tx_pub_key = cryptonote::get_tx_pub_key_from_extra(tx); ASSERT_NE(tx_pub_key, cryptonote::null_pkey); } @@ -145,7 +149,7 @@ TEST(parse_and_validate_tx_extra, fails_on_big_extra_nonce) cryptonote::account_base acc; acc.generate(); cryptonote::blobdata b(TX_EXTRA_NONCE_MAX_COUNT + 1, 0); - ASSERT_FALSE(cryptonote::construct_miner_tx(0, 0, 10000000000000, 1000, DEFAULT_FEE, acc.get_keys().m_account_address, tx, b, 1)); + ASSERT_FALSE(cryptonote::construct_miner_tx(0, 0, 10000000000000, 1000, TEST_FEE, acc.get_keys().m_account_address, tx, b, 1)); } TEST(parse_and_validate_tx_extra, fails_on_wrong_size_in_extra_nonce) { |