mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-10 18:15:19 +00:00
4d6f6aab3c
* feat: add new msg types for claim rewards from validator vesting accounts * fix: validate owner is validator vesting account * feat: add validator vesting tests for incent claims * address review comments * fix: client command name and example
37 lines
1.1 KiB
Go
37 lines
1.1 KiB
Go
package rest
|
|
|
|
import (
|
|
"github.com/gorilla/mux"
|
|
|
|
"github.com/cosmos/cosmos-sdk/client/context"
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
"github.com/cosmos/cosmos-sdk/types/rest"
|
|
)
|
|
|
|
// REST variable names
|
|
// nolint
|
|
const (
|
|
RestDenom = "denom"
|
|
)
|
|
|
|
// RegisterRoutes registers incentive-related REST handlers to a router
|
|
func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router) {
|
|
registerQueryRoutes(cliCtx, r)
|
|
registerTxRoutes(cliCtx, r)
|
|
}
|
|
|
|
// PostClaimReq defines the properties of claim transaction's request body.
|
|
type PostClaimReq struct {
|
|
BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
|
|
Sender sdk.AccAddress `json:"sender" yaml:"sender"`
|
|
MultiplierName string `json:"multiplier_name" yaml:"multiplier_name"`
|
|
}
|
|
|
|
// PostClaimReq defines the properties of claim transaction's request body.
|
|
type PostClaimVVestingReq struct {
|
|
BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
|
|
Sender sdk.AccAddress `json:"sender" yaml:"sender"`
|
|
Receiver sdk.AccAddress `json:"receiver" yaml:"receiver"`
|
|
MultiplierName string `json:"multiplier_name" yaml:"multiplier_name"`
|
|
}
|