diff --git a/bridge/src/bridge/deploy.rs b/bridge/src/bridge/deploy.rs index 6db94f3..c7a91e0 100644 --- a/bridge/src/bridge/deploy.rs +++ b/bridge/src/bridge/deploy.rs @@ -100,21 +100,13 @@ impl Future for Deploy { data: test_data.into(), }; - let main_future = api::send_transaction_with_nonce( - self.app.connections.home.clone(), self.app.connections.home_url.clone(), - self.app.clone(), self.app.config.home.clone(), main_tx, self.home_chain_id, - TransactionWithConfirmation(self.app.connections.home.clone(), - self.app.config.home.poll_interval, - self.app.config.home.required_confirmations) - ); + let main_future = api::send_transaction_with_nonce(self.app.connections.home.clone(), self.app.clone(), + self.app.config.home.clone(), main_tx, self.home_chain_id, + TransactionWithConfirmation(self.app.connections.home.clone(), self.app.config.home.poll_interval, self.app.config.home.required_confirmations)); - let test_future = api::send_transaction_with_nonce( - self.app.connections.foreign.clone(), self.app.connections.foreign_url.clone(), - self.app.clone(), self.app.config.foreign.clone(), test_tx, self.foreign_chain_id, - TransactionWithConfirmation(self.app.connections.foreign.clone(), - self.app.config.foreign.poll_interval, - self.app.config.foreign.required_confirmations) - ); + let test_future = api::send_transaction_with_nonce(self.app.connections.foreign.clone(), self.app.clone(), + self.app.config.foreign.clone(), test_tx, self.foreign_chain_id, + TransactionWithConfirmation(self.app.connections.foreign.clone(), self.app.config.foreign.poll_interval, self.app.config.foreign.required_confirmations)); DeployState::Deploying(main_future.join(test_future)) } diff --git a/bridge/src/bridge/deposit_relay.rs b/bridge/src/bridge/deposit_relay.rs index 5cd84aa..dd78966 100644 --- a/bridge/src/bridge/deposit_relay.rs +++ b/bridge/src/bridge/deposit_relay.rs @@ -92,7 +92,7 @@ impl Stream for DepositRelay { let gas = U256::from(self.app.config.txs.deposit_relay.gas); let gas_price = U256::from(*self.foreign_gas_price.read().unwrap()); let balance_required = gas * gas_price * U256::from(item.logs.len()); - + if balance_required > *foreign_balance.as_ref().unwrap() { return Err(ErrorKind::InsufficientFunds.into()) } @@ -110,10 +110,8 @@ impl Stream for DepositRelay { nonce: U256::zero(), action: Action::Call(self.foreign_contract.clone()), }; - api::send_transaction_with_nonce(self.app.connections.foreign.clone(), - self.app.connections.foreign_url.clone(), self.app.clone(), - self.app.config.foreign.clone(), tx, self.foreign_chain_id, - SendRawTransaction(self.app.connections.foreign.clone())) + api::send_transaction_with_nonce(self.app.connections.foreign.clone(), self.app.clone(), self.app.config.foreign.clone(), + tx, self.foreign_chain_id, SendRawTransaction(self.app.connections.foreign.clone())) }).collect_vec(); info!("relaying {} deposits", len); diff --git a/bridge/src/bridge/withdraw_confirm.rs b/bridge/src/bridge/withdraw_confirm.rs index a9bbefa..a287a55 100644 --- a/bridge/src/bridge/withdraw_confirm.rs +++ b/bridge/src/bridge/withdraw_confirm.rs @@ -134,10 +134,8 @@ impl Stream for WithdrawConfirm { nonce: U256::zero(), action: Action::Call(contract), }; - api::send_transaction_with_nonce(self.app.connections.foreign.clone(), - self.app.connections.foreign_url.clone(), self.app.clone(), - self.app.config.foreign.clone(), tx, self.foreign_chain_id, - SendRawTransaction(self.app.connections.foreign.clone())) + api::send_transaction_with_nonce(self.app.connections.foreign.clone(), self.app.clone(), self.app.config.foreign.clone(), + tx, self.foreign_chain_id, SendRawTransaction(self.app.connections.foreign.clone())) }).collect_vec(); info!("submitting {} signatures", len); diff --git a/bridge/src/bridge/withdraw_relay.rs b/bridge/src/bridge/withdraw_relay.rs index e9aa2c5..e79819b 100644 --- a/bridge/src/bridge/withdraw_relay.rs +++ b/bridge/src/bridge/withdraw_relay.rs @@ -120,7 +120,6 @@ impl Stream for WithdrawRelay { let contract = self.home_contract.clone(); let home = &self.app.config.home; let t = &self.app.connections.home; - let t_url = &self.app.connections.home_url; let chain_id = self.home_chain_id; loop { @@ -233,8 +232,7 @@ impl Stream for WithdrawRelay { nonce: U256::zero(), action: Action::Call(contract), }; - api::send_transaction_with_nonce(t.clone(), t_url.clone(), app.clone(), - home.clone(), tx, chain_id, SendRawTransaction(t.clone())) + api::send_transaction_with_nonce(t.clone(), app.clone(), home.clone(), tx, chain_id, SendRawTransaction(t.clone())) }).collect_vec(); info!("relaying {} withdraws", len);