Skip to content

Commit

Permalink
Revent some formatting-only changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
c0gent committed Jul 2, 2018
1 parent 9cc6814 commit d2ebbc5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 26 deletions.
20 changes: 6 additions & 14 deletions bridge/src/bridge/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,13 @@ impl<T: Transport + Clone> Future for Deploy<T> {
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))
}
Expand Down
8 changes: 3 additions & 5 deletions bridge/src/bridge/deposit_relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl<T: Transport> Stream for DepositRelay<T> {
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())
}
Expand All @@ -110,10 +110,8 @@ impl<T: Transport> Stream for DepositRelay<T> {
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);
Expand Down
6 changes: 2 additions & 4 deletions bridge/src/bridge/withdraw_confirm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,8 @@ impl<T: Transport> Stream for WithdrawConfirm<T> {
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);
Expand Down
4 changes: 1 addition & 3 deletions bridge/src/bridge/withdraw_relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ impl<T: Transport> Stream for WithdrawRelay<T> {
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 {
Expand Down Expand Up @@ -233,8 +232,7 @@ impl<T: Transport> Stream for WithdrawRelay<T> {
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);
Expand Down

0 comments on commit d2ebbc5

Please sign in to comment.