ibc-transfer: enable transfer parameter (#6607)
* ibc-transfer: enable transfer parameter * param_test.go * update tests and types * gRPC test * relay logic and spec update * fix tests * unused param
This commit is contained in:
parent
f3c6ed61b4
commit
0e3f87313e
|
@ -29,6 +29,8 @@ service Query {
|
|||
rpc SupplyOf(QuerySupplyOfRequest) returns (QuerySupplyOfResponse) {
|
||||
option (google.api.http).get = "/cosmos/bank/v1beta1/supply/{denom}";
|
||||
}
|
||||
|
||||
// TODO: Params
|
||||
}
|
||||
|
||||
// QueryBalanceRequest is the request type for the Query/Balance RPC method.
|
||||
|
|
|
@ -16,4 +16,7 @@ message GenesisState{
|
|||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "yaml:\"denom_traces\""
|
||||
];
|
||||
Params params = 3 [
|
||||
(gogoproto.nullable) = false
|
||||
];
|
||||
}
|
||||
|
|
|
@ -19,6 +19,11 @@ service Query {
|
|||
rpc DenomTraces(QueryDenomTracesRequest) returns (QueryDenomTracesResponse) {
|
||||
option (google.api.http).get = "/ibc_transfer/v1beta1/denom_traces";
|
||||
}
|
||||
|
||||
// Params queries all parameters of the ibc-transfer module.
|
||||
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
||||
option (google.api.http).get = "/ibc_transfer/v1beta1/params";
|
||||
}
|
||||
}
|
||||
|
||||
// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC method
|
||||
|
@ -49,3 +54,12 @@ message QueryDenomTracesResponse {
|
|||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
// QueryParamsRequest is the request type for the Query/Params RPC method.
|
||||
message QueryParamsRequest{}
|
||||
|
||||
// QueryParamsResponse is the response type for the Query/Params RPC method.
|
||||
message QueryParamsResponse{
|
||||
// params defines the parameters of the module.
|
||||
Params params = 1;
|
||||
}
|
||||
|
|
|
@ -60,3 +60,13 @@ message DenomTrace {
|
|||
// base denomination of the relayed fungible token.
|
||||
string base_denom = 2;
|
||||
}
|
||||
|
||||
// Params defines the set of IBC transfer parameters.
|
||||
// NOTE: To prevent a single token from being transferred, set the TransfersEnabled parameter to
|
||||
// true and then set the bank module's SendEnabled parameter for the denomination to false.
|
||||
message Params {
|
||||
// transfers_enabled enables or disables all cross-chain token transfers from/to this chain.
|
||||
bool transfers_enabled = 1 [
|
||||
(gogoproto.moretags) = "yaml:\"transfers_enabled\""
|
||||
];
|
||||
}
|
||||
|
|
|
@ -263,7 +263,7 @@ func NewSimApp(
|
|||
|
||||
// Create Transfer Keepers
|
||||
app.TransferKeeper = ibctransferkeeper.NewKeeper(
|
||||
appCodec, keys[ibctransfertypes.StoreKey],
|
||||
appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName),
|
||||
app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper,
|
||||
app.AccountKeeper, app.BankKeeper, scopedTransferKeeper,
|
||||
)
|
||||
|
@ -533,6 +533,7 @@ func initParamsKeeper(appCodec codec.BinaryMarshaler, legacyAmino *codec.LegacyA
|
|||
paramsKeeper.Subspace(slashingtypes.ModuleName)
|
||||
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable())
|
||||
paramsKeeper.Subspace(crisistypes.ModuleName)
|
||||
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
|
||||
|
||||
return paramsKeeper
|
||||
}
|
||||
|
|
|
@ -85,3 +85,30 @@ func GetCmdQueryDenomTraces() *cobra.Command {
|
|||
|
||||
return cmd
|
||||
}
|
||||
|
||||
// QueryParamsCmd returns the command handler for ibc-transfer parameter querying.
|
||||
func QueryParamsCmd() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "params",
|
||||
Short: "Query the current ibc-transfer parameters",
|
||||
Long: "Query the current ibc-transfer parameters",
|
||||
Args: cobra.NoArgs,
|
||||
Example: fmt.Sprintf("%s query ibc-transfer params", version.AppName),
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
clientCtx := client.GetClientContextFromCmd(cmd)
|
||||
clientCtx, err := client.ReadQueryCommandFlags(clientCtx, cmd.Flags())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
queryClient := types.NewQueryClient(clientCtx)
|
||||
|
||||
res, _ := queryClient.Params(context.Background(), &types.QueryParamsRequest{})
|
||||
return clientCtx.PrintOutput(res.Params)
|
||||
},
|
||||
}
|
||||
|
||||
flags.AddQueryFlagsToCmd(cmd)
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@ func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState) {
|
|||
}
|
||||
}
|
||||
|
||||
k.SetParams(ctx, state.Params)
|
||||
|
||||
// check if the module account exists
|
||||
moduleAcc := k.GetTransferAccount(ctx)
|
||||
if moduleAcc == nil {
|
||||
|
@ -38,5 +40,6 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState {
|
|||
return &types.GenesisState{
|
||||
PortId: k.GetPort(ctx),
|
||||
DenomTraces: k.GetAllDenomTraces(ctx),
|
||||
Params: k.GetParams(ctx),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,3 +71,13 @@ func (q Keeper) DenomTraces(c context.Context, req *types.QueryDenomTracesReques
|
|||
Pagination: pageRes,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Params implements the Query/Params gRPC method
|
||||
func (q Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
|
||||
ctx := sdk.UnwrapSDKContext(c)
|
||||
params := q.GetParams(ctx)
|
||||
|
||||
return &types.QueryParamsResponse{
|
||||
Params: ¶ms,
|
||||
}, nil
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"github.com/cosmos/cosmos-sdk/x/ibc-transfer/types"
|
||||
)
|
||||
|
||||
func (suite *KeeperTestSuite) TestQueryConnection() {
|
||||
func (suite *KeeperTestSuite) TestQueryDenomTrace() {
|
||||
var (
|
||||
req *types.QueryDenomTraceRequest
|
||||
expTrace types.DenomTrace
|
||||
|
@ -74,7 +74,7 @@ func (suite *KeeperTestSuite) TestQueryConnection() {
|
|||
}
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) TestQueryConnections() {
|
||||
func (suite *KeeperTestSuite) TestQueryDenomTraces() {
|
||||
var (
|
||||
req *types.QueryDenomTracesRequest
|
||||
expTraces = types.Traces(nil)
|
||||
|
@ -133,3 +133,10 @@ func (suite *KeeperTestSuite) TestQueryConnections() {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) TestQueryParams() {
|
||||
ctx := sdk.WrapSDKContext(suite.chainA.GetContext())
|
||||
expParams := types.DefaultParams()
|
||||
res, _ := suite.queryClient.Params(ctx, &types.QueryParamsRequest{})
|
||||
suite.Require().Equal(&expParams, res.Params)
|
||||
}
|
||||
|
|
|
@ -17,12 +17,14 @@ import (
|
|||
channelexported "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/exported"
|
||||
channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types"
|
||||
host "github.com/cosmos/cosmos-sdk/x/ibc/24-host"
|
||||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
)
|
||||
|
||||
// Keeper defines the IBC fungible transfer keeper
|
||||
type Keeper struct {
|
||||
storeKey sdk.StoreKey
|
||||
cdc codec.BinaryMarshaler
|
||||
paramSpace paramtypes.Subspace
|
||||
|
||||
channelKeeper types.ChannelKeeper
|
||||
portKeeper types.PortKeeper
|
||||
|
@ -33,7 +35,7 @@ type Keeper struct {
|
|||
|
||||
// NewKeeper creates a new IBC transfer Keeper instance
|
||||
func NewKeeper(
|
||||
cdc codec.BinaryMarshaler, key sdk.StoreKey,
|
||||
cdc codec.BinaryMarshaler, key sdk.StoreKey, paramSpace paramtypes.Subspace,
|
||||
channelKeeper types.ChannelKeeper, portKeeper types.PortKeeper,
|
||||
authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, scopedKeeper capabilitykeeper.ScopedKeeper,
|
||||
) Keeper {
|
||||
|
@ -43,9 +45,15 @@ func NewKeeper(
|
|||
panic("the IBC transfer module account has not been set")
|
||||
}
|
||||
|
||||
// set KeyTable if it has not already been set
|
||||
if !paramSpace.HasKeyTable() {
|
||||
paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable())
|
||||
}
|
||||
|
||||
return Keeper{
|
||||
storeKey: key,
|
||||
cdc: cdc,
|
||||
storeKey: key,
|
||||
paramSpace: paramSpace,
|
||||
channelKeeper: channelKeeper,
|
||||
portKeeper: portKeeper,
|
||||
authKeeper: authKeeper,
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package keeper
|
||||
|
||||
import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/ibc-transfer/types"
|
||||
)
|
||||
|
||||
// GetTransfersEnabled retrieves the transfers enabled boolean from the paramstore
|
||||
func (k Keeper) GetTransfersEnabled(ctx sdk.Context) bool {
|
||||
var res bool
|
||||
k.paramSpace.Get(ctx, types.KeyTransfersEnabled, &res)
|
||||
return res
|
||||
}
|
||||
|
||||
// GetParams returns the total set of ibc-transfer parameters.
|
||||
func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
|
||||
return types.NewParams(k.GetTransfersEnabled(ctx))
|
||||
}
|
||||
|
||||
// SetParams sets the total set of ibc-transfer parameters.
|
||||
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
|
||||
k.paramSpace.SetParamSet(ctx, ¶ms)
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package keeper_test
|
||||
|
||||
import "github.com/cosmos/cosmos-sdk/x/ibc-transfer/types"
|
||||
|
||||
func (suite *KeeperTestSuite) TestParams() {
|
||||
expParams := types.DefaultParams()
|
||||
|
||||
params := suite.chainA.App.TransferKeeper.GetParams(suite.chainA.GetContext())
|
||||
suite.Require().Equal(expParams, params)
|
||||
|
||||
expParams.TransfersEnabled = false
|
||||
suite.chainA.App.TransferKeeper.SetParams(suite.chainA.GetContext(), expParams)
|
||||
params = suite.chainA.App.TransferKeeper.GetParams(suite.chainA.GetContext())
|
||||
suite.Require().Equal(expParams, params)
|
||||
}
|
|
@ -52,6 +52,11 @@ func (k Keeper) SendTransfer(
|
|||
timeoutHeight,
|
||||
timeoutTimestamp uint64,
|
||||
) error {
|
||||
|
||||
if !k.GetTransfersEnabled(ctx) {
|
||||
return types.ErrTransfersDisabled
|
||||
}
|
||||
|
||||
sourceChannelEnd, found := k.channelKeeper.GetChannel(ctx, sourcePort, sourceChannel)
|
||||
if !found {
|
||||
return sdkerrors.Wrapf(channeltypes.ErrChannelNotFound, "port ID (%s) channel ID (%s)", sourcePort, sourceChannel)
|
||||
|
@ -152,6 +157,10 @@ func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, data t
|
|||
return err
|
||||
}
|
||||
|
||||
if !k.GetTransfersEnabled(ctx) {
|
||||
return types.ErrTransfersDisabled
|
||||
}
|
||||
|
||||
// decode the receiver address
|
||||
receiver, err := sdk.AccAddressFromBech32(data.Receiver)
|
||||
if err != nil {
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<!--
|
||||
order: 6
|
||||
-->
|
||||
|
||||
# Parameters
|
||||
|
||||
The ibc-transfer module contains the following parameters:
|
||||
|
||||
| Key | Type | Default Value |
|
||||
|--------------------|------|---------------|
|
||||
| `TransfersEnabled` | bool | `true` |
|
||||
|
||||
## TransfersEnabled
|
||||
|
||||
The transfers enabled parameter controls send and receive cross-chain transfer capabilities for all
|
||||
fungible tokens.
|
||||
|
||||
To prevent a single token from being transferred, set the `TransfersEnabled` parameter to `true` and
|
||||
then set the bank module's [`SendEnabled` parameter](./../../bank/spec/05_params.md#sendenabled) for
|
||||
the denomination to `false`.
|
|
@ -20,3 +20,4 @@ For the general specification please refer to the [ICS20 Specification](https://
|
|||
3. **[State Transitions](03_state_transitions.md)**
|
||||
4. **[Messages](04_messages.md)**
|
||||
5. **[Events](05_events.md)**
|
||||
6. **[Parameters](06_params.md)**
|
||||
|
|
|
@ -11,4 +11,5 @@ var (
|
|||
ErrInvalidVersion = sdkerrors.Register(ModuleName, 4, "invalid ICS20 version")
|
||||
ErrInvalidAmount = sdkerrors.Register(ModuleName, 5, "invalid token amount")
|
||||
ErrTraceNotFound = sdkerrors.Register(ModuleName, 6, "denomination trace not found")
|
||||
ErrTransfersDisabled = sdkerrors.Register(ModuleName, 7, "fungible token transfers to/from this chain are disabled")
|
||||
)
|
||||
|
|
|
@ -5,10 +5,11 @@ import (
|
|||
)
|
||||
|
||||
// NewGenesisState creates a new ibc-transfer GenesisState instance.
|
||||
func NewGenesisState(portID string, denomTraces Traces) *GenesisState {
|
||||
func NewGenesisState(portID string, denomTraces Traces, params Params) *GenesisState {
|
||||
return &GenesisState{
|
||||
PortId: portID,
|
||||
DenomTraces: denomTraces,
|
||||
Params: params,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,6 +18,7 @@ func DefaultGenesisState() *GenesisState {
|
|||
return &GenesisState{
|
||||
PortId: PortID,
|
||||
DenomTraces: Traces{},
|
||||
Params: DefaultParams(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,5 +28,8 @@ func (gs GenesisState) Validate() error {
|
|||
if err := host.PortIdentifierValidator(gs.PortId); err != nil {
|
||||
return err
|
||||
}
|
||||
return gs.DenomTraces.Validate()
|
||||
if err := gs.DenomTraces.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
return gs.Params.Validate()
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|||
type GenesisState struct {
|
||||
PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"`
|
||||
DenomTraces Traces `protobuf:"bytes,2,rep,name=denom_traces,json=denomTraces,proto3,castrepeated=Traces" json:"denom_traces" yaml:"denom_traces"`
|
||||
Params Params `protobuf:"bytes,3,opt,name=params,proto3" json:"params"`
|
||||
}
|
||||
|
||||
func (m *GenesisState) Reset() { *m = GenesisState{} }
|
||||
|
@ -76,6 +77,13 @@ func (m *GenesisState) GetDenomTraces() Traces {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (m *GenesisState) GetParams() Params {
|
||||
if m != nil {
|
||||
return m.Params
|
||||
}
|
||||
return Params{}
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*GenesisState)(nil), "ibc.transfer.GenesisState")
|
||||
}
|
||||
|
@ -83,24 +91,26 @@ func init() {
|
|||
func init() { proto.RegisterFile("ibc/transfer/genesis.proto", fileDescriptor_c13b8463155e05c2) }
|
||||
|
||||
var fileDescriptor_c13b8463155e05c2 = []byte{
|
||||
// 265 bytes of a gzipped FileDescriptorProto
|
||||
// 296 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xca, 0x4c, 0x4a, 0xd6,
|
||||
0x2f, 0x29, 0x4a, 0xcc, 0x2b, 0x4e, 0x4b, 0x2d, 0xd2, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c,
|
||||
0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xc9, 0x4c, 0x4a, 0xd6, 0x83, 0xc9, 0x49, 0x89,
|
||||
0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x25, 0xf4, 0x41, 0x2c, 0x88, 0x1a, 0x29, 0x69, 0x14, 0xfd, 0x30,
|
||||
0x06, 0x44, 0x52, 0x69, 0x3e, 0x23, 0x17, 0x8f, 0x3b, 0xc4, 0xc8, 0xe0, 0x92, 0xc4, 0x92, 0x54,
|
||||
0x06, 0x44, 0x52, 0xe9, 0x32, 0x23, 0x17, 0x8f, 0x3b, 0xc4, 0xc8, 0xe0, 0x92, 0xc4, 0x92, 0x54,
|
||||
0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
||||
0xff, 0xcf, 0x4f, 0x0f, 0xb0, 0x54, 0x01, 0x00, 0x00,
|
||||
0xb8, 0x53, 0xe0, 0x5a, 0x8a, 0x85, 0x8c, 0xb8, 0xd8, 0x0a, 0x12, 0x8b, 0x12, 0x73, 0x8b, 0x25,
|
||||
0x98, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0x44, 0x50, 0x4d, 0x0f, 0x00, 0xcb, 0x39, 0xb1, 0x80, 0x4c,
|
||||
0x0e, 0x82, 0xaa, 0x74, 0xf2, 0x3e, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f,
|
||||
0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28,
|
||||
0xc3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xe4, 0xfc, 0xe2, 0xdc,
|
||||
0xfc, 0x62, 0x28, 0xa5, 0x5b, 0x9c, 0x92, 0xad, 0x5f, 0xa1, 0x9f, 0x99, 0x94, 0xac, 0x8b, 0x08,
|
||||
0xab, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x48, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff,
|
||||
0xd5, 0x5e, 0x5e, 0x5a, 0x88, 0x01, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *GenesisState) Marshal() (dAtA []byte, err error) {
|
||||
|
@ -123,6 +133,16 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
{
|
||||
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintGenesis(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
if len(m.DenomTraces) > 0 {
|
||||
for iNdEx := len(m.DenomTraces) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
|
@ -174,6 +194,8 @@ func (m *GenesisState) Size() (n int) {
|
|||
n += 1 + l + sovGenesis(uint64(l))
|
||||
}
|
||||
}
|
||||
l = m.Params.Size()
|
||||
n += 1 + l + sovGenesis(uint64(l))
|
||||
return n
|
||||
}
|
||||
|
||||
|
@ -278,6 +300,39 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error {
|
|||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenesis
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthGenesis
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthGenesis
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipGenesis(dAtA[iNdEx:])
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
package types
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultTransfersEnabled enabled
|
||||
DefaultTransfersEnabled = true
|
||||
)
|
||||
|
||||
// KeyTransfersEnabled is store's key for TransfersEnabled Params
|
||||
var KeyTransfersEnabled = []byte("TransfersEnabled")
|
||||
|
||||
// ParamKeyTable type declaration for parameters
|
||||
func ParamKeyTable() paramtypes.KeyTable {
|
||||
return paramtypes.NewKeyTable().RegisterParamSet(&Params{})
|
||||
}
|
||||
|
||||
// NewParams creates a new parameter configuration for the ibc transfer module
|
||||
func NewParams(enableTransfers bool) Params {
|
||||
return Params{
|
||||
TransfersEnabled: enableTransfers,
|
||||
}
|
||||
}
|
||||
|
||||
// DefaultParams is the default parameter configuration for the ibc-transfer module
|
||||
func DefaultParams() Params {
|
||||
return NewParams(DefaultTransfersEnabled)
|
||||
}
|
||||
|
||||
// Validate all ibc-transfer module parameters
|
||||
func (p Params) Validate() error {
|
||||
return validateTransfersEnabled(p.TransfersEnabled)
|
||||
}
|
||||
|
||||
// ParamSetPairs implements params.ParamSet
|
||||
func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
|
||||
return paramtypes.ParamSetPairs{
|
||||
paramtypes.NewParamSetPair(KeyTransfersEnabled, p.TransfersEnabled, validateTransfersEnabled),
|
||||
}
|
||||
}
|
||||
|
||||
func validateTransfersEnabled(i interface{}) error {
|
||||
_, ok := i.(bool)
|
||||
if !ok {
|
||||
return fmt.Errorf("invalid parameter type: %T", i)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package types
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestValidateParams(t *testing.T) {
|
||||
params := DefaultParams()
|
||||
require.NoError(t, params.Validate())
|
||||
}
|
|
@ -223,46 +223,134 @@ func (m *QueryDenomTracesResponse) GetPagination() *query.PageResponse {
|
|||
return nil
|
||||
}
|
||||
|
||||
// QueryParamsRequest is the request type for the Query/Params RPC method.
|
||||
type QueryParamsRequest struct {
|
||||
}
|
||||
|
||||
func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} }
|
||||
func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryParamsRequest) ProtoMessage() {}
|
||||
func (*QueryParamsRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_26b3e8b4e9dff1c1, []int{4}
|
||||
}
|
||||
func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *QueryParamsRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_QueryParamsRequest.Merge(m, src)
|
||||
}
|
||||
func (m *QueryParamsRequest) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *QueryParamsRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo
|
||||
|
||||
// QueryParamsResponse is the response type for the Query/Params RPC method.
|
||||
type QueryParamsResponse struct {
|
||||
// params defines the parameters of the module.
|
||||
Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
|
||||
}
|
||||
|
||||
func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} }
|
||||
func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryParamsResponse) ProtoMessage() {}
|
||||
func (*QueryParamsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_26b3e8b4e9dff1c1, []int{5}
|
||||
}
|
||||
func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *QueryParamsResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_QueryParamsResponse.Merge(m, src)
|
||||
}
|
||||
func (m *QueryParamsResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *QueryParamsResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *QueryParamsResponse) GetParams() *Params {
|
||||
if m != nil {
|
||||
return m.Params
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*QueryDenomTraceRequest)(nil), "ibc.transfer.QueryDenomTraceRequest")
|
||||
proto.RegisterType((*QueryDenomTraceResponse)(nil), "ibc.transfer.QueryDenomTraceResponse")
|
||||
proto.RegisterType((*QueryDenomTracesRequest)(nil), "ibc.transfer.QueryDenomTracesRequest")
|
||||
proto.RegisterType((*QueryDenomTracesResponse)(nil), "ibc.transfer.QueryDenomTracesResponse")
|
||||
proto.RegisterType((*QueryParamsRequest)(nil), "ibc.transfer.QueryParamsRequest")
|
||||
proto.RegisterType((*QueryParamsResponse)(nil), "ibc.transfer.QueryParamsResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("ibc/transfer/query.proto", fileDescriptor_26b3e8b4e9dff1c1) }
|
||||
|
||||
var fileDescriptor_26b3e8b4e9dff1c1 = []byte{
|
||||
// 452 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0xbf, 0x8f, 0xd3, 0x30,
|
||||
0x14, 0xc7, 0xe3, 0x02, 0x27, 0xe1, 0x9c, 0x18, 0x2c, 0x04, 0x51, 0x40, 0xb9, 0x53, 0x74, 0x1c,
|
||||
0x50, 0xa8, 0xad, 0x94, 0x89, 0xb5, 0x42, 0x30, 0x74, 0x81, 0xaa, 0x13, 0x4b, 0xe5, 0xa4, 0x26,
|
||||
0x8d, 0xa0, 0x71, 0x1a, 0xbb, 0x88, 0x0a, 0xb1, 0x30, 0x31, 0x30, 0x20, 0xf1, 0x17, 0xb0, 0x32,
|
||||
0xf1, 0x67, 0x74, 0xac, 0xc4, 0xc2, 0x04, 0xa8, 0xe5, 0x0f, 0x41, 0xb1, 0x9d, 0x26, 0x55, 0x4f,
|
||||
0xcd, 0x94, 0xa7, 0xbc, 0x5f, 0x9f, 0xf7, 0xf5, 0x7b, 0xd0, 0x49, 0xc2, 0x88, 0xc8, 0x9c, 0xa6,
|
||||
0xe2, 0x15, 0xcb, 0xc9, 0x6c, 0xce, 0xf2, 0x05, 0xce, 0x72, 0x2e, 0x39, 0x3a, 0x4e, 0xc2, 0x08,
|
||||
0x97, 0x1e, 0xf7, 0x7a, 0xcc, 0x63, 0xae, 0x1c, 0xa4, 0xb0, 0x74, 0x8c, 0xdb, 0x8e, 0xb8, 0x98,
|
||||
0x72, 0x41, 0x42, 0x2a, 0x98, 0x4e, 0x26, 0x6f, 0x83, 0x90, 0x49, 0x1a, 0x90, 0x8c, 0xc6, 0x49,
|
||||
0x4a, 0x65, 0xc2, 0x53, 0x13, 0x7b, 0x6b, 0xa7, 0x53, 0x69, 0x18, 0xe7, 0xed, 0x98, 0xf3, 0xf8,
|
||||
0x0d, 0x23, 0x34, 0x4b, 0x08, 0x4d, 0x53, 0x2e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 0x5f, 0x5b, 0x0f, 0xd0, 0x7d, 0x92, 0x84, 0xd1, 0x68, 0xbb, 0x43,
|
||||
0xe5, 0xaa, 0xd5, 0x75, 0x21, 0xef, 0x8b, 0x1d, 0xf8, 0x80, 0x3e, 0x01, 0x68, 0xd7, 0x64, 0x44,
|
||||
0x87, 0x3b, 0x95, 0x4f, 0xe9, 0x9e, 0x37, 0x85, 0x19, 0xa2, 0xb6, 0x22, 0x3a, 0x43, 0x7e, 0x33,
|
||||
0x51, 0xaf, 0xbf, 0x5c, 0x7b, 0x60, 0xb5, 0xf6, 0xc0, 0xdf, 0xb5, 0x07, 0xbe, 0x6c, 0x3c, 0x6b,
|
||||
0xb5, 0xf1, 0xac, 0x5f, 0x1b, 0xcf, 0x7a, 0x19, 0xc4, 0x89, 0x9c, 0xcc, 0x43, 0x1c, 0xf1, 0x29,
|
||||
0x31, 0x97, 0xa4, 0x3f, 0x1d, 0x31, 0x7e, 0x4d, 0xde, 0x15, 0xb5, 0x3b, 0xd5, 0xc5, 0x2c, 0x32,
|
||||
0x26, 0xc2, 0x23, 0x75, 0x11, 0x8f, 0xfe, 0x07, 0x00, 0x00, 0xff, 0xff, 0x5b, 0xa6, 0x29, 0xd0,
|
||||
0xb8, 0x03, 0x00, 0x00,
|
||||
// 512 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x94, 0x31, 0x6f, 0xd3, 0x40,
|
||||
0x14, 0xc7, 0x73, 0x2d, 0x44, 0xe2, 0xa5, 0x62, 0x38, 0x22, 0xb0, 0x4c, 0xe5, 0x06, 0x2b, 0x14,
|
||||
0x28, 0xed, 0x9d, 0x52, 0x26, 0xd6, 0x82, 0x60, 0xe8, 0x52, 0xa2, 0x4e, 0x2c, 0xd5, 0xd9, 0x39,
|
||||
0x1c, 0x0b, 0xe2, 0x73, 0x7d, 0x17, 0x44, 0x85, 0x58, 0x98, 0x18, 0x18, 0x90, 0x90, 0xf8, 0x10,
|
||||
0x4c, 0x7c, 0x8c, 0x8e, 0x95, 0x58, 0x98, 0x00, 0x25, 0x7c, 0x10, 0xe4, 0xbb, 0x73, 0x6d, 0x2b,
|
||||
0x51, 0x3c, 0xe5, 0x74, 0xef, 0xff, 0xde, 0xfb, 0xbd, 0xff, 0xbd, 0x18, 0x9c, 0x38, 0x08, 0xa9,
|
||||
0xca, 0x58, 0x22, 0x5f, 0xf1, 0x8c, 0x9e, 0x4e, 0x79, 0x76, 0x46, 0xd2, 0x4c, 0x28, 0x81, 0x37,
|
||||
0xe2, 0x20, 0x24, 0x45, 0xc4, 0xed, 0x46, 0x22, 0x12, 0x3a, 0x40, 0xf3, 0x93, 0xd1, 0xb8, 0x3b,
|
||||
0xa1, 0x90, 0x13, 0x21, 0x69, 0xc0, 0x24, 0x37, 0xc9, 0xf4, 0xed, 0x20, 0xe0, 0x8a, 0x0d, 0x68,
|
||||
0xca, 0xa2, 0x38, 0x61, 0x2a, 0x16, 0x89, 0xd5, 0xde, 0xae, 0x75, 0x2a, 0x0e, 0x36, 0xb8, 0x19,
|
||||
0x09, 0x11, 0xbd, 0xe1, 0x94, 0xa5, 0x31, 0x65, 0x49, 0x22, 0x94, 0xce, 0x94, 0x26, 0xea, 0xef,
|
||||
0xc2, 0xcd, 0x17, 0x79, 0xf1, 0xa7, 0x3c, 0x11, 0x93, 0xe3, 0x8c, 0x85, 0x7c, 0xc8, 0x4f, 0xa7,
|
||||
0x5c, 0x2a, 0x8c, 0xe1, 0xca, 0x98, 0xc9, 0xb1, 0x83, 0x7a, 0xe8, 0xfe, 0xb5, 0xa1, 0x3e, 0xfb,
|
||||
0xc7, 0x70, 0x6b, 0x41, 0x2d, 0x53, 0x91, 0x48, 0x8e, 0x1f, 0x43, 0x67, 0x94, 0xdf, 0x9e, 0xa8,
|
||||
0xfc, 0x5a, 0x67, 0x75, 0xf6, 0x1d, 0x52, 0x9d, 0x94, 0x54, 0xd2, 0x60, 0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 0x76, 0x34, 0x51, 0x1f, 0xfb, 0xcd, 0x44,
|
||||
0x58, 0x42, 0xdb, 0xb8, 0x86, 0x7b, 0x4b, 0xaa, 0xd7, 0x1e, 0xc5, 0xbd, 0xb3, 0x42, 0x61, 0x5b,
|
||||
0xf7, 0x75, 0x6b, 0x0f, 0x6f, 0x2e, 0x6f, 0x6d, 0x1e, 0xe6, 0xe0, 0xf0, 0x7c, 0xe6, 0xa1, 0x8b,
|
||||
0x99, 0x87, 0xfe, 0xce, 0x3c, 0xf4, 0x65, 0xee, 0xb5, 0x2e, 0xe6, 0x5e, 0xeb, 0xd7, 0xdc, 0x6b,
|
||||
0xbd, 0x1c, 0x44, 0xb1, 0x1a, 0x4f, 0x03, 0x12, 0x8a, 0x09, 0xb5, 0x5f, 0x06, 0xf3, 0xb3, 0x27,
|
||||
0x47, 0xaf, 0xe9, 0xbb, 0xbc, 0xea, 0x5e, 0xf9, 0x05, 0x38, 0x4b, 0xb9, 0x0c, 0xda, 0xfa, 0x1f,
|
||||
0xfe, 0xe8, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x53, 0x09, 0x7d, 0xcb, 0x88, 0x04, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
|
@ -281,6 +369,8 @@ type QueryClient interface {
|
|||
DenomTrace(ctx context.Context, in *QueryDenomTraceRequest, opts ...grpc.CallOption) (*QueryDenomTraceResponse, error)
|
||||
// DenomTraces queries all denomination traces.
|
||||
DenomTraces(ctx context.Context, in *QueryDenomTracesRequest, opts ...grpc.CallOption) (*QueryDenomTracesResponse, error)
|
||||
// Params queries all parameters of the ibc-transfer module.
|
||||
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
||||
}
|
||||
|
||||
type queryClient struct {
|
||||
|
@ -309,12 +399,23 @@ func (c *queryClient) DenomTraces(ctx context.Context, in *QueryDenomTracesReque
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
|
||||
out := new(QueryParamsResponse)
|
||||
err := c.cc.Invoke(ctx, "/ibc.transfer.Query/Params", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// QueryServer is the server API for Query service.
|
||||
type QueryServer interface {
|
||||
// DenomTrace queries a denomination trace information.
|
||||
DenomTrace(context.Context, *QueryDenomTraceRequest) (*QueryDenomTraceResponse, error)
|
||||
// DenomTraces queries all denomination traces.
|
||||
DenomTraces(context.Context, *QueryDenomTracesRequest) (*QueryDenomTracesResponse, error)
|
||||
// Params queries all parameters of the ibc-transfer module.
|
||||
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedQueryServer can be embedded to have forward compatible implementations.
|
||||
|
@ -327,6 +428,9 @@ func (*UnimplementedQueryServer) DenomTrace(ctx context.Context, req *QueryDenom
|
|||
func (*UnimplementedQueryServer) DenomTraces(ctx context.Context, req *QueryDenomTracesRequest) (*QueryDenomTracesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DenomTraces not implemented")
|
||||
}
|
||||
func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
|
||||
}
|
||||
|
||||
func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
|
||||
s.RegisterService(&_Query_serviceDesc, srv)
|
||||
|
@ -368,6 +472,24 @@ func _Query_DenomTraces_Handler(srv interface{}, ctx context.Context, dec func(i
|
|||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QueryParamsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(QueryServer).Params(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ibc.transfer.Query/Params",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Query_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "ibc.transfer.Query",
|
||||
HandlerType: (*QueryServer)(nil),
|
||||
|
@ -380,6 +502,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{
|
|||
MethodName: "DenomTraces",
|
||||
Handler: _Query_DenomTraces_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Params",
|
||||
Handler: _Query_Params_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "ibc/transfer/query.proto",
|
||||
|
@ -534,6 +660,64 @@ func (m *QueryDenomTracesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error
|
|||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Params != nil {
|
||||
{
|
||||
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintQuery(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovQuery(v)
|
||||
base := offset
|
||||
|
@ -603,6 +787,28 @@ func (m *QueryDenomTracesResponse) Size() (n int) {
|
|||
return n
|
||||
}
|
||||
|
||||
func (m *QueryParamsRequest) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *QueryParamsResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.Params != nil {
|
||||
l = m.Params.Size()
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovQuery(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
|
@ -995,6 +1201,148 @@ func (m *QueryDenomTracesResponse) Unmarshal(dAtA []byte) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipQuery(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if (iNdEx + skippy) < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Params == nil {
|
||||
m.Params = &Params{}
|
||||
}
|
||||
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipQuery(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if (iNdEx + skippy) < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipQuery(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
|
|
@ -121,6 +121,24 @@ func local_request_Query_DenomTraces_0(ctx context.Context, marshaler runtime.Ma
|
|||
|
||||
}
|
||||
|
||||
func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq QueryParamsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq QueryParamsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := server.Params(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
||||
// UnaryRPC :call QueryServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
|
@ -167,6 +185,26 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
|
|||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -248,6 +286,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
|
|||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -255,10 +313,14 @@ var (
|
|||
pattern_Query_DenomTrace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"ibc_transfer", "v1beta1", "denom_traces", "hash"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Query_DenomTraces_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ibc_transfer", "v1beta1", "denom_traces"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ibc_transfer", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_Query_DenomTrace_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Query_DenomTraces_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Query_Params_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
|
|
|
@ -317,51 +317,102 @@ func (m *DenomTrace) GetBaseDenom() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
// Params defines the set of IBC transfer parameters.
|
||||
// NOTE: To prevent a single token from being transferred, set the TransfersEnabled parameter to
|
||||
// true and then set the bank module's SendEnabled parameter for the denomination to false.
|
||||
type Params struct {
|
||||
// transfers_enabled enables or disables all cross-chain token transfers from/to this chain.
|
||||
TransfersEnabled bool `protobuf:"varint,1,opt,name=transfers_enabled,json=transfersEnabled,proto3" json:"transfers_enabled,omitempty" yaml:"transfers_enabled"`
|
||||
}
|
||||
|
||||
func (m *Params) Reset() { *m = Params{} }
|
||||
func (m *Params) String() string { return proto.CompactTextString(m) }
|
||||
func (*Params) ProtoMessage() {}
|
||||
func (*Params) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_08134a70fd29e656, []int{4}
|
||||
}
|
||||
func (m *Params) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_Params.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *Params) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Params.Merge(m, src)
|
||||
}
|
||||
func (m *Params) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *Params) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Params.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Params proto.InternalMessageInfo
|
||||
|
||||
func (m *Params) GetTransfersEnabled() bool {
|
||||
if m != nil {
|
||||
return m.TransfersEnabled
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*MsgTransfer)(nil), "ibc.transfer.MsgTransfer")
|
||||
proto.RegisterType((*FungibleTokenPacketData)(nil), "ibc.transfer.FungibleTokenPacketData")
|
||||
proto.RegisterType((*FungibleTokenPacketAcknowledgement)(nil), "ibc.transfer.FungibleTokenPacketAcknowledgement")
|
||||
proto.RegisterType((*DenomTrace)(nil), "ibc.transfer.DenomTrace")
|
||||
proto.RegisterType((*Params)(nil), "ibc.transfer.Params")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("ibc/transfer/transfer.proto", fileDescriptor_08134a70fd29e656) }
|
||||
|
||||
var fileDescriptor_08134a70fd29e656 = []byte{
|
||||
// 541 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0xc1, 0x6e, 0xd3, 0x4c,
|
||||
0x10, 0x8e, 0xff, 0xba, 0x69, 0xbb, 0x69, 0x7f, 0xc1, 0xaa, 0x14, 0x37, 0x80, 0x13, 0xf9, 0x94,
|
||||
0x4b, 0x6c, 0x05, 0x84, 0x90, 0xb8, 0x40, 0xd2, 0x0a, 0x51, 0x21, 0xa4, 0xca, 0xca, 0x89, 0x4b,
|
||||
0xb4, 0x5e, 0x0f, 0x8e, 0x95, 0x78, 0x37, 0xda, 0x5d, 0x17, 0x2a, 0x5e, 0x82, 0x77, 0xe1, 0x25,
|
||||
0x7a, 0xec, 0x91, 0x53, 0x84, 0x92, 0x37, 0xc8, 0x91, 0x13, 0x5a, 0xef, 0x26, 0x34, 0x52, 0xc5,
|
||||
0xc9, 0xfb, 0x7d, 0xdf, 0xcc, 0xf8, 0x9b, 0xd9, 0x59, 0xf4, 0x24, 0x4f, 0x68, 0xa4, 0x04, 0x61,
|
||||
0xf2, 0x33, 0x88, 0xcd, 0x21, 0x9c, 0x09, 0xae, 0x38, 0x3e, 0xcc, 0x13, 0x1a, 0xae, 0xb9, 0xe6,
|
||||
0x71, 0xc6, 0x33, 0x5e, 0x09, 0x91, 0x3e, 0x99, 0x98, 0xa6, 0x4f, 0xb9, 0x2c, 0xb8, 0x8c, 0x12,
|
||||
0x22, 0x21, 0xba, 0xea, 0x25, 0xa0, 0x48, 0x2f, 0xa2, 0x3c, 0x67, 0x46, 0x0f, 0x7e, 0xec, 0xa0,
|
||||
0xc6, 0x47, 0x99, 0x0d, 0x6d, 0x15, 0xfc, 0x0a, 0x35, 0x24, 0x2f, 0x05, 0x85, 0xd1, 0x8c, 0x0b,
|
||||
0xe5, 0x39, 0x6d, 0xa7, 0x73, 0x30, 0x38, 0x59, 0xcd, 0x5b, 0xf8, 0x9a, 0x14, 0xd3, 0xd7, 0xc1,
|
||||
0x1d, 0x31, 0x88, 0x91, 0x41, 0x97, 0x5c, 0x28, 0xfc, 0x16, 0xfd, 0x6f, 0x35, 0x3a, 0x26, 0x8c,
|
||||
0xc1, 0xd4, 0xfb, 0xaf, 0xca, 0x3d, 0x5d, 0xcd, 0x5b, 0x8f, 0xb6, 0x72, 0xad, 0x1e, 0xc4, 0x47,
|
||||
0x86, 0x38, 0x33, 0x18, 0xbf, 0x44, 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98, 0xab, 0x8b, 0x0d, 0xc0, 0x27, 0xa8, 0x4e, 0x0a, 0x5e, 0x32, 0x55, 0xdd, 0x8a,
|
||||
0x1b, 0x5b, 0xa4, 0x79, 0x3b, 0xbc, 0x9d, 0x2a, 0xfc, 0xbe, 0x49, 0xb8, 0xdb, 0x93, 0x08, 0x86,
|
||||
0x28, 0xb8, 0xe7, 0xe7, 0x7d, 0x3a, 0x61, 0xfc, 0xcb, 0x14, 0xd2, 0x0c, 0x0a, 0x60, 0x0a, 0x7b,
|
||||
0x68, 0x4f, 0x96, 0x94, 0x82, 0x94, 0x95, 0x93, 0xfd, 0x78, 0x0d, 0xb5, 0x43, 0x10, 0x82, 0x0b,
|
||||
0xb3, 0x20, 0xb1, 0x01, 0xc1, 0x1b, 0x84, 0xce, 0xb5, 0xd5, 0xa1, 0x20, 0x14, 0x30, 0x46, 0xee,
|
||||
0x8c, 0xa8, 0xb1, 0x6d, 0xa2, 0x3a, 0xe3, 0x67, 0x08, 0xe9, 0x55, 0x18, 0x99, 0xf6, 0x4c, 0xf2,
|
||||
0x81, 0x66, 0xaa, 0xbc, 0xc1, 0x87, 0x9b, 0x85, 0xef, 0xdc, 0x2e, 0x7c, 0xe7, 0xd7, 0xc2, 0x77,
|
||||
0xbe, 0x2f, 0xfd, 0xda, 0xed, 0xd2, 0xaf, 0xfd, 0x5c, 0xfa, 0xb5, 0x4f, 0xbd, 0x7f, 0x6e, 0xc3,
|
||||
0xd7, 0x28, 0x4f, 0x68, 0xf7, 0xef, 0x1b, 0xd3, 0xcb, 0x91, 0xd4, 0xab, 0xd7, 0xf1, 0xe2, 0x4f,
|
||||
0x00, 0x00, 0x00, 0xff, 0xff, 0x8b, 0x58, 0xed, 0x2d, 0x80, 0x03, 0x00, 0x00,
|
||||
// 569 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0x4d, 0x6f, 0xd3, 0x30,
|
||||
0x18, 0x6e, 0x58, 0xd6, 0x6d, 0xde, 0x86, 0xc0, 0x1a, 0x23, 0x1b, 0x90, 0x56, 0x39, 0xf5, 0xb2,
|
||||
0x44, 0x05, 0x21, 0x24, 0x2e, 0xd0, 0x6e, 0x20, 0x26, 0x84, 0x54, 0x85, 0x9e, 0xb8, 0x54, 0x8e,
|
||||
0xf3, 0x92, 0x46, 0x6d, 0xec, 0xca, 0x76, 0x06, 0x13, 0x7f, 0x82, 0xff, 0xc2, 0x9f, 0xd8, 0x71,
|
||||
0x47, 0x4e, 0x15, 0x6a, 0xff, 0x41, 0x8f, 0x9c, 0x90, 0x63, 0xb7, 0xac, 0x68, 0xe2, 0x14, 0x3f,
|
||||
0xcf, 0xfb, 0x91, 0xe7, 0x7d, 0xfc, 0x1a, 0x3d, 0xca, 0x13, 0x1a, 0x29, 0x41, 0x98, 0xfc, 0x0c,
|
||||
0x62, 0x75, 0x08, 0x27, 0x82, 0x2b, 0x8e, 0xf7, 0xf2, 0x84, 0x86, 0x4b, 0xee, 0xf8, 0x20, 0xe3,
|
||||
0x19, 0xaf, 0x02, 0x91, 0x3e, 0x99, 0x9c, 0x63, 0x9f, 0x72, 0x59, 0x70, 0x19, 0x25, 0x44, 0x42,
|
||||
0x74, 0xd1, 0x4e, 0x40, 0x91, 0x76, 0x44, 0x79, 0xce, 0x4c, 0x3c, 0xf8, 0xb1, 0x81, 0x76, 0x3f,
|
||||
0xc8, 0xac, 0x6f, 0xbb, 0xe0, 0x17, 0x68, 0x57, 0xf2, 0x52, 0x50, 0x18, 0x4c, 0xb8, 0x50, 0x9e,
|
||||
0xd3, 0x74, 0x5a, 0x3b, 0xdd, 0xc3, 0xc5, 0xb4, 0x81, 0x2f, 0x49, 0x31, 0x7e, 0x19, 0xdc, 0x08,
|
||||
0x06, 0x31, 0x32, 0xa8, 0xc7, 0x85, 0xc2, 0xaf, 0xd1, 0x5d, 0x1b, 0xa3, 0x43, 0xc2, 0x18, 0x8c,
|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0x3c, 0x19,
|
||||
0x43, 0x5f, 0x9b, 0xd0, 0x23, 0x74, 0x04, 0xea, 0x8c, 0x28, 0x82, 0x0f, 0xd0, 0x66, 0x0a, 0x8c,
|
||||
0x17, 0xe6, 0xea, 0x62, 0x03, 0xf0, 0x21, 0xaa, 0x93, 0x82, 0x97, 0x4c, 0x55, 0xb7, 0xe2, 0xc6,
|
||||
0x16, 0x69, 0xde, 0x9a, 0xb7, 0x51, 0xa5, 0xdf, 0xe6, 0x84, 0xbb, 0xee, 0x44, 0xd0, 0x47, 0xc1,
|
||||
0x2d, 0x3f, 0xef, 0xd0, 0x11, 0xe3, 0x5f, 0xc6, 0x90, 0x66, 0x50, 0x00, 0x53, 0xd8, 0x43, 0x5b,
|
||||
0xb2, 0xa4, 0x14, 0xa4, 0xac, 0x94, 0x6c, 0xc7, 0x4b, 0xa8, 0x15, 0x82, 0x10, 0x5c, 0x98, 0x05,
|
||||
0x89, 0x0d, 0x08, 0x5e, 0x21, 0x74, 0xa6, 0xa5, 0xf6, 0x05, 0xa1, 0x80, 0x31, 0x72, 0x27, 0x44,
|
||||
0x0d, 0xed, 0x10, 0xd5, 0x19, 0x3f, 0x41, 0x48, 0xaf, 0xc2, 0xc0, 0x8c, 0x67, 0x8a, 0x77, 0x34,
|
||||
0x53, 0xd5, 0x05, 0x1f, 0x51, 0xbd, 0x47, 0x04, 0x29, 0x64, 0x65, 0xb4, 0xdd, 0x67, 0x39, 0x00,
|
||||
0x46, 0x92, 0x31, 0xa4, 0x46, 0xc4, 0x9a, 0xd1, 0xff, 0xa6, 0x68, 0xa3, 0x97, 0xdc, 0x1b, 0x43,
|
||||
0x75, 0xdf, 0x5f, 0xcd, 0x7c, 0xe7, 0x7a, 0xe6, 0x3b, 0xbf, 0x66, 0xbe, 0xf3, 0x7d, 0xee, 0xd7,
|
||||
0xae, 0xe7, 0x7e, 0xed, 0xe7, 0xdc, 0xaf, 0x7d, 0x6a, 0xff, 0x77, 0xc5, 0xbe, 0x46, 0x79, 0x42,
|
||||
0x4f, 0xfe, 0x3e, 0x5c, 0xbd, 0x71, 0x49, 0xbd, 0x7a, 0x72, 0xcf, 0xfe, 0x04, 0x00, 0x00, 0xff,
|
||||
0xff, 0x25, 0x11, 0xa0, 0x84, 0xd5, 0x03, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *MsgTransfer) Marshal() (dAtA []byte, err error) {
|
||||
|
@ -561,6 +612,39 @@ func (m *DenomTrace) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Params) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *Params) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.TransfersEnabled {
|
||||
i--
|
||||
if m.TransfersEnabled {
|
||||
dAtA[i] = 1
|
||||
} else {
|
||||
dAtA[i] = 0
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintTransfer(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovTransfer(v)
|
||||
base := offset
|
||||
|
@ -662,6 +746,18 @@ func (m *DenomTrace) Size() (n int) {
|
|||
return n
|
||||
}
|
||||
|
||||
func (m *Params) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.TransfersEnabled {
|
||||
n += 2
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovTransfer(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
|
@ -1312,6 +1408,79 @@ func (m *DenomTrace) Unmarshal(dAtA []byte) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
func (m *Params) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTransfer
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: Params: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field TransfersEnabled", wireType)
|
||||
}
|
||||
var v int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTransfer
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
v |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
m.TransfersEnabled = bool(v != 0)
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTransfer(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthTransfer
|
||||
}
|
||||
if (iNdEx + skippy) < 0 {
|
||||
return ErrInvalidLengthTransfer
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipTransfer(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
|
Loading…
Reference in New Issue