From 9b1f8e2f65727a3d7292e6d4e39e45363dfc2f8e Mon Sep 17 00:00:00 2001 From: andri lim Date: Wed, 22 Jan 2020 11:48:02 +0700 Subject: [PATCH] change 'registerAccountForDeletion' to 'execSelfDestruct' --- nimbus/vm/computation.nim | 4 ++-- nimbus/vm/evmc_host.nim | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nimbus/vm/computation.nim b/nimbus/vm/computation.nim index 41bf5ffce..fb74a5bcf 100644 --- a/nimbus/vm/computation.nim +++ b/nimbus/vm/computation.nim @@ -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) diff --git a/nimbus/vm/evmc_host.nim b/nimbus/vm/evmc_host.nim index 335150a4e..cfdd47279 100644 --- a/nimbus/vm/evmc_host.nim +++ b/nimbus/vm/evmc_host.nim @@ -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,