Skip to content

Commit

Permalink
Small improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
DOBEN committed Oct 18, 2023
1 parent 9e43b26 commit 870502c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions templates/default/deploy-scripts/src/deployer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ impl Deployer {
anyhow::bail!("Nonce not final")
}

let expiry = expiry.unwrap_or(TransactionTime::from_seconds(
(chrono::Utc::now().timestamp() + 300) as u64,
));
let expiry = expiry.unwrap_or_else(|| {
TransactionTime::from_seconds((chrono::Utc::now().timestamp() + 300) as u64)
});

let tx = deploy_module(
&*self.key,
Expand Down Expand Up @@ -188,9 +188,9 @@ impl Deployer {

let energy = energy.unwrap_or(Energy { energy: 5000 });

let expiry = expiry.unwrap_or(TransactionTime::from_seconds(
(chrono::Utc::now().timestamp() + 300) as u64,
));
let expiry = expiry.unwrap_or_else(|| {
TransactionTime::from_seconds((chrono::Utc::now().timestamp() + 300) as u64)
});

let tx = init_contract(
&*self.key,
Expand Down Expand Up @@ -251,9 +251,9 @@ impl Deployer {
payload: update_payload,
};

let expiry = expiry.unwrap_or(TransactionTime::from_seconds(
(chrono::Utc::now().timestamp() + 300) as u64,
));
let expiry = expiry.unwrap_or_else(|| {
TransactionTime::from_seconds((chrono::Utc::now().timestamp() + 300) as u64)
});

let energy = energy.unwrap_or(GivenEnergy::Absolute(Energy { energy: 50000 }));

Expand Down

0 comments on commit 870502c

Please sign in to comment.