From 2fedb46770069ea0de77016c8f954b09c2f779f9 Mon Sep 17 00:00:00 2001 From: Rootul P Date: Thu, 11 Jan 2024 13:11:24 -0500 Subject: [PATCH] feat: export `ErrTimedOutWaitingForTx` (#1169) Closes https://github.com/celestiaorg/celestia-core/issues/1168 --- rpc/core/mempool.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpc/core/mempool.go b/rpc/core/mempool.go index 0b1b5d4b5c..05fae1edb5 100644 --- a/rpc/core/mempool.go +++ b/rpc/core/mempool.go @@ -13,6 +13,8 @@ import ( "github.com/tendermint/tendermint/types" ) +var ErrTimedOutWaitingForTx = errors.New("timed out waiting for tx to be included in a block") + //----------------------------------------------------------------------------- // NOTE: tx should be signed, but this is only checked at the app level (not by CometBFT!) @@ -137,7 +139,7 @@ func BroadcastTxCommit(ctx *rpctypes.Context, tx types.Tx) (*ctypes.ResultBroadc Hash: tx.Hash(), }, err case <-time.After(env.Config.TimeoutBroadcastTxCommit): - err = errors.New("timed out waiting for tx to be included in a block") + err = ErrTimedOutWaitingForTx env.Logger.Error("Error on broadcastTxCommit", "err", err) return &ctypes.ResultBroadcastTxCommit{ CheckTx: *checkTxRes,