refactor state utilities into StateManager package, implement proper election proofs

This commit is contained in:
whyrusleeping
2019-09-09 19:14:00 -07:00
parent 6e21372ccb
commit ed45d1c2b4
29 changed files with 796 additions and 483 deletions
+4 -4
View File
@@ -4,7 +4,7 @@ import (
"context"
"github.com/filecoin-project/go-lotus/chain/address"
"github.com/filecoin-project/go-lotus/chain/store"
"github.com/filecoin-project/go-lotus/chain/stmgr"
"github.com/filecoin-project/go-lotus/chain/types"
"github.com/filecoin-project/go-lotus/chain/wallet"
@@ -15,8 +15,8 @@ import (
type WalletAPI struct {
fx.In
Chain *store.ChainStore
Wallet *wallet.Wallet
StateManager *stmgr.StateManager
Wallet *wallet.Wallet
}
func (a *WalletAPI) WalletNew(ctx context.Context, typ string) (address.Address, error) {
@@ -32,7 +32,7 @@ func (a *WalletAPI) WalletList(ctx context.Context) ([]address.Address, error) {
}
func (a *WalletAPI) WalletBalance(ctx context.Context, addr address.Address) (types.BigInt, error) {
return a.Chain.GetBalance(addr)
return a.StateManager.GetBalance(addr)
}
func (a *WalletAPI) WalletSign(ctx context.Context, k address.Address, msg []byte) (*types.Signature, error) {