You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: state.go
    path of file: ./repos/lotus/paychmgr
    
    the code of the file until where you have to start completion: package paychmgr

import (
	"context"

	"github.com/filecoin-project/go-address"

	"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
	"github.com/filecoin-project/lotus/chain/types"
)

type stateAccessor struct {
	sm stateManagerAPI
}

func (ca *stateAccessor) loadPaychActorState(ctx context.Context, ch address.Address) (*types.Actor, paych.State, error) {
	return ca.sm.GetPaychState(ctx, ch, nil)
}

func (ca *stateAccessor) loadStateChannelInfo(ctx context.Context, ch address.Address, dir uint64) (*ChannelInfo, error) {
	_, st, err := ca.loadPaychActorState(ctx, ch)
	if err != nil {
		return nil, err
	}

	// Load channel "From" account actor state
	f, err := st.From()
	if err != nil {
		return nil, err
	}
	from, err := ca.sm.ResolveToDetermin
    
func (ca *stateAccessor) loadStateChannelInfo(ctx context.Context, ch address.Address, dir uint64) (*ChannelInfo, error) {
	_, st, err := ca.loadPaychActorState(ctx, ch)
	if err != nil {
		return nil, err
	}

	// Load channel "From" account actor state
	f, err := st.From()
	if err != nil {
		return nil, err
	}
	from, err := ca.sm.ResolveToDeterministicAddress(ctx, f, nil)
	if err != nil {
		return nil, err
	}
	t, err := st.To()
	if err != nil {
		return nil, err
	}
	to, err := ca.sm.ResolveToDeterministicAddress(ctx, t, nil)
	if err != nil {
		return nil, err
	}

	nextLane, err := ca.nextLaneFromState(ctx, st)
	if err != nil {
		return nil, err
	}

	ci := &ChannelInfo{
		Channel:   &ch,
		Direction: dir,
		NextLane:  nextLane,
	}

	if dir == DirOutbound {
		ci.Control = from
		ci.Target = to
	} else {
		ci.Control = to
		ci.Target = from
	}

	return ci, nil
}