diff --git a/relayer/pkg/chainlink/txm/txm.go b/relayer/pkg/chainlink/txm/txm.go index 640989da9..7b2453983 100644 --- a/relayer/pkg/chainlink/txm/txm.go +++ b/relayer/pkg/chainlink/txm/txm.go @@ -19,6 +19,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/utils" + ethrpc "github.com/ethereum/go-ethereum/rpc" "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/starknet" ) @@ -199,12 +200,11 @@ func (txm *starktxm) broadcast(ctx context.Context, publicKey *felt.Felt, accoun feeEstimate, err := account.EstimateFee(ctx, []starknetrpc.BroadcastTxn{tx}, simFlags, starknetrpc.BlockID{Tag: "latest"}) if err != nil { var data any - var rpcError *starknetrpc.RPCError - if errors.As(err, &rpcError) { - data = rpcError.Data() + if err, ok := err.(ethrpc.DataError); ok { + data = err.ErrorData() } txm.lggr.Errorw("failed to estimate fee", "error", err, "data", data) - return txhash, fmt.Errorf("failed to estimate fee: %+w", err) + return txhash, fmt.Errorf("failed to estimate fee: %T %+w", err, err) } txm.lggr.Infow("Account", "account", account.AccountAddress) @@ -252,9 +252,8 @@ func (txm *starktxm) broadcast(ctx context.Context, publicKey *felt.Felt, accoun if err != nil { // TODO: handle initial broadcast errors - what kind of errors occur? var data any - var rpcError *starknetrpc.RPCError - if errors.As(err, &rpcError) { - data = rpcError.Data() + if err, ok := err.(ethrpc.DataError); ok { + data = err.ErrorData() } txm.lggr.Errorw("failed to invoke tx", "error", err, "data", data) return txhash, fmt.Errorf("failed to invoke tx: %+w", err)