@ -26,7 +26,7 @@ import org.hyperledger.besu.evm.EVM;
import org.hyperledger.besu.evm.frame.MessageFrame ;
import org.hyperledger.besu.evm.frame.MessageFrame ;
import org.hyperledger.besu.evm.gascalculator.CancunGasCalculator ;
import org.hyperledger.besu.evm.gascalculator.CancunGasCalculator ;
import org.hyperledger.besu.evm.gascalculator.LondonGasCalculator ;
import org.hyperledger.besu.evm.gascalculator.LondonGasCalculator ;
import org.hyperledger.besu.evm.operation.Data HashOperation ;
import org.hyperledger.besu.evm.operation.Blob HashOperation ;
import org.hyperledger.besu.evm.operation.Operation ;
import org.hyperledger.besu.evm.operation.Operation ;
import java.util.ArrayList ;
import java.util.ArrayList ;
@ -38,7 +38,7 @@ import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.bytes.Bytes32 ;
import org.apache.tuweni.bytes.Bytes32 ;
import org.junit.jupiter.api.Test ;
import org.junit.jupiter.api.Test ;
class Data HashOperationTest {
class Blob HashOperationTest {
private static final String testVersionedHash =
private static final String testVersionedHash =
"0x01cafebabeb0b0facedeadbeefbeef0001cafebabeb0b0facedeadbeefbeef00" ;
"0x01cafebabeb0b0facedeadbeefbeef0001cafebabeb0b0facedeadbeefbeef00" ;
@ -47,7 +47,7 @@ class DataHashOperationTest {
void putsHashOnStack ( ) {
void putsHashOnStack ( ) {
VersionedHash version0Hash = new VersionedHash ( Bytes32 . fromHexStringStrict ( testVersionedHash ) ) ;
VersionedHash version0Hash = new VersionedHash ( Bytes32 . fromHexStringStrict ( testVersionedHash ) ) ;
List < VersionedHash > versionedHashes = Arrays . asList ( version0Hash ) ;
List < VersionedHash > versionedHashes = Arrays . asList ( version0Hash ) ;
Data HashOperation getHash = new Data HashOperation( new LondonGasCalculator ( ) ) ;
Blob HashOperation getHash = new Blob HashOperation( new LondonGasCalculator ( ) ) ;
MessageFrame frame = mock ( MessageFrame . class ) ;
MessageFrame frame = mock ( MessageFrame . class ) ;
when ( frame . popStackItem ( ) ) . thenReturn ( Bytes . of ( 0 ) ) ;
when ( frame . popStackItem ( ) ) . thenReturn ( Bytes . of ( 0 ) ) ;
when ( frame . getVersionedHashes ( ) ) . thenReturn ( Optional . of ( versionedHashes ) ) ;
when ( frame . getVersionedHashes ( ) ) . thenReturn ( Optional . of ( versionedHashes ) ) ;
@ -63,7 +63,7 @@ class DataHashOperationTest {
EVM fakeEVM = mock ( EVM . class ) ;
EVM fakeEVM = mock ( EVM . class ) ;
Data HashOperation getHash = new Data HashOperation( new CancunGasCalculator ( ) ) ;
Blob HashOperation getHash = new Blob HashOperation( new CancunGasCalculator ( ) ) ;
MessageFrame frame = mock ( MessageFrame . class ) ;
MessageFrame frame = mock ( MessageFrame . class ) ;
when ( frame . popStackItem ( ) ) . thenReturn ( Bytes . of ( 0 ) ) ;
when ( frame . popStackItem ( ) ) . thenReturn ( Bytes . of ( 0 ) ) ;
when ( frame . getVersionedHashes ( ) ) . thenReturn ( Optional . empty ( ) ) ;
when ( frame . getVersionedHashes ( ) ) . thenReturn ( Optional . empty ( ) ) ;
@ -84,7 +84,7 @@ class DataHashOperationTest {
void pushZeroOnVersionIndexOutOFBounds ( ) {
void pushZeroOnVersionIndexOutOFBounds ( ) {
VersionedHash version0Hash = new VersionedHash ( Bytes32 . fromHexStringStrict ( testVersionedHash ) ) ;
VersionedHash version0Hash = new VersionedHash ( Bytes32 . fromHexStringStrict ( testVersionedHash ) ) ;
List < VersionedHash > versionedHashes = Arrays . asList ( version0Hash ) ;
List < VersionedHash > versionedHashes = Arrays . asList ( version0Hash ) ;
Data HashOperation getHash = new Data HashOperation( new CancunGasCalculator ( ) ) ;
Blob HashOperation getHash = new Blob HashOperation( new CancunGasCalculator ( ) ) ;
MessageFrame frame = mock ( MessageFrame . class ) ;
MessageFrame frame = mock ( MessageFrame . class ) ;
when ( frame . popStackItem ( ) ) . thenReturn ( Bytes . of ( 1 ) ) ;
when ( frame . popStackItem ( ) ) . thenReturn ( Bytes . of ( 1 ) ) ;
when ( frame . getVersionedHashes ( ) ) . thenReturn ( Optional . of ( versionedHashes ) ) ;
when ( frame . getVersionedHashes ( ) ) . thenReturn ( Optional . of ( versionedHashes ) ) ;
@ -99,7 +99,7 @@ class DataHashOperationTest {
public void pushZeroWhenPopsMissingUint256SizedIndex ( ) {
public void pushZeroWhenPopsMissingUint256SizedIndex ( ) {
VersionedHash version0Hash = new VersionedHash ( Bytes32 . fromHexStringStrict ( testVersionedHash ) ) ;
VersionedHash version0Hash = new VersionedHash ( Bytes32 . fromHexStringStrict ( testVersionedHash ) ) ;
List < VersionedHash > versionedHashes = Arrays . asList ( version0Hash ) ;
List < VersionedHash > versionedHashes = Arrays . asList ( version0Hash ) ;
Data HashOperation getHash = new Data HashOperation( new CancunGasCalculator ( ) ) ;
Blob HashOperation getHash = new Blob HashOperation( new CancunGasCalculator ( ) ) ;
MessageFrame frame = mock ( MessageFrame . class ) ;
MessageFrame frame = mock ( MessageFrame . class ) ;
when ( frame . popStackItem ( ) ) . thenReturn ( Bytes32 . repeat ( ( byte ) 0x2C ) ) ;
when ( frame . popStackItem ( ) ) . thenReturn ( Bytes32 . repeat ( ( byte ) 0x2C ) ) ;
when ( frame . getVersionedHashes ( ) ) . thenReturn ( Optional . of ( versionedHashes ) ) ;
when ( frame . getVersionedHashes ( ) ) . thenReturn ( Optional . of ( versionedHashes ) ) ;