Skip to content

Commit

Permalink
migrate wallet access
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Sep 15, 2020
1 parent 4cd92d8 commit 53384e8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions node/impl/full/wallet.go
Expand Up @@ -36,16 +36,13 @@ func (a *WalletAPI) WalletList(ctx context.Context) ([]address.Address, error) {
}

func (a *WalletAPI) WalletBalance(ctx context.Context, addr address.Address) (types.BigInt, error) {
var bal types.BigInt
err := a.StateManager.WithParentStateTsk(types.EmptyTSK, a.StateManager.WithActor(addr, func(act *types.Actor) error {
bal = act.Balance
return nil
}))

act, err := a.StateManager.LoadActorTsk(ctx, addr, types.EmptyTSK)
if xerrors.Is(err, types.ErrActorNotFound) {
return big.Zero(), nil
} else if err != nil {
return big.Zero(), err
}
return bal, err
return act.Balance, nil
}

func (a *WalletAPI) WalletSign(ctx context.Context, k address.Address, msg []byte) (*crypto.Signature, error) {
Expand Down

0 comments on commit 53384e8

Please sign in to comment.