From 9a63ad9c7845ae65c40f7f7b2e792cf718c6ee95 Mon Sep 17 00:00:00 2001 From: Masanori Yoshida Date: Thu, 25 Apr 2024 16:07:20 +0900 Subject: [PATCH] emit an error log that contains the whole error data returned by EVM if the corresponding error ABI is unknown --- pkg/relay/ethereum/chain.go | 1 + pkg/relay/ethereum/error_parse.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/relay/ethereum/chain.go b/pkg/relay/ethereum/chain.go index 32dddef..5af83a1 100644 --- a/pkg/relay/ethereum/chain.go +++ b/pkg/relay/ethereum/chain.go @@ -85,6 +85,7 @@ func NewChain(config ChainConfig) (*Chain, error) { if err != nil { return nil, fmt.Errorf("failed to create error repository: %v", err) } + return &Chain{ config: config, client: client, diff --git a/pkg/relay/ethereum/error_parse.go b/pkg/relay/ethereum/error_parse.go index 459bb46..d28e4bd 100644 --- a/pkg/relay/ethereum/error_parse.go +++ b/pkg/relay/ethereum/error_parse.go @@ -77,7 +77,7 @@ func (r ErrorRepository) Get(errorData []byte) (abi.Error, error) { copy(sel[:], errorData[:4]) errABI, ok := r[sel] if !ok { - return abi.Error{}, fmt.Errorf("error ABI not found") + return abi.Error{}, fmt.Errorf("error ABI not found: errorData=%x", errorData) } return errABI, nil }