Skip to content

Commit

Permalink
testgen: add generators for invalid getStorage tests
Browse files Browse the repository at this point in the history
These tests were added to manually in ethereum/execution-apis#305, so they
would be lost if tests are regenerated from scratch.
  • Loading branch information
fjl committed Jan 17, 2024
1 parent a0cb54f commit 39a6aea
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions testgen/generators.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,28 @@ var EthGetStorage = MethodTests{
return fmt.Errorf("requested storage slot is zero")
},
},
{
"get-storage-invalid-key-too-large",
"requests an invalid storage key",
func(ctx context.Context, t *T) error {
err := t.rpc.CallContext(ctx, nil, "eth_getStorageAt", "0xaa00000000000000000000000000000000000000", "0x00000000000000000000000000000000000000000000000000000000000000000", "latest")
if err == nil {
return fmt.Errorf("expected error")
}
return nil
},
},
{
"get-storage-invalid-key",
"requests an invalid storage key",
func(ctx context.Context, t *T) error {
err := t.rpc.CallContext(ctx, nil, "eth_getStorageAt", "0xaa00000000000000000000000000000000000000", "0xasdf", "latest")
if err == nil {
return fmt.Errorf("expected error")
}
return nil
},
},
},
}

Expand Down

0 comments on commit 39a6aea

Please sign in to comment.