Skip to content

Commit

Permalink
Allow bumping other instances
Browse files Browse the repository at this point in the history
  • Loading branch information
sisuresh committed Nov 13, 2023
1 parent 23c219b commit c545bb7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions soroban-sdk/src/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,19 @@ impl Deployer {
.update_current_contract_wasm(wasm_hash.into_val(&self.env).to_object())
.unwrap_infallible();
}

/// If the TTL for the provided contract is below `threshold` ledgers,
/// extend the TTL such that TTL == `extend_to`, where TTL is defined as
/// (live_until_ledger_seq for the entry - current ledger).
pub fn extend_ttl(&self, contract_address: Address, threshold: u32, extend_to: u32) {
self.env
.extend_contract_instance_and_code(
contract_address.to_object(),
threshold.into(),
extend_to.into(),
)
.unwrap_infallible();
}
}

/// A deployer that deploys a contract that has its ID derived from the provided
Expand Down

0 comments on commit c545bb7

Please sign in to comment.