Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
Co-authored-by: Bastian Müller <[email protected]>
  • Loading branch information
SupunS and turbolent committed Oct 26, 2023
1 parent b0d4489 commit 5f8f098
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions runtime/stdlib/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -1447,13 +1447,13 @@ type AccountContractAdditionHandler interface {
)
TemporarilyRecordCode(location common.AddressLocation, code []byte)

// StartContractAddition start adding a contract.
// StartContractAddition starts adding a contract.
StartContractAddition(location common.AddressLocation)

// EndContractAddition end adding the contract
// EndContractAddition ends adding the contract
EndContractAddition(location common.AddressLocation)

// IsContractBeingAdded check whether a contract is being added in the current execution.
// IsContractBeingAdded checks whether a contract is being added in the current execution.
IsContractBeingAdded(location common.AddressLocation) bool
}

Expand Down Expand Up @@ -1533,6 +1533,7 @@ func newAuthAccountContractsChangeFunction(
if len(existingCode) > 0 ||
handler.ContractUpdateRecorded(location) ||
handler.IsContractBeingAdded(location) {

panic(errors.NewDefaultUserError(
"cannot overwrite existing contract with name %q in account %s",
contractName,
Expand Down

0 comments on commit 5f8f098

Please sign in to comment.