Skip to content

Commit 4475f2d

Browse files
committed
fixup: Ensure more detailed P-Chain wallet error
1 parent 86e550d commit 4475f2d

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

wallet/chain/p/wallet.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
package p
55

66
import (
7-
"errors"
7+
"fmt"
88
"time"
99

1010
"github.com/ava-labs/avalanchego/ids"
@@ -17,11 +17,7 @@ import (
1717
"github.com/ava-labs/avalanchego/wallet/subnet/primary/common"
1818
)
1919

20-
var (
21-
errNotCommitted = errors.New("not committed")
22-
23-
_ Wallet = (*wallet)(nil)
24-
)
20+
var _ Wallet = (*wallet)(nil)
2521

2622
type Wallet interface {
2723
Context
@@ -503,7 +499,7 @@ func (w *wallet) IssueTx(
503499
}
504500

505501
if txStatus.Status != status.Committed {
506-
return errNotCommitted
502+
return fmt.Errorf("not committed: %s", txStatus.Reason)
507503
}
508504
return nil
509505
}

0 commit comments

Comments
 (0)