mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
added time-range tests
This commit is contained in:
parent
702d157aef
commit
49bc2a8570
2 changed files with 19 additions and 0 deletions
|
|
@ -46,6 +46,7 @@ func newTestContextBuilder(t *testing.T) *testContextBuilder {
|
|||
|
||||
func (tb *testContextBuilder) build() *testContext {
|
||||
genesis := core.DeveloperGenesisBlock(10_000_000, &common.Address{})
|
||||
genesis.Timestamp = 100
|
||||
genesisBlock := genesis.ToBlock()
|
||||
gaspool := new(core.GasPool).AddGas(genesisBlock.GasLimit())
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,24 @@ func TestValidationFailure_sigerror(t *testing.T) {
|
|||
}, "account signature error")
|
||||
}
|
||||
|
||||
func TestValidationFailure_validAfter(t *testing.T) {
|
||||
|
||||
handleTransaction(newTestContextBuilder(t).withCode(DEFAULT_SENDER,
|
||||
returnData(core.PackValidationData(core.MAGIC_VALUE_SENDER, 300, 200)), DEFAULT_BALANCE), types.Rip7560AccountAbstractionTx{
|
||||
ValidationGas: uint64(1000000000),
|
||||
GasFeeCap: big.NewInt(1000000000),
|
||||
}, "RIP-7560 transaction validity not reached yet")
|
||||
}
|
||||
|
||||
func TestValidationFailure_validUntil(t *testing.T) {
|
||||
|
||||
handleTransaction(newTestContextBuilder(t).withCode(DEFAULT_SENDER,
|
||||
returnData(core.PackValidationData(core.MAGIC_VALUE_SENDER, 1, 0)), DEFAULT_BALANCE), types.Rip7560AccountAbstractionTx{
|
||||
ValidationGas: uint64(1000000000),
|
||||
GasFeeCap: big.NewInt(1000000000),
|
||||
}, "RIP-7560 transaction validity expired")
|
||||
}
|
||||
|
||||
func TestValidation_ok(t *testing.T) {
|
||||
|
||||
handleTransaction(newTestContextBuilder(t).withCode(DEFAULT_SENDER, createAccountCode(), DEFAULT_BALANCE), types.Rip7560AccountAbstractionTx{
|
||||
|
|
|
|||
Loading…
Reference in a new issue