Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix unpack the revert reason #1475

Merged
merged 3 commits into from
Dec 23, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions test/operations/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/0xPolygonHermez/zkevm-node/jsonrpc"
"github.com/0xPolygonHermez/zkevm-node/log"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/core/types"
"google.golang.org/grpc"
Expand Down Expand Up @@ -116,9 +117,7 @@ func revertReason(ctx context.Context, c ethClienter, tx *types.Transaction, blo
return "", err
}

reasonOffset := new(big.Int).SetBytes(hex[4 : 4+32])
reason := string(hex[4+32+int(reasonOffset.Uint64()):])
return reason, nil
return abi.UnpackRevert(hex)
}

// WaitGRPCHealthy waits for a gRPC endpoint to be responding according to the
Expand Down