diff --git a/params/protocol_params.go b/params/protocol_params.go index 1ee477821..c0cb7294a 100644 --- a/params/protocol_params.go +++ b/params/protocol_params.go @@ -20,13 +20,16 @@ import "math/big" var ( TargetGasLimit = GenesisGasLimit // The artificial target -) -const ( + // the followings are modified by Quorum and purposely moved from `const` section + // so to faclitate the execution of Ethereum Tests + // @see tests/init_test.go#TestMain GasLimitBoundDivisor uint64 = 4096 // The bound divisor of the gas limit, used in update calculations. MinGasLimit uint64 = 700000000 // Minimum the gas limit may ever be. GenesisGasLimit uint64 = 800000000 // Gas limit of the Genesis block. +) +const ( MaximumExtraDataSize uint64 = 32 // Maximum size extra data may be after Genesis. ExpByteGas uint64 = 10 // Times ceil(log256(exponent)) for the EXP instruction. SloadGas uint64 = 50 // Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added. diff --git a/tests/init_test.go b/tests/init_test.go index 26e919d24..28a9d9dae 100644 --- a/tests/init_test.go +++ b/tests/init_test.go @@ -261,3 +261,20 @@ func runTestFunc(runTest interface{}, t *testing.T, name string, m reflect.Value m.MapIndex(reflect.ValueOf(key)), }) } + +func TestMain(m *testing.M) { + backupMinGasLimit := params.MinGasLimit + backupGasLimitBoundDivisor := params.GasLimitBoundDivisor + backupGenesisGasLimit := params.GenesisGasLimit + defer func() { + params.GasLimitBoundDivisor = backupGasLimitBoundDivisor + params.MinGasLimit = backupMinGasLimit + params.GenesisGasLimit = backupGenesisGasLimit + }() + params.GasLimitBoundDivisor = 1024 + params.MinGasLimit = 5000 + params.GenesisGasLimit = 4712388 + + retCode := m.Run() + os.Exit(retCode) +} \ No newline at end of file