multisig

package
v0.9.15 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: Apache-2.0, MIT Imports: 16 Imported by: 26

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 runtime.Runtime, params *AddSignerParams) *abi.EmptyValue

func (Actor) Approve

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

func (Actor) Cancel

func (a Actor) Cancel(rt runtime.Runtime, params *TxnIDParams) *abi.EmptyValue

func (Actor) ChangeNumApprovalsThreshold

func (a Actor) ChangeNumApprovalsThreshold(rt runtime.Runtime, params *ChangeNumApprovalsThresholdParams) *abi.EmptyValue

func (Actor) Code added in v0.9.12

func (a Actor) Code() cid.Cid

func (Actor) Constructor

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

func (Actor) Exports

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

func (Actor) LockBalance added in v0.9.9

func (a Actor) LockBalance(rt runtime.Runtime, params *LockBalanceParams) *abi.EmptyValue

func (Actor) Propose

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

func (Actor) RemoveSigner

func (a Actor) RemoveSigner(rt runtime.Runtime, params *RemoveSignerParams) *abi.EmptyValue

func (Actor) State added in v0.9.12

func (a Actor) State() cbor.Er

func (Actor) SwapSigner

func (a Actor) SwapSigner(rt runtime.Runtime, params *SwapSignerParams) *abi.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 LockBalanceParams added in v0.9.9

type LockBalanceParams struct {
	StartEpoch     abi.ChainEpoch
	UnlockDuration abi.ChainEpoch
	Amount         abi.TokenAmount
}

func (*LockBalanceParams) MarshalCBOR added in v0.9.9

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

func (*LockBalanceParams) UnmarshalCBOR added in v0.9.9

func (t *LockBalanceParams) 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) SetLocked added in v0.9.9

func (st *State) SetLocked(startEpoch abi.ChainEpoch, unlockDuration abi.ChainEpoch, lockedAmount abi.TokenAmount)

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
	// Optional hash of proposal to ensure an operation can only apply to a
	// specific proposal.
	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