Skip to content

Commit

Permalink
fixup: ensure not committed error includes reason
Browse files Browse the repository at this point in the history
  • Loading branch information
marun committed Sep 7, 2023
1 parent 4810dc9 commit 2bbb837
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions wallet/chain/p/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package p

import (
"errors"
"fmt"
"time"

"github.com/ava-labs/avalanchego/ids"
Expand All @@ -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
Expand Down Expand Up @@ -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
}

0 comments on commit 2bbb837

Please sign in to comment.