paych

package
v8.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2022 License: Apache-2.0, MIT Imports: 17 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ErrChannelStateUpdateAfterSettled = exitcode.FirstActorSpecificExitCode + iota
)
View Source
const LaneStatesAmtBitwidth = 3
View Source
const MaxLane = math.MaxInt64

Maximum number of lanes in a channel.

View Source
const MaxSecretSize = 256

Maximum size of a secret that can be submitted with a payment channel update (in bytes).

View Source
const SettleDelay = builtin.EpochsInHour * 12

Variables

This section is empty.

Functions

func VoucherSigningBytes

func VoucherSigningBytes(t *SignedVoucher) ([]byte, error)

Types

type Actor

type Actor struct{}

func (Actor) Code

func (a Actor) Code() cid.Cid

func (Actor) Collect

func (pca Actor) Collect(rt runtime.Runtime, _ *abi.EmptyValue) *abi.EmptyValue

func (*Actor) Constructor

func (pca *Actor) Constructor(rt runtime.Runtime, params *ConstructorParams) *abi.EmptyValue

Constructor creates a payment channel actor. See State for meaning of params.

func (Actor) Exports

func (a Actor) Exports() []interface{}

func (Actor) Settle

func (pca Actor) Settle(rt runtime.Runtime, _ *abi.EmptyValue) *abi.EmptyValue

func (Actor) State

func (a Actor) State() cbor.Er

func (Actor) UpdateChannelState

func (pca Actor) UpdateChannelState(rt runtime.Runtime, params *UpdateChannelStateParams) *abi.EmptyValue

type ConstructorParams

type ConstructorParams = paych0.ConstructorParams
type ConstructorParams struct {
	From addr.Address // Payer
	To   addr.Address // Payee
}

type LaneState

type LaneState struct {
	Redeemed big.Int
	Nonce    uint64
}

The Lane state tracks the latest (highest) voucher nonce used to merge the lane as well as the amount it has already redeemed.

func (*LaneState) MarshalCBOR

func (t *LaneState) MarshalCBOR(w io.Writer) error

func (*LaneState) UnmarshalCBOR

func (t *LaneState) UnmarshalCBOR(r io.Reader) error

type Merge

type Merge = paych0.Merge

Specifies which `Lane`s to be merged with what `Nonce` on channelUpdate

type Merge struct {
	Lane  uint64
	Nonce uint64
}

type ModVerifyParams

type ModVerifyParams = paych0.ModVerifyParams

Modular Verification method

type ModVerifyParams struct {
	// Actor on which to invoke the method.
	Actor addr.Address
	// Method to invoke.
	Method abi.MethodNum
	// Pre-serialized method parameters.
	Params []byte
}

type SignedVoucher

type SignedVoucher = paych7.SignedVoucher

type State

type State struct {
	// Channel owner, who has funded the actor
	From addr.Address
	// Recipient of payouts from channel
	To addr.Address

	// Amount successfully redeemed through the payment channel, paid out on `Collect()`
	ToSend abi.TokenAmount

	// Height at which the channel can be `Collected`
	SettlingAt abi.ChainEpoch
	// Height before which the channel `ToSend` cannot be collected
	MinSettleHeight abi.ChainEpoch

	// Collections of lane states for the channel, maintained in ID order.
	LaneStates cid.Cid // AMT<LaneState>
}

A given payment channel actor is established by From to enable off-chain microtransactions to To to be reconciled and tallied on chain.

func ConstructState

func ConstructState(from addr.Address, to addr.Address, emptyArrCid cid.Cid) *State

func (*State) MarshalCBOR

func (t *State) MarshalCBOR(w io.Writer) error

func (*State) UnmarshalCBOR

func (t *State) UnmarshalCBOR(r io.Reader) error

type StateSummary

type StateSummary struct {
	Redeemed abi.TokenAmount
}

func CheckStateInvariants

func CheckStateInvariants(st *State, store adt.Store, balance abi.TokenAmount) (*StateSummary, *builtin.MessageAccumulator)

Checks internal invariants of paych state.

type UpdateChannelStateParams

type UpdateChannelStateParams = paych7.UpdateChannelStateParams

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL