From 292700523ef8acc1a4dcf0e9cdde359da32151ea Mon Sep 17 00:00:00 2001 From: Maru Newby Date: Wed, 6 Sep 2023 19:07:14 -0700 Subject: [PATCH] fixup: ensure not committed error includes reason --- wallet/chain/p/wallet.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/wallet/chain/p/wallet.go b/wallet/chain/p/wallet.go index 8bdcb52bf2e3..6d7b9e090667 100644 --- a/wallet/chain/p/wallet.go +++ b/wallet/chain/p/wallet.go @@ -4,7 +4,7 @@ package p import ( - "errors" + "fmt" "time" "github.com/ava-labs/avalanchego/ids" @@ -17,11 +17,7 @@ import ( "github.com/ava-labs/avalanchego/wallet/subnet/primary/common" ) -var ( - errNotCommitted = errors.New("not committed") - - _ Wallet = (*wallet)(nil) -) +var _ Wallet = (*wallet)(nil) type Wallet interface { Context @@ -507,7 +503,7 @@ func (w *wallet) IssueTx( } if txStatus.Status != status.Committed { - return errNotCommitted + return fmt.Errorf("not committed: %s", txStatus.Reason) } return nil }