Documentation ¶
Index ¶
- Variables
- func ProvideAccount() accountstd.DepinjectAccount
- type Account
- func (a Account) IncreaseCounter(ctx context.Context, msg *counterv1.MsgIncreaseCounter) (*counterv1.MsgIncreaseCounterResponse, error)
- func (a Account) Init(ctx context.Context, msg *counterv1.MsgInit) (*counterv1.MsgInitResponse, error)
- func (a Account) QueryCounter(ctx context.Context, _ *counterv1.QueryCounterRequest) (*counterv1.QueryCounterResponse, 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) TestDependencies(ctx context.Context, _ *counterv1.MsgTestDependencies) (*counterv1.MsgTestDependenciesResponse, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( OwnerPrefix = collections.NewPrefix(0) CounterPrefix = collections.NewPrefix(1) TestStateCodecPrefix = collections.NewPrefix(2) )
Functions ¶
func ProvideAccount ¶
func ProvideAccount() accountstd.DepinjectAccount
Types ¶
type Account ¶
type Account struct { // Owner is the address of the account owner. Owner collections.Item[[]byte] // Counter is the counter value. Counter collections.Item[uint64] // TestStateCodec is used to test the binary codec provided by the runtime. // It simply stores the MsgInit. TestStateCodec collections.Item[counterv1.MsgTestDependencies] // contains filtered or unexported fields }
Account implements the Account interface. It is an account who can be used to increase a counter.
func NewAccount ¶
func NewAccount(d accountstd.Dependencies) (Account, error)
NewAccount creates a new account.
func (Account) IncreaseCounter ¶
func (a Account) IncreaseCounter(ctx context.Context, msg *counterv1.MsgIncreaseCounter) (*counterv1.MsgIncreaseCounterResponse, error)
func (Account) QueryCounter ¶
func (a Account) QueryCounter(ctx context.Context, _ *counterv1.QueryCounterRequest) (*counterv1.QueryCounterResponse, error)
func (Account) RegisterExecuteHandlers ¶
func (a Account) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder)
func (Account) RegisterInitHandler ¶
func (a Account) RegisterInitHandler(builder *accountstd.InitBuilder)
func (Account) RegisterQueryHandlers ¶
func (a Account) RegisterQueryHandlers(builder *accountstd.QueryBuilder)
func (Account) TestDependencies ¶
func (a Account) TestDependencies(ctx context.Context, _ *counterv1.MsgTestDependencies) (*counterv1.MsgTestDependenciesResponse, error)
Click to show internal directories.
Click to hide internal directories.