mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
internal/ethapi, signer/core/apitypes: updates to tests
This commit is contained in:
parent
8a35841765
commit
bcd9790781
2 changed files with 8 additions and 7 deletions
|
|
@ -1037,11 +1037,8 @@ func TestSignBlobTransaction(t *testing.T) {
|
|||
}
|
||||
|
||||
_, err = api.SignTransaction(context.Background(), argsFromTransaction(res.Tx, b.acc.Address))
|
||||
if err == nil {
|
||||
t.Fatalf("should fail on blob transaction")
|
||||
}
|
||||
if !errors.Is(err, errBlobTxNotSupported) {
|
||||
t.Errorf("error mismatch. Have: %v, want: %v", err, errBlobTxNotSupported)
|
||||
if err != nil {
|
||||
t.Fatalf("should not fail on blob transaction")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,10 +72,14 @@ func TestTxArgs(t *testing.T) {
|
|||
if err := json.Unmarshal(tc.data, &txArgs); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if have := txArgs.ToTransaction().Type(); have != tc.wantType {
|
||||
tx, err := txArgs.ToTransaction()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if have := tx.Type(); have != tc.wantType {
|
||||
t.Errorf("test %d, have type %d, want type %d", i, have, tc.wantType)
|
||||
}
|
||||
if have := txArgs.ToTransaction().Hash(); have != tc.want {
|
||||
if have := tx.Hash(); have != tc.want {
|
||||
t.Errorf("test %d: have %v, want %v", i, have, tc.want)
|
||||
}
|
||||
d2, err := json.Marshal(txArgs)
|
||||
|
|
|
|||
Loading…
Reference in a new issue