Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PlasmaPower committed Feb 1, 2024
1 parent 03138e0 commit 7469252
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions system_tests/precompile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package arbtest

import (
"context"
"fmt"
"math/big"
"testing"

Expand Down Expand Up @@ -67,7 +68,9 @@ func TestCustomSolidityErrors(t *testing.T) {
Fatal(t, "customRevert call should have errored")
}
observedMessage := customError.Error()
expectedMessage := "execution reverted: error Custom(1024, This spider family wards off bugs: /\\oo/\\ //\\(oo)/\\ /\\oo/\\, true)"
expectedError := "Custom(1024, This spider family wards off bugs: /\\oo/\\ //\\(oo)/\\ /\\oo/\\, true)"
// The first error is server side. The second error is client side ABI decoding.
expectedMessage := fmt.Sprintf("execution reverted: error %v: %v", expectedError, expectedError)
if observedMessage != expectedMessage {
Fatal(t, observedMessage)
}
Expand All @@ -79,7 +82,8 @@ func TestCustomSolidityErrors(t *testing.T) {
Fatal(t, "out of range ArbBlockHash call should have errored")
}
observedMessage = customError.Error()
expectedMessage = "execution reverted: error InvalidBlockNumber(1000000000, 1)"
expectedError = "InvalidBlockNumber(1000000000, 1)"
expectedMessage = fmt.Sprintf("execution reverted: error %v: %v", expectedError, expectedError)
if observedMessage != expectedMessage {
Fatal(t, observedMessage)
}
Expand Down
3 changes: 2 additions & 1 deletion system_tests/retryable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ func TestRetryableNoExist(t *testing.T) {
arbRetryableTx, err := precompilesgen.NewArbRetryableTx(common.HexToAddress("6e"), builder.L2.Client)
Require(t, err)
_, err = arbRetryableTx.GetTimeout(&bind.CallOpts{}, common.Hash{})
if err.Error() != "execution reverted: error NoTicketWithID()" {
// The first error is server side. The second error is client side ABI decoding.
if err.Error() != "execution reverted: error NoTicketWithID(): NoTicketWithID()" {
Fatal(t, "didn't get expected NoTicketWithID error")
}
}
Expand Down

0 comments on commit 7469252

Please sign in to comment.