change 'registerAccountForDeletion' to 'execSelfDestruct'
This commit is contained in:
parent
d656f7f701
commit
9b1f8e2f65
|
@ -118,7 +118,7 @@ template selfDestruct*(c: Computation, address: EthAddress) =
|
||||||
when evmc_enabled:
|
when evmc_enabled:
|
||||||
c.host.selfDestruct(c.msg.contractAddress, address)
|
c.host.selfDestruct(c.msg.contractAddress, address)
|
||||||
else:
|
else:
|
||||||
c.registerAccountForDeletion(address)
|
c.execSelfDestruct(address)
|
||||||
|
|
||||||
template getCode*(c: Computation, address: EthAddress): ByteRange =
|
template getCode*(c: Computation, address: EthAddress): ByteRange =
|
||||||
when evmc_enabled:
|
when evmc_enabled:
|
||||||
|
@ -317,7 +317,7 @@ proc addChildComputation*(c, child: Computation) =
|
||||||
if not child.shouldBurnGas:
|
if not child.shouldBurnGas:
|
||||||
c.gasMeter.returnGas(child.gasMeter.gasRemaining)
|
c.gasMeter.returnGas(child.gasMeter.gasRemaining)
|
||||||
|
|
||||||
proc registerAccountForDeletion*(c: Computation, beneficiary: EthAddress) =
|
proc execSelfDestruct*(c: Computation, beneficiary: EthAddress) =
|
||||||
c.vmState.mutateStateDB:
|
c.vmState.mutateStateDB:
|
||||||
let
|
let
|
||||||
localBalance = c.getBalance(c.msg.contractAddress)
|
localBalance = c.getBalance(c.msg.contractAddress)
|
||||||
|
|
|
@ -118,7 +118,7 @@ proc hostCopyCodeImpl(ctx: Computation, address: var evmc_address,
|
||||||
|
|
||||||
proc hostSelfdestructImpl(ctx: Computation, address, beneficiary: var evmc_address) {.cdecl.} =
|
proc hostSelfdestructImpl(ctx: Computation, address, beneficiary: var evmc_address) {.cdecl.} =
|
||||||
assert fromEvmc(address) == ctx.msg.contractAddress
|
assert fromEvmc(address) == ctx.msg.contractAddress
|
||||||
ctx.registerAccountForDeletion(fromEvmc(beneficiary))
|
ctx.execSelfDestruct(fromEvmc(beneficiary))
|
||||||
|
|
||||||
proc hostEmitLogImpl(ctx: Computation, address: var evmc_address,
|
proc hostEmitLogImpl(ctx: Computation, address: var evmc_address,
|
||||||
data: ptr byte, dataSize: int,
|
data: ptr byte, dataSize: int,
|
||||||
|
|
Loading…
Reference in New Issue