diff --git a/crates/erc20_payment_lib/src/runtime.rs b/crates/erc20_payment_lib/src/runtime.rs index 9823b9a0..caa0bf91 100644 --- a/crates/erc20_payment_lib/src/runtime.rs +++ b/crates/erc20_payment_lib/src/runtime.rs @@ -1,4 +1,4 @@ -use crate::signer::{PaymentAccount, Signer}; +use crate::signer::{Signer, SignerAccount}; use crate::transaction::{ create_faucet_mint, create_free_allocation, create_free_allocation_internal, create_lock_deposit, create_lock_withdraw, create_make_allocation, @@ -60,7 +60,7 @@ pub struct SharedState { pub external_gather_time: Option>, #[serde(skip)] - pub accounts: Vec, + pub accounts: Vec, } impl SharedState { @@ -453,7 +453,7 @@ impl PaymentRuntime { let accounts = payment_runtime_args .secret_keys .iter() - .map(|s| PaymentAccount { + .map(|s| SignerAccount { address: get_eth_addr_from_secret(s), signer: signer.clone(), }) @@ -554,7 +554,7 @@ impl PaymentRuntime { }) } - pub async fn add_account(&self, payment_account: PaymentAccount) { + pub async fn add_account(&self, payment_account: SignerAccount) { log::info!("Adding account: {}", payment_account); let mut sh = self.shared_state.lock().unwrap(); diff --git a/crates/erc20_payment_lib/src/signer.rs b/crates/erc20_payment_lib/src/signer.rs index cdae3fa0..ddb21182 100644 --- a/crates/erc20_payment_lib/src/signer.rs +++ b/crates/erc20_payment_lib/src/signer.rs @@ -12,24 +12,24 @@ use tokio::time::timeout; use web3::types::{Address, SignedTransaction, TransactionParameters, H160}; #[derive(Clone)] -pub struct PaymentAccount { +pub struct SignerAccount { pub address: Address, pub signer: Arc>, } -impl Debug for PaymentAccount { +impl Debug for SignerAccount { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - write!(f, "PaymentAccount {{ address: {:#x} }}", self.address) + write!(f, "SignerAccount {{ address: {:#x} }}", self.address) } } -impl Display for PaymentAccount { +impl Display for SignerAccount { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!(f, "{:#x}", self.address) } } -impl PaymentAccount { +impl SignerAccount { pub fn new(address: H160, signer: Arc>) -> Self { Self { address, signer } }