Documentation ¶
Index ¶
- Constants
- type Actor
- func (a Actor) Code() cid.Cid
- func (pca Actor) Collect(rt runtime.Runtime, _ *abi.EmptyValue) *abi.EmptyValue
- func (pca *Actor) Constructor(rt runtime.Runtime, params *ConstructorParams) *abi.EmptyValue
- func (a Actor) Exports() []interface{}
- func (pca Actor) Settle(rt runtime.Runtime, _ *abi.EmptyValue) *abi.EmptyValue
- func (a Actor) State() cbor.Er
- func (pca Actor) UpdateChannelState(rt runtime.Runtime, params *UpdateChannelStateParams) *abi.EmptyValue
- type ConstructorParams
- type LaneState
- type Merge
- type ModVerifyParams
- type SignedVoucher
- type State
- type StateSummary
- type UpdateChannelStateParams
Constants ¶
const (
ErrChannelStateUpdateAfterSettled = exitcode.FirstActorSpecificExitCode + iota
)
const MaxLane = math.MaxInt64
Maximum number of lanes in a channel.
const MaxSecretSize = 256
Maximum size of a secret that can be submitted with a payment channel update (in bytes).
const SettleDelay = builtin.EpochsInHour * 12
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor struct{}
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) Settle ¶
func (pca Actor) Settle(rt runtime.Runtime, _ *abi.EmptyValue) *abi.EmptyValue
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 ¶
The Lane state tracks the latest (highest) voucher nonce used to merge the lane as well as the amount it has already redeemed.
type 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 = paych0.SignedVoucher
A voucher is sent by `From` to `To` off-chain in order to enable `To` to redeem payments on-chain in the future
type SignedVoucher struct { // ChannelAddr is the address of the payment channel this signed voucher is valid for ChannelAddr addr.Address // TimeLockMin sets a min epoch before which the voucher cannot be redeemed TimeLockMin abi.ChainEpoch // TimeLockMax sets a max epoch beyond which the voucher cannot be redeemed // TimeLockMax set to 0 means no timeout TimeLockMax abi.ChainEpoch // (optional) The SecretPreImage is used by `To` to validate SecretPreimage []byte // (optional) Extra can be specified by `From` to add a verification method to the voucher. Extra *ModVerifyParams // Specifies which lane the Voucher merges into (will be created if does not exist) Lane uint64 // Nonce is set by `From` to prevent redemption of stale vouchers on a lane Nonce uint64 // Amount voucher can be redeemed for Amount big.Int // (optional) MinSettleHeight can extend channel MinSettleHeight if needed MinSettleHeight abi.ChainEpoch // (optional) Set of lanes to be merged into `Lane` Merges []Merge // Sender's signature over the voucher Signature *crypto.Signature }
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 ¶
type StateSummary ¶ added in v2.0.2
type StateSummary struct {
Redeemed abi.TokenAmount
}
func CheckStateInvariants ¶ added in v2.0.2
func CheckStateInvariants(st *State, store adt.Store, balance abi.TokenAmount) (*StateSummary, *builtin.MessageAccumulator)
Checks internal invariants of paych state.
type UpdateChannelStateParams ¶
type UpdateChannelStateParams struct { Sv SignedVoucher Secret []byte }
Changed since v0: - Proof []byte removed (unused)
func (*UpdateChannelStateParams) MarshalCBOR ¶
func (t *UpdateChannelStateParams) MarshalCBOR(w io.Writer) error
func (*UpdateChannelStateParams) UnmarshalCBOR ¶
func (t *UpdateChannelStateParams) UnmarshalCBOR(r io.Reader) error