Skip to content

Commit

Permalink
Change miner key name
Browse files Browse the repository at this point in the history
There shouldn't be two keys both called 'the miner key'
  • Loading branch information
jkilpatr committed Nov 29, 2023
1 parent 4728a66 commit 26c205d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions integration_tests/src/contract_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use web30::{client::Web3, types::SendTxOption};

use crate::{
payments_eth::WEB3_TIMEOUT,
utils::{deploy_contracts, get_eth_node, wait_for_txids, MINER_PRIVATE_KEY, TX_TIMEOUT},
utils::{deploy_contracts, get_eth_node, wait_for_txids, REGISTRATION_SERVER_KEY, TX_TIMEOUT},
};

pub async fn run_altheadb_contract_test() {
Expand All @@ -27,7 +27,7 @@ pub async fn run_altheadb_contract_test() {
}

pub async fn validate_contract_exit_functionality(db_addr: Address) {
let miner_private_key: PrivateKey = MINER_PRIVATE_KEY.parse().unwrap();
let miner_private_key: PrivateKey = REGISTRATION_SERVER_KEY.parse().unwrap();
let miner_pub_key = miner_private_key.to_address();

let contact = Web3::new(&get_eth_node(), WEB3_TIMEOUT);
Expand Down Expand Up @@ -163,7 +163,7 @@ pub async fn validate_contract_exit_functionality(db_addr: Address) {
}

pub async fn validate_contract_user_functionality(db_addr: Address) {
let miner_private_key: PrivateKey = MINER_PRIVATE_KEY.parse().unwrap();
let miner_private_key: PrivateKey = REGISTRATION_SERVER_KEY.parse().unwrap();
let miner_pub_key = miner_private_key.to_address();

let contact = Web3::new(&get_eth_node(), WEB3_TIMEOUT);
Expand Down
4 changes: 2 additions & 2 deletions integration_tests/src/db_migration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use web30::client::Web3;
use crate::{
payments_eth::{get_eth_miner_key, WEB3_TIMEOUT},
setup_utils::database::start_postgres,
utils::{deploy_contracts, get_eth_node, MINER_PRIVATE_KEY},
utils::{deploy_contracts, get_eth_node, REGISTRATION_SERVER_KEY},
};

pub const DB_URI: &str = "postgres://postgres@localhost/test";
Expand Down Expand Up @@ -52,7 +52,7 @@ pub async fn run_db_migration_test() {
check_and_add_user_admin(
&Web3::new(&get_eth_node(), WEB3_TIMEOUT),
althea_db_addr,
MINER_PRIVATE_KEY.parse().unwrap(),
REGISTRATION_SERVER_KEY.parse().unwrap(),
miner_private_key,
Some(WEB3_TIMEOUT),
vec![],
Expand Down
4 changes: 2 additions & 2 deletions integration_tests/src/registration_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ use crate::{
};
use crate::{
registration_server::register_client_batch_loop::register_client_batch_loop,
utils::MINER_PRIVATE_KEY,
utils::REGISTRATION_SERVER_KEY,
};

pub const REGISTRATION_PORT_SERVER: u16 = 40400;

pub async fn start_registration_server(db_addr: Address) {
let miner_private_key: PrivateKey = MINER_PRIVATE_KEY.parse().unwrap();
let miner_private_key: PrivateKey = REGISTRATION_SERVER_KEY.parse().unwrap();
let miner_pub_key = miner_private_key.to_address();
let contact = Web3::new(&get_eth_node(), WEB3_TIMEOUT);

Expand Down
6 changes: 3 additions & 3 deletions integration_tests/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub const MIN_GLOBAL_FEE_AMOUNT: u128 = 10;
pub const TOTAL_TIMEOUT: Duration = Duration::from_secs(300);
pub const DEBT_ACCURACY_THRES: u8 = 15;
pub const ETH_NODE: &str = "http://localhost:8545";
pub const MINER_PRIVATE_KEY: &str =
pub const REGISTRATION_SERVER_KEY: &str =
"0x34d97aaf58b1a81d3ed3068a870d8093c6341cf5d1ef7e6efa03fe7f7fc2c3a8";

lazy_static! {
Expand Down Expand Up @@ -170,7 +170,7 @@ pub async fn deploy_contracts() -> Address {
.args([
"ts-node",
"/althea_rs/solidity/contract-deployer.ts",
&format!("--eth-privkey={}", MINER_PRIVATE_KEY),
&format!("--eth-privkey={}", REGISTRATION_SERVER_KEY),
&format!("--eth-node={}", ETH_NODE),
])
.output()
Expand Down Expand Up @@ -1106,7 +1106,7 @@ pub async fn populate_routers_eth(rita_identities: InstanceData) {

pub async fn add_exits_contract_exit_list(db_addr: Address, rita_identities: InstanceData) {
let web3 = Web3::new("http://localhost:8545", WEB3_TIMEOUT);
let miner_private_key: clarity::PrivateKey = MINER_PRIVATE_KEY.parse().unwrap();
let miner_private_key: clarity::PrivateKey = REGISTRATION_SERVER_KEY.parse().unwrap();
let miner_pub_key = miner_private_key.to_address();

add_exit_admin(
Expand Down

0 comments on commit 26c205d

Please sign in to comment.