Skip to content

Commit

Permalink
fixing used constant
Browse files Browse the repository at this point in the history
  • Loading branch information
sasurobert committed Apr 24, 2024
1 parent bfe3bf2 commit a970819
Showing 1 changed file with 35 additions and 34 deletions.
69 changes: 35 additions & 34 deletions vmhost/vmhooks/managedei.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,39 @@ import (
)

const (
managedSCAddressName = "managedSCAddress"
managedOwnerAddressName = "managedOwnerAddress"
managedCallerName = "managedCaller"
managedSignalErrorName = "managedSignalError"
managedWriteLogName = "managedWriteLog"
managedMultiTransferESDTNFTExecuteName = "managedMultiTransferESDTNFTExecute"
managedTransferValueExecuteName = "managedTransferValueExecute"
managedExecuteOnDestContextName = "managedExecuteOnDestContext"
managedExecuteOnDestContextByCallerName = "managedExecuteOnDestContextByCaller"
managedExecuteOnSameContextName = "managedExecuteOnSameContext"
managedExecuteReadOnlyName = "managedExecuteReadOnly"
managedCreateContractName = "managedCreateContract"
managedDeployFromSourceContractName = "managedDeployFromSourceContract"
managedUpgradeContractName = "managedUpgradeContract"
managedUpgradeFromSourceContractName = "managedUpgradeFromSourceContract"
managedAsyncCallName = "managedAsyncCall"
managedCreateAsyncCallName = "managedCreateAsyncCall"
managedGetCallbackClosure = "managedGetCallbackClosure"
managedGetMultiESDTCallValueName = "managedGetMultiESDTCallValue"
managedGetESDTBalanceName = "managedGetESDTBalance"
managedGetESDTTokenDataName = "managedGetESDTTokenData"
managedGetReturnDataName = "managedGetReturnData"
managedGetPrevBlockRandomSeedName = "managedGetPrevBlockRandomSeed"
managedGetBlockRandomSeedName = "managedGetBlockRandomSeed"
managedGetStateRootHashName = "managedGetStateRootHash"
managedGetOriginalTxHashName = "managedGetOriginalTxHash"
managedIsESDTFrozenName = "managedIsESDTFrozen"
managedIsESDTLimitedTransferName = "managedIsESDTLimitedTransfer"
managedIsESDTPausedName = "managedIsESDTPaused"
managedBufferToHexName = "managedBufferToHex"
managedGetCodeMetadataName = "managedGetCodeMetadata"
managedIsBuiltinFunction = "managedIsBuiltinFunction"
managedSCAddressName = "managedSCAddress"
managedOwnerAddressName = "managedOwnerAddress"
managedCallerName = "managedCaller"
managedSignalErrorName = "managedSignalError"
managedWriteLogName = "managedWriteLog"
managedMultiTransferESDTNFTExecuteName = "managedMultiTransferESDTNFTExecute"
managedTransferValueExecuteName = "managedTransferValueExecute"
managedExecuteOnDestContextName = "managedExecuteOnDestContext"
managedExecuteOnDestContextByCallerName = "managedExecuteOnDestContextByCaller"
managedExecuteOnSameContextName = "managedExecuteOnSameContext"
managedExecuteReadOnlyName = "managedExecuteReadOnly"
managedCreateContractName = "managedCreateContract"
managedDeployFromSourceContractName = "managedDeployFromSourceContract"
managedUpgradeContractName = "managedUpgradeContract"
managedUpgradeFromSourceContractName = "managedUpgradeFromSourceContract"
managedAsyncCallName = "managedAsyncCall"
managedCreateAsyncCallName = "managedCreateAsyncCall"
managedGetCallbackClosure = "managedGetCallbackClosure"
managedGetMultiESDTCallValueName = "managedGetMultiESDTCallValue"
managedGetESDTBalanceName = "managedGetESDTBalance"
managedGetESDTTokenDataName = "managedGetESDTTokenData"
managedGetReturnDataName = "managedGetReturnData"
managedGetPrevBlockRandomSeedName = "managedGetPrevBlockRandomSeed"
managedGetBlockRandomSeedName = "managedGetBlockRandomSeed"
managedGetStateRootHashName = "managedGetStateRootHash"
managedGetOriginalTxHashName = "managedGetOriginalTxHash"
managedIsESDTFrozenName = "managedIsESDTFrozen"
managedIsESDTLimitedTransferName = "managedIsESDTLimitedTransfer"
managedIsESDTPausedName = "managedIsESDTPaused"
managedBufferToHexName = "managedBufferToHex"
managedGetCodeMetadataName = "managedGetCodeMetadata"
managedIsBuiltinFunction = "managedIsBuiltinFunction"
managedMultiTransferESDTNFTExecuteByUser = "managedMultiTransferESDTNFTExecuteByUser"
)

// ManagedSCAddress VMHooks implementation.
Expand Down Expand Up @@ -945,9 +946,9 @@ func (context *VMHooksImpl) ManagedMultiTransferESDTNFTExecuteByUser(
managedType := host.ManagedTypes()
runtime := host.Runtime()
metering := host.Metering()
metering.StartGasTracing(managedMultiTransferESDTNFTExecuteName)
metering.StartGasTracing(managedMultiTransferESDTNFTExecuteByUser)

if !host.IsAllowedToExecute(managedMultiTransferESDTNFTExecuteName) {
if !host.IsAllowedToExecute(managedMultiTransferESDTNFTExecuteByUser) {
_ = WithFaultAndHost(host, vmhost.ErrOpcodeIsNotAllowed, runtime.BaseOpsErrorShouldFailExecution())
return -1
}
Expand Down

0 comments on commit a970819

Please sign in to comment.