Skip to content

Commit

Permalink
fix: Addressing review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Kristiyan Selveliev <[email protected]>
  • Loading branch information
kselveliev committed Feb 6, 2025
1 parent 2b71dd1 commit da0f38b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.hedera.mirror.web3.evm.config.PrecompiledContractProvider;
import com.hedera.mirror.web3.evm.properties.MirrorNodeEvmProperties;
import com.hedera.mirror.web3.state.core.MapWritableStates;
import com.hedera.node.app.service.contract.ContractService;
import com.hedera.node.app.service.evm.contracts.operations.HederaExceptionalHaltReason;
import com.hedera.node.app.service.mono.contracts.execution.traceability.HederaOperationTracer;
import com.hedera.services.stream.proto.ContractActionType;
Expand Down Expand Up @@ -66,7 +67,6 @@
@Getter
public class OpcodeTracer implements HederaOperationTracer {

private static final String CONTRACT_SERVICE = "ContractService";
private static final String STORAGE_KEY = "STORAGE";
private final Map<Address, PrecompiledContract> hederaPrecompiles;
private final MirrorNodeEvmProperties evmProperties;
Expand Down Expand Up @@ -272,7 +272,7 @@ private Bytes formatRevertReason(final Bytes revertReason) {

private Map<Bytes, Bytes> getStorageUpdates(Address accountAddress) {
Map<Bytes, Bytes> storageUpdates = new HashMap<>();
MapWritableStates states = (MapWritableStates) mirrorNodeState.getWritableStates(CONTRACT_SERVICE);
MapWritableStates states = (MapWritableStates) mirrorNodeState.getWritableStates(ContractService.NAME);

try {
Set<SlotKey> modifiedKeys = states.get(STORAGE_KEY).modifiedKeys().stream()
Expand Down Expand Up @@ -301,7 +301,7 @@ private Map<Bytes, Bytes> getStorageUpdates(Address accountAddress) {
} catch (IllegalArgumentException e) {
log.warn(
"Failed to retrieve modified storage keys for service: {}, key: {}",
CONTRACT_SERVICE,
ContractService.NAME,
STORAGE_KEY,
e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import com.hedera.mirror.web3.evm.config.PrecompilesHolder;
import com.hedera.mirror.web3.evm.properties.MirrorNodeEvmProperties;
import com.hedera.mirror.web3.state.core.MapWritableStates;
import com.hedera.node.app.service.contract.ContractService;
import com.hedera.services.stream.proto.CallOperationType;
import com.hedera.services.stream.proto.ContractActionType;
import com.hedera.services.utils.EntityIdUtils;
Expand Down Expand Up @@ -113,7 +114,7 @@
@ExtendWith(MockitoExtension.class)
class OpcodeTracerTest {

private static final String CONTRACT_SERVICE = "ContractService";
private static final String CONTRACT_SERVICE = ContractService.NAME;
private static final String STORAGE_KEY = "STORAGE";
private static final Address CONTRACT_ADDRESS = Address.fromHexString("0x123");
private static final Address ETH_PRECOMPILE_ADDRESS = Address.fromHexString("0x01");
Expand Down

0 comments on commit da0f38b

Please sign in to comment.