Documentation ¶
Index ¶
- Constants
- func ComputeProposalHash(txn *Transaction, hash func([]byte) [32]byte) ([]byte, error)
- type Actor
- func (a Actor) AddSigner(rt runtime.Runtime, params *AddSignerParams) *abi.EmptyValue
- func (a Actor) Approve(rt runtime.Runtime, params *TxnIDParams) *ApproveReturn
- func (a Actor) Cancel(rt runtime.Runtime, params *TxnIDParams) *abi.EmptyValue
- func (a Actor) ChangeNumApprovalsThreshold(rt runtime.Runtime, params *ChangeNumApprovalsThresholdParams) *abi.EmptyValue
- func (a Actor) Code() cid.Cid
- func (a Actor) Constructor(rt runtime.Runtime, params *ConstructorParams) *abi.EmptyValue
- func (a Actor) Exports() []interface{}
- func (a Actor) LockBalance(rt runtime.Runtime, params *LockBalanceParams) *abi.EmptyValue
- func (a Actor) Propose(rt runtime.Runtime, params *ProposeParams) *ProposeReturn
- func (a Actor) RemoveSigner(rt runtime.Runtime, params *RemoveSignerParams) *abi.EmptyValue
- func (a Actor) State() cbor.Er
- func (a Actor) SwapSigner(rt runtime.Runtime, params *SwapSignerParams) *abi.EmptyValue
- type AddSignerParams
- type ApproveReturn
- type ChangeNumApprovalsThresholdParams
- type ConstructorParams
- type LockBalanceParams
- type ProposalHashData
- type ProposeParams
- type ProposeReturn
- type RemoveSignerParams
- type State
- func (st *State) AmountLocked(elapsedEpoch abi.ChainEpoch) abi.TokenAmount
- func (t *State) MarshalCBOR(w io.Writer) error
- func (st *State) PurgeApprovals(store adt.Store, addr address.Address) error
- func (st *State) SetLocked(startEpoch abi.ChainEpoch, unlockDuration abi.ChainEpoch, ...)
- func (t *State) UnmarshalCBOR(r io.Reader) error
- type StateSummary
- type StringKey
- type SwapSignerParams
- type Transaction
- type TxnID
- type TxnIDParams
Constants ¶
const SignersMax = 256
SignersMax is the maximum number of signers allowed in a multisig. If more are required, please use a combining tree of multisigs.
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) Constructor ¶
func (a Actor) Constructor(rt runtime.Runtime, params *ConstructorParams) *abi.EmptyValue
func (Actor) LockBalance ¶
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) SwapSigner ¶
func (a Actor) SwapSigner(rt runtime.Runtime, params *SwapSignerParams) *abi.EmptyValue
type AddSignerParams ¶
type AddSignerParams = multisig0.AddSignerParams
type AddSignerParams struct { Signer addr.Address Increase bool }
type ApproveReturn ¶
type ApproveReturn = multisig0.ApproveReturn
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 }
type ChangeNumApprovalsThresholdParams ¶
type ChangeNumApprovalsThresholdParams = multisig0.ChangeNumApprovalsThresholdParams
type ChangeNumApprovalsThresholdParams struct { NewThreshold uint64 }
type ConstructorParams ¶
type ConstructorParams struct { Signers []addr.Address NumApprovalsThreshold uint64 UnlockDuration abi.ChainEpoch StartEpoch abi.ChainEpoch }
Changed since v0: - Added StartEpoch
func (*ConstructorParams) MarshalCBOR ¶
func (t *ConstructorParams) MarshalCBOR(w io.Writer) error
func (*ConstructorParams) UnmarshalCBOR ¶
func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) error
type LockBalanceParams ¶
type LockBalanceParams = multisig0.LockBalanceParams
type LockBalanceParams struct { StartEpoch abi.ChainEpoch UnlockDuration abi.ChainEpoch Amount abi.TokenAmount }
type ProposalHashData ¶
type ProposalHashData = multisig0.ProposalHashData
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.
type ProposalHashData struct { Requester addr.Address To addr.Address Value abi.TokenAmount Method abi.MethodNum Params []byte }
type ProposeParams ¶
type ProposeParams = multisig0.ProposeParams
type ProposeParams struct { To addr.Address Value abi.TokenAmount Method abi.MethodNum Params []byte }
type ProposeReturn ¶
type ProposeReturn = multisig0.ProposeReturn
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 }
type RemoveSignerParams ¶
type RemoveSignerParams = multisig0.RemoveSignerParams
type RemoveSignerParams struct { Signer addr.Address Decrease bool }
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 // HAMT[TxnID]Transaction }
func (*State) AmountLocked ¶
func (st *State) AmountLocked(elapsedEpoch abi.ChainEpoch) abi.TokenAmount
func (*State) PurgeApprovals ¶
Iterates all pending transactions and removes an address from each list of approvals, if present. If an approval list becomes empty, the pending transaction is deleted.
func (*State) SetLocked ¶
func (st *State) SetLocked(startEpoch abi.ChainEpoch, unlockDuration abi.ChainEpoch, lockedAmount abi.TokenAmount)
type StateSummary ¶ added in v2.0.2
func CheckStateInvariants ¶ added in v2.0.2
func CheckStateInvariants(st *State, store adt.Store) (*StateSummary, *builtin.MessageAccumulator)
Checks internal invariants of multisig state.
type SwapSignerParams ¶
type SwapSignerParams = multisig0.SwapSignerParams
type SwapSignerParams struct { From addr.Address To addr.Address }
type Transaction ¶
type Transaction = multisig0.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 }
type TxnID ¶
func ParseTxnIDKey ¶ added in v2.0.2
type TxnIDParams ¶
type TxnIDParams = multisig0.TxnIDParams
type TxnIDParams struct { ID TxnID // Optional hash of proposal to ensure an operation can only apply to a // specific proposal. ProposalHash []byte }