Documentation ¶
Index ¶
- Variables
- type Account
- func (a Account) CreateProposal(ctx context.Context, msg *v1.MsgCreateProposal) (*v1.MsgCreateProposalResponse, error)
- func (a Account) ExecuteProposal(ctx context.Context, msg *v1.MsgExecuteProposal) (*v1.MsgExecuteProposalResponse, error)
- func (a *Account) Init(ctx context.Context, msg *v1.MsgInit) (*v1.MsgInitResponse, error)
- func (a Account) QueryConfig(ctx context.Context, _ *v1.QueryConfig) (*v1.QueryConfigResponse, error)
- func (a Account) QueryProposal(ctx context.Context, q *v1.QueryProposal) (*v1.QueryProposalResponse, error)
- func (a Account) QuerySequence(ctx context.Context, _ *v1.QuerySequence) (*v1.QuerySequenceResponse, error)
- func (a *Account) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder)
- func (a *Account) RegisterInitHandler(builder *accountstd.InitBuilder)
- func (a *Account) RegisterQueryHandlers(builder *accountstd.QueryBuilder)
- func (a Account) UpdateConfig(ctx context.Context, msg *v1.MsgUpdateConfig) (*v1.MsgUpdateConfigResponse, error)
- func (a Account) Vote(ctx context.Context, msg *v1.MsgVote) (*v1.MsgVoteResponse, error)
Constants ¶
This section is empty.
Variables ¶
var ( MembersPrefix = collections.NewPrefix(0) SequencePrefix = collections.NewPrefix(1) ConfigPrefix = collections.NewPrefix(2) ProposalsPrefix = collections.NewPrefix(3) VotesPrefix = collections.NewPrefix(4) )
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { Members collections.Map[[]byte, uint64] Sequence collections.Sequence Config collections.Item[v1.Config] Proposals collections.Map[uint64, v1.Proposal] Votes collections.Map[collections.Pair[uint64, []byte], int32] // key: proposalID + voter address // contains filtered or unexported fields }
func NewAccount ¶
func NewAccount(deps accountstd.Dependencies) (*Account, error)
NewAccount returns a new multisig account creator function.
func (Account) CreateProposal ¶
func (a Account) CreateProposal(ctx context.Context, msg *v1.MsgCreateProposal) (*v1.MsgCreateProposalResponse, error)
CreateProposal creates a new proposal. If the proposal contains a voting period it will be used, otherwise the default voting period will be used.
func (Account) ExecuteProposal ¶
func (a Account) ExecuteProposal(ctx context.Context, msg *v1.MsgExecuteProposal) (*v1.MsgExecuteProposalResponse, error)
ExecuteProposal tallies the votes for a proposal and executes it if it passes. If early execution is enabled, it will ignore the voting period and tally the votes without deleting them if the proposal has not passed.
func (*Account) Init ¶
Init initializes the multisig account with the given configuration and members.
func (Account) QueryConfig ¶
func (a Account) QueryConfig(ctx context.Context, _ *v1.QueryConfig) (*v1.QueryConfigResponse, error)
QueryConfig returns the current multisig configuration.
func (Account) QueryProposal ¶
func (a Account) QueryProposal(ctx context.Context, q *v1.QueryProposal) (*v1.QueryProposalResponse, error)
QueryProposal returns a proposal for a given ID, if the proposal hasn't been pruned yet.
func (Account) QuerySequence ¶
func (a Account) QuerySequence(ctx context.Context, _ *v1.QuerySequence) (*v1.QuerySequenceResponse, error)
QuerySequence returns the current sequence number, used for proposal IDs.
func (*Account) RegisterExecuteHandlers ¶
func (a *Account) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder)
RegisterExecuteHandlers implements implementation.Account.
func (*Account) RegisterInitHandler ¶
func (a *Account) RegisterInitHandler(builder *accountstd.InitBuilder)
RegisterInitHandler implements implementation.Account.
func (*Account) RegisterQueryHandlers ¶
func (a *Account) RegisterQueryHandlers(builder *accountstd.QueryBuilder)
RegisterQueryHandlers implements implementation.Account.
func (Account) UpdateConfig ¶
func (a Account) UpdateConfig(ctx context.Context, msg *v1.MsgUpdateConfig) (*v1.MsgUpdateConfigResponse, error)
UpdateConfig updates the configuration of the multisig account.