From 5f8f09855a635597eeaf301ebc0e7ef0a686bc30 Mon Sep 17 00:00:00 2001 From: Supun Setunga Date: Mon, 23 Oct 2023 15:47:40 -0700 Subject: [PATCH] Refactor code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bastian Müller --- runtime/stdlib/account.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/runtime/stdlib/account.go b/runtime/stdlib/account.go index 63cf8fdcdf..45b0a17d2a 100644 --- a/runtime/stdlib/account.go +++ b/runtime/stdlib/account.go @@ -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 } @@ -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,