From d90c7e1d1286f30ff1bb02db00bc44497bf628df Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Wed, 4 Oct 2023 11:30:25 -0600 Subject: [PATCH] adjust mocks Signed-off-by: Danno Ferrin --- .../hyperledger/besu/evm/operation/SelfDestructOperation.java | 4 ++-- .../besu/evm/operations/SelfDestructOperationTest.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/SelfDestructOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/SelfDestructOperation.java index 453dff9ce50..4a0e6638dcf 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/SelfDestructOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/SelfDestructOperation.java @@ -60,8 +60,8 @@ public OperationResult execute(final MessageFrame frame, final EVM evm) { final boolean beneficiaryIsWarm = frame.warmUpAddress(beneficiaryAddress) || gasCalculator().isPrecompile(beneficiaryAddress); - final Address originatorAddress = frame.getRecipientAddress(); - final MutableAccount originatorAccount = frame.getWorldUpdater().getAccount(originatorAddress); + final Address originatorAddresss = frame.getRecipientAddress(); + final MutableAccount originatorAccount = frame.getWorldUpdater().getAccount(originatorAddresss); final Wei originatorBalance = originatorAccount.getBalance(); final long cost = diff --git a/evm/src/test/java/org/hyperledger/besu/evm/operations/SelfDestructOperationTest.java b/evm/src/test/java/org/hyperledger/besu/evm/operations/SelfDestructOperationTest.java index 6c178dda2a9..913ffd92bc9 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/operations/SelfDestructOperationTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/operations/SelfDestructOperationTest.java @@ -96,11 +96,11 @@ void checkContractDeletionCommon( } when(worldUpdater.getAccount(originatorAddress)).thenReturn(accountOriginator); - when(worldUpdater.get(originatorAddress)).thenReturn(accountOriginator); if (!originatorAddress.equals(beneficiaryAddress)) { when(worldUpdater.get(beneficiaryAddress)).thenReturn(accountBeneficiary); } when(worldUpdater.getOrCreate(beneficiaryAddress)).thenReturn(accountBeneficiary); + when(accountOriginator.getAddress()).thenReturn(originatorAddress); when(accountOriginator.getBalance()).thenReturn(Wei.fromHexString(balanceHex)); final Operation.OperationResult operationResult = operation.execute(messageFrame, evm);