Skip to content

Commit

Permalink
Noop in instance bump for tests (#1034)
Browse files Browse the repository at this point in the history
The tests will error out if contracts were registered with
`register_contract` instead of `register_contract_wasm` because we don't
write an instance in that scenario.
  • Loading branch information
sisuresh authored Jul 11, 2023
1 parent e45ec82 commit cd43fb4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions soroban-sdk/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,14 @@ impl Instance {
self.storage.remove(key, StorageType::Instance)
}

pub fn bump(&self, min_ledgers_to_live: u32) {
pub fn bump(&self, _min_ledgers_to_live: u32) {
// This is required because register_contract
// doesn't create an instance. This guard can be
// removed once that is fixed.
#[cfg(not(any(test, feature = "testutils")))]
internal::Env::bump_current_contract_instance_and_code(
&self.storage.env,
min_ledgers_to_live.into(),
_min_ledgers_to_live.into(),
)
.unwrap_infallible();
}
Expand Down

0 comments on commit cd43fb4

Please sign in to comment.