@ -69,7 +69,7 @@ public class GeneralStateReferenceTestTools {
private static final JsonTestParameters < ? , ? > params =
private static final JsonTestParameters < ? , ? > params =
JsonTestParameters . create ( GeneralStateTestCaseSpec . class , GeneralStateTestCaseEipSpec . class )
JsonTestParameters . create ( GeneralStateTestCaseSpec . class , GeneralStateTestCaseEipSpec . class )
. generator (
. generator (
( testName , stateSpec , collector ) - > {
( testName , fullPath , stateSpec , collector ) - > {
final String prefix = testName + "-" ;
final String prefix = testName + "-" ;
for ( final Map . Entry < String , List < GeneralStateTestCaseEipSpec > > entry :
for ( final Map . Entry < String , List < GeneralStateTestCaseEipSpec > > entry :
stateSpec . finalStateSpecs ( ) . entrySet ( ) ) {
stateSpec . finalStateSpecs ( ) . entrySet ( ) ) {
@ -77,10 +77,10 @@ public class GeneralStateReferenceTestTools {
final boolean runTest = EIPS_TO_RUN . contains ( eip ) ;
final boolean runTest = EIPS_TO_RUN . contains ( eip ) ;
final List < GeneralStateTestCaseEipSpec > eipSpecs = entry . getValue ( ) ;
final List < GeneralStateTestCaseEipSpec > eipSpecs = entry . getValue ( ) ;
if ( eipSpecs . size ( ) = = 1 ) {
if ( eipSpecs . size ( ) = = 1 ) {
collector . add ( prefix + eip , eipSpecs . get ( 0 ) , runTest ) ;
collector . add ( prefix + eip , fullPath , eipSpecs . get ( 0 ) , runTest ) ;
} else {
} else {
for ( int i = 0 ; i < eipSpecs . size ( ) ; i + + ) {
for ( int i = 0 ; i < eipSpecs . size ( ) ; i + + ) {
collector . add ( prefix + eip + '[' + i + ']' , eipSpecs . get ( i ) , runTest ) ;
collector . add ( prefix + eip + '[' + i + ']' , fullPath , eipSpecs . get ( i ) , runTest ) ;
}
}
}
}
}
}
@ -91,13 +91,6 @@ public class GeneralStateReferenceTestTools {
params . ignoreAll ( ) ;
params . ignoreAll ( ) ;
}
}
// Known incorrect test.
params . ignore (
"RevertPrecompiledTouch(_storage)?-(EIP158|Byzantium|Constantinople|ConstantinopleFix)" ) ;
// Gas integer value is too large to construct a valid transaction.
params . ignore ( "OverflowGasRequire" ) ;
// Consumes a huge amount of memory
// Consumes a huge amount of memory
params . ignore ( "static_Call1MB1024Calldepth-\\w" ) ;
params . ignore ( "static_Call1MB1024Calldepth-\\w" ) ;
params . ignore ( "ShanghaiLove_.*" ) ;
params . ignore ( "ShanghaiLove_.*" ) ;
@ -105,6 +98,9 @@ public class GeneralStateReferenceTestTools {
// Don't do time consuming tests
// Don't do time consuming tests
params . ignore ( "CALLBlake2f_MaxRounds.*" ) ;
params . ignore ( "CALLBlake2f_MaxRounds.*" ) ;
params . ignore ( "loopMul-.*" ) ;
params . ignore ( "loopMul-.*" ) ;
// EIP tests are explicitly meant to be works-in-progress with known failing tests
params . ignore ( "/EIPTests/" ) ;
}
}
private GeneralStateReferenceTestTools ( ) {
private GeneralStateReferenceTestTools ( ) {
@ -152,13 +148,17 @@ public class GeneralStateReferenceTestTools {
new BlockHashLookup ( blockHeader , blockchain ) ,
new BlockHashLookup ( blockHeader , blockchain ) ,
false ,
false ,
TransactionValidationParams . processingBlock ( ) ) ;
TransactionValidationParams . processingBlock ( ) ) ;
if ( ! result . isInvalid ( ) ) {
if ( result . isInvalid ( ) ) {
final Account coinbase = worldStateUpdater . getOrCreate ( spec . getBlockHeader ( ) . getCoinbase ( ) ) ;
assertThat ( spec . getExpectException ( ) ) . isNotNull ( ) ;
if ( coinbase ! = null & & coinbase . isEmpty ( ) & & shouldClearEmptyAccounts ( spec . getFork ( ) ) ) {
return ;
worldStateUpdater . deleteAccount ( coinbase . getAddress ( ) ) ;
}
}
assertThat ( spec . getExpectException ( ) ) . withFailMessage ( "Exception was expected - " + spec . getExpectException ( ) ) . isNull ( ) ;
worldStateUpdater . commit ( ) ;
final Account coinbase = worldStateUpdater . getOrCreate ( spec . getBlockHeader ( ) . getCoinbase ( ) ) ;
if ( coinbase ! = null & & coinbase . isEmpty ( ) & & shouldClearEmptyAccounts ( spec . getFork ( ) ) ) {
worldStateUpdater . deleteAccount ( coinbase . getAddress ( ) ) ;
}
}
worldStateUpdater . commit ( ) ;
// Check the world state root hash.
// Check the world state root hash.
final Hash expectedRootHash = spec . getExpectedRootHash ( ) ;
final Hash expectedRootHash = spec . getExpectedRootHash ( ) ;