Skip to content

Commit

Permalink
Apply cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
rockbmb committed Sep 12, 2019
1 parent 5c45bcd commit 2204f5d
Showing 1 changed file with 9 additions and 28 deletions.
37 changes: 9 additions & 28 deletions src/contract/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,7 @@ impl<T: Transport> Builder<T> {
}

/// Execute deployment passing code and contructor parameters.
pub fn execute<P, V>(
self,
code: V,
params: P,
from: Address,
) -> Result<PendingContract<T>, ethabi::Error>
pub fn execute<P, V>(self, code: V, params: P, from: Address) -> Result<PendingContract<T>, ethabi::Error>
where
P: Tokenize,
V: AsRef<str>,
Expand All @@ -59,17 +54,9 @@ impl<T: Transport> Builder<T> {
let poll_interval = self.poll_interval;
let confirmations = self.confirmations;

self.do_execute(
code,
params,
from,
move |tx| confirm::send_transaction_with_confirmation(
transport,
tx,
poll_interval,
confirmations
)
)
self.do_execute(code, params, from, move |tx| {
confirm::send_transaction_with_confirmation(transport, tx, poll_interval, confirmations)
})
}
/// Execute deployment passing code and contructor parameters.
///
Expand All @@ -83,10 +70,7 @@ impl<T: Transport> Builder<T> {
params: P,
from: Address,
password: &str,
) -> Result<
PendingContract<T, impl Future<Item = TransactionReceipt, Error = crate::error::Error>>,
ethabi::Error,
>
) -> Result<PendingContract<T, impl Future<Item = TransactionReceipt, Error = crate::error::Error>>, ethabi::Error>
where
P: Tokenize,
V: AsRef<str>,
Expand All @@ -95,21 +79,18 @@ impl<T: Transport> Builder<T> {
let poll_interval = self.poll_interval;
let confirmations = self.confirmations;

self.do_execute(
code,
params,
from,
move |tx| crate::api::Personal::new(transport.clone())
self.do_execute(code, params, from, move |tx| {
crate::api::Personal::new(transport.clone())
.sign_transaction(tx, password)
.and_then(move |signed_tx| {
confirm::send_raw_transaction_with_confirmation(
transport,
signed_tx.raw,
poll_interval,
confirmations
confirmations,
)
})
)
})
}

fn do_execute<P, V, Ft>(
Expand Down

0 comments on commit 2204f5d

Please sign in to comment.