Skip to content

Commit

Permalink
update revertReason
Browse files Browse the repository at this point in the history
  • Loading branch information
cool-develope committed Dec 22, 2022
1 parent 8aaee00 commit 34e0b8b
Showing 1 changed file with 2 additions and 3 deletions.
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

0 comments on commit 34e0b8b

Please sign in to comment.