multisig

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2020 License: Apache-2.0, MIT Imports: 15 Imported by: 28

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeProposalHash

func ComputeProposalHash(txn *Transaction, hash func([]byte) [32]byte) ([]byte, error)

Computes a digest of a proposed transaction. This digest is used to confirm identity of the transaction associated with an ID, which might change under chain re-orgs.

Types

type Actor

type Actor struct{}

func (Actor) AddSigner

func (a Actor) AddSigner(rt vmr.Runtime, params *AddSignerParams) *adt.EmptyValue

func (Actor) Approve

func (a Actor) Approve(rt vmr.Runtime, params *TxnIDParams) *ApproveReturn

func (Actor) Cancel

func (a Actor) Cancel(rt vmr.Runtime, params *TxnIDParams) *adt.EmptyValue

func (Actor) ChangeNumApprovalsThreshold

func (a Actor) ChangeNumApprovalsThreshold(rt vmr.Runtime, params *ChangeNumApprovalsThresholdParams) *adt.EmptyValue

func (Actor) Constructor

func (a Actor) Constructor(rt vmr.Runtime, params *ConstructorParams) *adt.EmptyValue

func (Actor) Exports

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

func (Actor) Propose

func (a Actor) Propose(rt vmr.Runtime, params *ProposeParams) *ProposeReturn

func (Actor) RemoveSigner

func (a Actor) RemoveSigner(rt vmr.Runtime, params *RemoveSignerParams) *adt.EmptyValue

func (Actor) SwapSigner

func (a Actor) SwapSigner(rt vmr.Runtime, params *SwapSignerParams) *adt.EmptyValue

type AddSignerParams

type AddSignerParams struct {
	Signer   addr.Address
	Increase bool
}

func (*AddSignerParams) MarshalCBOR

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

func (*AddSignerParams) UnmarshalCBOR

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

type ApproveReturn added in v0.7.0

type ApproveReturn struct {
	// Applied indicates if the transaction was applied as opposed to proposed but not applied due to lack of approvals
	Applied bool
	// Code is the exitcode of the transaction, if Applied is false this field should be ignored.
	Code exitcode.ExitCode
	// Ret is the return vale of the transaction, if Applied is false this field should be ignored.
	Ret []byte
}

func (*ApproveReturn) MarshalCBOR added in v0.7.0

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

func (*ApproveReturn) UnmarshalCBOR added in v0.7.0

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

type ChangeNumApprovalsThresholdParams

type ChangeNumApprovalsThresholdParams struct {
	NewThreshold uint64
}

func (*ChangeNumApprovalsThresholdParams) MarshalCBOR

func (*ChangeNumApprovalsThresholdParams) UnmarshalCBOR

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

type ConstructorParams

type ConstructorParams struct {
	Signers               []addr.Address
	NumApprovalsThreshold uint64
	UnlockDuration        abi.ChainEpoch
}

func (*ConstructorParams) MarshalCBOR

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

func (*ConstructorParams) UnmarshalCBOR

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

type ProposalHashData

type ProposalHashData struct {
	Requester addr.Address
	To        addr.Address
	Value     abi.TokenAmount
	Method    abi.MethodNum
	Params    []byte
}

Data for a BLAKE2B-256 to be attached to methods referencing proposals via TXIDs. Ensures the existence of a cryptographic reference to the original proposal. Useful for offline signers and for protection when reorgs change a multisig TXID.

Requester - The requesting multisig wallet member. All other fields - From the "Transaction" struct.

func (*ProposalHashData) MarshalCBOR

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

func (*ProposalHashData) Serialize

func (phd *ProposalHashData) Serialize() ([]byte, error)

func (*ProposalHashData) UnmarshalCBOR

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

type ProposeParams

type ProposeParams struct {
	To     addr.Address
	Value  abi.TokenAmount
	Method abi.MethodNum
	Params []byte
}

func (*ProposeParams) MarshalCBOR

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

func (*ProposeParams) UnmarshalCBOR

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

type ProposeReturn added in v0.7.0

type ProposeReturn struct {
	// TxnID is the ID of the proposed transaction
	TxnID TxnID
	// Applied indicates if the transaction was applied as opposed to proposed but not applied due to lack of approvals
	Applied bool
	// Code is the exitcode of the transaction, if Applied is false this field should be ignored.
	Code exitcode.ExitCode
	// Ret is the return vale of the transaction, if Applied is false this field should be ignored.
	Ret []byte
}

func (*ProposeReturn) MarshalCBOR added in v0.7.0

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

func (*ProposeReturn) UnmarshalCBOR added in v0.7.0

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

type RemoveSignerParams

type RemoveSignerParams struct {
	Signer   addr.Address
	Decrease bool
}

func (*RemoveSignerParams) MarshalCBOR

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

func (*RemoveSignerParams) UnmarshalCBOR

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

type State

type State struct {
	// Signers may be either public-key or actor ID-addresses. The ID address is canonical, but doesn't exist
	// for a public key that has not yet received a message on chain.
	// If any signer address is a public-key address, it will be resolved to an ID address and persisted
	// in this state when the address is used.
	Signers               []address.Address
	NumApprovalsThreshold uint64
	NextTxnID             TxnID

	// Linear unlock
	InitialBalance abi.TokenAmount
	StartEpoch     abi.ChainEpoch
	UnlockDuration abi.ChainEpoch

	PendingTxns cid.Cid
}

func (*State) AmountLocked

func (st *State) AmountLocked(elapsedEpoch abi.ChainEpoch) abi.TokenAmount

func (*State) MarshalCBOR

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

func (*State) UnmarshalCBOR

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

type SwapSignerParams

type SwapSignerParams struct {
	From addr.Address
	To   addr.Address
}

func (*SwapSignerParams) MarshalCBOR

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

func (*SwapSignerParams) UnmarshalCBOR

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

type Transaction

type Transaction struct {
	To     addr.Address
	Value  abi.TokenAmount
	Method abi.MethodNum
	Params []byte

	// This address at index 0 is the transaction proposer, order of this slice must be preserved.
	Approved []addr.Address
}

func (*Transaction) MarshalCBOR

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

func (*Transaction) UnmarshalCBOR

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

type TxnID

type TxnID int64

func (TxnID) Key

func (t TxnID) Key() string

type TxnIDParams

type TxnIDParams struct {
	ID           TxnID
	ProposalHash []byte
}

func (*TxnIDParams) MarshalCBOR

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

func (*TxnIDParams) UnmarshalCBOR

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

Jump to

Keyboard shortcuts

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