change 'registerAccountForDeletion' to 'execSelfDestruct'

This commit is contained in:
andri lim 2020-01-22 11:48:02 +07:00 committed by zah
parent d656f7f701
commit 9b1f8e2f65
2 changed files with 3 additions and 3 deletions

View File

@ -118,7 +118,7 @@ template selfDestruct*(c: Computation, address: EthAddress) =
when evmc_enabled:
c.host.selfDestruct(c.msg.contractAddress, address)
else:
c.registerAccountForDeletion(address)
c.execSelfDestruct(address)
template getCode*(c: Computation, address: EthAddress): ByteRange =
when evmc_enabled:
@ -317,7 +317,7 @@ proc addChildComputation*(c, child: Computation) =
if not child.shouldBurnGas:
c.gasMeter.returnGas(child.gasMeter.gasRemaining)
proc registerAccountForDeletion*(c: Computation, beneficiary: EthAddress) =
proc execSelfDestruct*(c: Computation, beneficiary: EthAddress) =
c.vmState.mutateStateDB:
let
localBalance = c.getBalance(c.msg.contractAddress)

View File

@ -118,7 +118,7 @@ proc hostCopyCodeImpl(ctx: Computation, address: var evmc_address,
proc hostSelfdestructImpl(ctx: Computation, address, beneficiary: var evmc_address) {.cdecl.} =
assert fromEvmc(address) == ctx.msg.contractAddress
ctx.registerAccountForDeletion(fromEvmc(beneficiary))
ctx.execSelfDestruct(fromEvmc(beneficiary))
proc hostEmitLogImpl(ctx: Computation, address: var evmc_address,
data: ptr byte, dataSize: int,