add a command to check wallet balance

This commit is contained in:
whyrusleeping
2019-07-18 13:26:04 -07:00
parent 27a7858055
commit f0841203a3
6 changed files with 64 additions and 2 deletions
+2
View File
@@ -5,6 +5,7 @@ import (
"github.com/filecoin-project/go-lotus/chain"
"github.com/filecoin-project/go-lotus/chain/address"
"github.com/filecoin-project/go-lotus/chain/types"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-filestore"
@@ -72,6 +73,7 @@ type API interface {
WalletNew(context.Context, string) (address.Address, error)
WalletList(context.Context) ([]address.Address, error)
WalletBalance(context.Context, address.Address) (types.BigInt, error)
// // import
// // export
// // (on cli - cmd to list associations)
+8 -2
View File
@@ -5,6 +5,7 @@ import (
"github.com/filecoin-project/go-lotus/chain"
"github.com/filecoin-project/go-lotus/chain/address"
"github.com/filecoin-project/go-lotus/chain/types"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/peer"
@@ -25,8 +26,9 @@ type Struct struct {
MinerStart func(context.Context, address.Address) error
MinerCreateBlock func(context.Context, address.Address, *chain.TipSet, []chain.Ticket, chain.ElectionProof, []*chain.SignedMessage) (*chain.BlockMsg, error)
WalletNew func(context.Context, string) (address.Address, error)
WalletList func(context.Context) ([]address.Address, error)
WalletNew func(context.Context, string) (address.Address, error)
WalletList func(context.Context) ([]address.Address, error)
WalletBalance func(context.Context, address.Address) (types.BigInt, error)
ClientImport func(ctx context.Context, path string) (cid.Cid, error)
ClientListImports func(ctx context.Context) ([]Import, error)
@@ -99,4 +101,8 @@ func (c *Struct) WalletList(ctx context.Context) ([]address.Address, error) {
return c.Internal.WalletList(ctx)
}
func (c *Struct) WalletBalance(ctx context.Context, a address.Address) (types.BigInt, error) {
return c.Internal.WalletBalance(ctx, a)
}
var _ API = &Struct{}