Skip to content

Commit

Permalink
Allow re-registering over a contract (#780)
Browse files Browse the repository at this point in the history
Co-authored-by: Graydon Hoare <[email protected]>
  • Loading branch information
leighmcculloch and graydon authored Apr 28, 2023
1 parent 1599a5a commit 87a7f6e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions soroban-env-host/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1209,12 +1209,8 @@ impl Host {
) -> Result<(), HostError> {
let hash = self.hash_from_bytesobj_input("contract_id", contract_id)?;
let mut contracts = self.0.contracts.borrow_mut();
if !contracts.contains_key(&hash) {
contracts.insert(hash, contract_fns);
Ok(())
} else {
Err(self.err_general("vtable already exists"))
}
contracts.insert(hash, contract_fns);
Ok(())
}

// Writes an arbitrary ledger entry to storage.
Expand Down

0 comments on commit 87a7f6e

Please sign in to comment.