Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
feat(bindings): rename fork choice to state transition (#372)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Aug 29, 2023
1 parent 28ea4db commit e09fd97
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 64 deletions.
2 changes: 1 addition & 1 deletion bindings/.githead
Original file line number Diff line number Diff line change
@@ -1 +1 @@
437763a729bbf02cbf588559a20cc354f19b1677
621518209c36347cb277d5634946b283ec876903
10 changes: 5 additions & 5 deletions bindings/encoding/custom_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ type testJsonError struct{}

func (e *testJsonError) Error() string { return common.Bytes2Hex(randomBytes(10)) }

func (e *testJsonError) ErrorData() interface{} { return "0x3b67b808" }
func (e *testJsonError) ErrorData() interface{} { return "0x8a1c400f" }

func TestTryParsingCustomError(t *testing.T) {
randomErr := common.Bytes2Hex(randomBytes(10))
require.Equal(t, randomErr, TryParsingCustomError(errors.New(randomErr)).Error())

err := TryParsingCustomError(errors.New(
// L1_FORK_CHOICE_NOT_FOUND
"VM Exception while processing transaction: reverted with an unrecognized custom error (return data: 0x3b67b808)",
// L1_INVALID_BLOCK_ID
"VM Exception while processing transaction: reverted with an unrecognized custom error (return data: 0x8a1c400f)",
))

require.True(t, strings.HasPrefix(err.Error(), "L1_FORK_CHOICE_NOT_FOUND"))
require.True(t, strings.HasPrefix(err.Error(), "L1_INVALID_BLOCK_ID"))

err = TryParsingCustomError(&testJsonError{})

require.True(t, strings.HasPrefix(err.Error(), "L1_FORK_CHOICE_NOT_FOUND"))
require.True(t, strings.HasPrefix(err.Error(), "L1_INVALID_BLOCK_ID"))
}
Loading

0 comments on commit e09fd97

Please sign in to comment.