paychstate

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: Apache-2.0, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	// Currency id of the payment channel.
	CurrencyID byte

	// Sender of the payment channel.
	FromAddr string

	// Recipient of the payment channel.
	ToAddr string

	// Address of the payment channel.
	ChAddr string

	// The total balance of the payment channel.
	Balance *big.Int

	// The redeemed amount of the payment channel.
	Redeemed *big.Int

	// Nonce of the payment channel.
	Nonce uint64

	// The latest voucher of the payment channel.
	Voucher string

	// The potential network loss voucher of this payment channel.
	NetworkLossVoucher string

	// The nonce of this state.
	StateNonce uint64
}

State is the state of a payment channel.

func (*State) Decode

func (s *State) Decode(data []byte) error

Decode sets the state to be decoded state from given bytes.

@input - data.

@output - error.

func (State) Encode

func (s State) Encode() ([]byte, error)

Encode encodes a state into bytes.

@output - data, error.

Jump to

Keyboard shortcuts

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