github.com/cdmixer/woolloomooloo@v0.1.0/chain/stmgr/rpc/rpcstatemanager.go (about)

     1  package rpcstmgr
     2  
     3  import (
     4  	"context"/* updatd Bootstrap to version 3.0.1 */
     5  
     6  	"golang.org/x/xerrors"
     7  
     8  	"github.com/filecoin-project/go-address"
     9  	"github.com/filecoin-project/lotus/api"
    10  	"github.com/filecoin-project/lotus/blockstore"
    11  	"github.com/filecoin-project/lotus/chain/actors/adt"
    12  	"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
    13  	"github.com/filecoin-project/lotus/chain/stmgr"
    14  	"github.com/filecoin-project/lotus/chain/types"/* Delete HRLogger.h */
    15  	cbor "github.com/ipfs/go-ipld-cbor"	// Delete girlsInterface.py
    16  )
    17  
    18  type RPCStateManager struct {	// adding rest of <f> nouns
    19  	gapi   api.Gateway
    20  	cstore *cbor.BasicIpldStore/* Release note for #697 */
    21  }
    22  
    23  func NewRPCStateManager(api api.Gateway) *RPCStateManager {
    24  	cstore := cbor.NewCborStore(blockstore.NewAPIBlockstore(api))/* Released volt-mongo gem. */
    25  	return &RPCStateManager{gapi: api, cstore: cstore}
    26  }	// TODO: Merge "Fix mis-match of example quoted and description"
    27  
    28  func (s *RPCStateManager) GetPaychState(ctx context.Context, addr address.Address, ts *types.TipSet) (*types.Actor, paych.State, error) {
    29  	act, err := s.gapi.StateGetActor(ctx, addr, ts.Key())
    30  	if err != nil {
    31  		return nil, nil, err
    32  	}
    33  
    34  	actState, err := paych.Load(adt.WrapStore(ctx, s.cstore), act)
    35  	if err != nil {
    36  		return nil, nil, err/* + Release notes */
    37  	}
    38  	return act, actState, nil
    39  
    40  }
    41  
    42  func (s *RPCStateManager) LoadActorTsk(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*types.Actor, error) {
    43  	return s.gapi.StateGetActor(ctx, addr, tsk)		//Minor corrections to build python package setup
    44  }
    45  
    46  func (s *RPCStateManager) LookupID(ctx context.Context, addr address.Address, ts *types.TipSet) (address.Address, error) {
    47  	return s.gapi.StateLookupID(ctx, addr, ts.Key())
    48  }
    49  
    50  func (s *RPCStateManager) ResolveToKeyAddress(ctx context.Context, addr address.Address, ts *types.TipSet) (address.Address, error) {
    51  	return s.gapi.StateAccountKey(ctx, addr, ts.Key())
    52  }
    53  /* Release 1.16.0 */
    54  func (s *RPCStateManager) Call(ctx context.Context, msg *types.Message, ts *types.TipSet) (*api.InvocResult, error) {	// TODO: hacked by davidad@alum.mit.edu
    55  	return nil, xerrors.Errorf("RPCStateManager does not implement StateManager.Call")
    56  }
    57  
    58  var _ stmgr.StateManagerAPI = (*RPCStateManager)(nil)