diff --git a/app/app.go b/app/app.go index 2a9eba086..310edeabd 100644 --- a/app/app.go +++ b/app/app.go @@ -814,9 +814,9 @@ func New( panic(err) } - // RegisterUpgradeHandlers is used for registering any on-chain upgrades. + // registerUpgradeHandlers is used for registering any on-chain upgrades. // Make sure it's called after `app.ModuleManager` and `app.configurator` are set. - app.RegisterUpgradeHandlers() + app.registerUpgradeHandlers() autocliv1.RegisterQueryServer(app.GRPCQueryRouter(), runtimeservices.NewAutoCLIQueryService(app.ModuleManager.Modules)) reflectionSvc, err := runtimeservices.NewReflectionService() diff --git a/app/upgrades.go b/app/upgrades.go index bb5d1657a..ea8b1c4da 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -1,17 +1,28 @@ package app import ( + "context" "fmt" - v7 "github.com/axone-protocol/axoned/v10/app/upgrades/v7" + upgradetypes "cosmossdk.io/x/upgrade/types" + + "github.com/cosmos/cosmos-sdk/types/module" ) -// RegisterUpgradeHandlers registers the chain upgrade handlers. -func (app *App) RegisterUpgradeHandlers() { - app.UpgradeKeeper.SetUpgradeHandler( - v7.UpgradeName, - v7.CreateUpgradeHandler(app.ModuleManager, app.configurator), - ) +var upgrades = []string{ + "v11.0.0", +} + +// registerUpgradeHandlers registers the chain upgrade handlers. +func (app *App) registerUpgradeHandlers() { + for _, upgrade := range upgrades { + app.UpgradeKeeper.SetUpgradeHandler( + upgrade, + func(ctx context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + return app.ModuleManager.RunMigrations(ctx, app.configurator, vm) + }, + ) + } upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() if err != nil { diff --git a/app/upgrades/v7/upgrade.go b/app/upgrades/v7/upgrade.go deleted file mode 100644 index 036d8346f..000000000 --- a/app/upgrades/v7/upgrade.go +++ /dev/null @@ -1,20 +0,0 @@ -package v7 - -import ( - "context" - - upgradetypes "cosmossdk.io/x/upgrade/types" - - "github.com/cosmos/cosmos-sdk/types/module" -) - -var UpgradeName = "v7.0.0" - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, -) upgradetypes.UpgradeHandler { - return func(ctx context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - return mm.RunMigrations(ctx, configurator, vm) - } -} diff --git a/go.mod b/go.mod index 54128f91c..b64fa3fbb 100644 --- a/go.mod +++ b/go.mod @@ -41,6 +41,7 @@ require ( github.com/huandu/xstrings v1.5.0 github.com/hyperledger/aries-framework-go v0.3.2 github.com/ignite/cli v0.27.2 + github.com/jinzhu/copier v0.3.5 github.com/muesli/reflow v0.3.0 github.com/nuts-foundation/go-did v0.15.0 github.com/piprate/json-gold v0.5.1-0.20230111113000-6ddbe6e6f19f diff --git a/x/logic/keeper/migrations.go b/x/logic/keeper/migrations.go new file mode 100644 index 000000000..4750ef830 --- /dev/null +++ b/x/logic/keeper/migrations.go @@ -0,0 +1,70 @@ +package keeper + +import ( + "github.com/jinzhu/copier" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + + v1beta2types "github.com/axone-protocol/axoned/v10/x/logic/legacy/v1beta2/types" + "github.com/axone-protocol/axoned/v10/x/logic/types" +) + +func MigrateStoreV3ToV4(k Keeper) module.MigrationHandler { + getParams := func(ctx sdk.Context) (params v1beta2types.Params, err error) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ParamsKey) + if bz == nil { + return params, nil + } + err = k.cdc.Unmarshal(bz, ¶ms) + + return params, err + } + + return func(ctx sdk.Context) error { + paramsFrom, err := getParams(ctx) + if err != nil { + return err + } + + var paramsTo types.Params + + // Interpreter + if err := copier.Copy(¶msTo.Interpreter, paramsFrom.Interpreter); err != nil { + return err + } + + // Limits + if v := paramsFrom.Limits.MaxSize; v != nil { + paramsTo.Limits.MaxSize = v.Uint64() + } + if v := paramsFrom.Limits.MaxResultCount; v != nil { + paramsTo.Limits.MaxResultCount = v.Uint64() + } + if v := paramsFrom.Limits.MaxUserOutputSize; v != nil { + paramsTo.Limits.MaxUserOutputSize = v.Uint64() + } + if v := paramsFrom.Limits.MaxVariables; v != nil { + paramsTo.Limits.MaxVariables = v.Uint64() + } + + // GasPolicy + if v := paramsFrom.GasPolicy.WeightingFactor; v != nil { + paramsTo.GasPolicy.WeightingFactor = v.Uint64() + } + if v := paramsFrom.GasPolicy.DefaultPredicateCost; v != nil { + paramsTo.GasPolicy.DefaultPredicateCost = v.Uint64() + } + if v := paramsFrom.GasPolicy.PredicateCosts; v != nil { + for _, pc := range v { + paramsTo.GasPolicy.PredicateCosts = append(paramsTo.GasPolicy.PredicateCosts, types.PredicateCost{ + Predicate: pc.Predicate, + Cost: pc.Cost.Uint64(), + }) + } + } + + return k.SetParams(ctx, paramsTo) + } +} diff --git a/x/logic/keeper/migrations_test.go b/x/logic/keeper/migrations_test.go new file mode 100644 index 000000000..d6f69f401 --- /dev/null +++ b/x/logic/keeper/migrations_test.go @@ -0,0 +1,166 @@ +package keeper_test + +import ( + gocontext "context" + "fmt" + "io/fs" + "testing" + + "github.com/golang/mock/gomock" + "github.com/samber/lo" + + . "github.com/smartystreets/goconvey/convey" + + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/testutil" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + + "github.com/axone-protocol/axoned/v10/x/logic" + "github.com/axone-protocol/axoned/v10/x/logic/keeper" + v1beta2types "github.com/axone-protocol/axoned/v10/x/logic/legacy/v1beta2/types" + logictestutil "github.com/axone-protocol/axoned/v10/x/logic/testutil" + "github.com/axone-protocol/axoned/v10/x/logic/types" +) + +func TestMigrateStoreV10ToV11(t *testing.T) { + Convey("Given a test cases", t, func() { + cases := []struct { + params v1beta2types.Params + expect types.Params + }{ + { + params: v1beta2types.Params{ + Interpreter: v1beta2types.Interpreter{ + PredicatesFilter: v1beta2types.Filter{}, + Bootstrap: "", + VirtualFilesFilter: v1beta2types.Filter{}, + }, + GasPolicy: v1beta2types.GasPolicy{}, + Limits: v1beta2types.Limits{}, + }, + expect: types.Params{ + Interpreter: types.Interpreter{ + PredicatesFilter: types.Filter{}, + Bootstrap: "", + VirtualFilesFilter: types.Filter{}, + }, + GasPolicy: types.GasPolicy{}, + Limits: types.Limits{}, + }, + }, + { + params: v1beta2types.Params{ + Interpreter: v1beta2types.Interpreter{ + PredicatesFilter: v1beta2types.Filter{ + Whitelist: []string{"foo/1", "bar/2"}, + Blacklist: []string{"baz/3"}, + }, + Bootstrap: "foo(bar).", + VirtualFilesFilter: v1beta2types.Filter{ + Whitelist: []string{"foo://bar"}, + Blacklist: []string{"bar://baz"}, + }, + }, + GasPolicy: v1beta2types.GasPolicy{ + WeightingFactor: lo.ToPtr(sdkmath.NewUint(42)), + DefaultPredicateCost: lo.ToPtr(sdkmath.NewUint(66)), + PredicateCosts: []v1beta2types.PredicateCost{ + { + Predicate: "foo/1", + Cost: lo.ToPtr(sdkmath.NewUint(99)), + }, + }, + }, + Limits: v1beta2types.Limits{ + MaxSize: lo.ToPtr(sdkmath.NewUint(100)), + MaxResultCount: lo.ToPtr(sdkmath.NewUint(10)), + MaxUserOutputSize: lo.ToPtr(sdkmath.NewUint(50)), + MaxVariables: lo.ToPtr(sdkmath.NewUint(5)), + }, + }, + expect: types.Params{ + Interpreter: types.Interpreter{ + PredicatesFilter: types.Filter{ + Whitelist: []string{"foo/1", "bar/2"}, + Blacklist: []string{"baz/3"}, + }, + Bootstrap: "foo(bar).", + VirtualFilesFilter: types.Filter{ + Whitelist: []string{"foo://bar"}, + Blacklist: []string{"bar://baz"}, + }, + }, + GasPolicy: types.GasPolicy{ + WeightingFactor: 42, + DefaultPredicateCost: 66, + PredicateCosts: []types.PredicateCost{ + { + Predicate: "foo/1", + Cost: 99, + }, + }, + }, + Limits: types.Limits{ + MaxSize: 100, + MaxResultCount: 10, + MaxUserOutputSize: 50, + MaxVariables: 5, + }, + }, + }, + } + for nc, tc := range cases { + Convey(fmt.Sprintf("Given a mocked logic keeper for test case %d", nc), func() { + encCfg := moduletestutil.MakeTestEncodingConfig(logic.AppModuleBasic{}) + key := storetypes.NewKVStoreKey(types.StoreKey) + testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) + + ctrl := gomock.NewController(t) + accountKeeper := logictestutil.NewMockAccountKeeper(ctrl) + authQueryService := logictestutil.NewMockAuthQueryService(ctrl) + bankKeeper := logictestutil.NewMockBankKeeper(ctrl) + fsProvider := logictestutil.NewMockFS(ctrl) + + logicKeeper := keeper.NewKeeper( + encCfg.Codec, + encCfg.InterfaceRegistry, + key, + key, + authtypes.NewModuleAddress(govtypes.ModuleName), + accountKeeper, + authQueryService, + bankKeeper, + func(_ gocontext.Context) fs.FS { + return fsProvider + }) + So(logicKeeper, ShouldNotBeNil) + + Convey("Given a store with v10 params", func() { + store := testCtx.Ctx.KVStore(key) + bz, err := encCfg.Codec.Marshal(&tc.params) + So(err, ShouldBeNil) + + store.Set(types.ParamsKey, bz) + + Convey("When migrating store from v10 to v11", func() { + migrateHandler := keeper.MigrateStoreV3ToV4(*logicKeeper) + So(migrateHandler, ShouldNotBeNil) + + err := migrateHandler(testCtx.Ctx) + So(err, ShouldBeNil) + + Convey("Then the store should have the expected v11 params", func() { + params := logicKeeper.GetParams(testCtx.Ctx) + So(err, ShouldBeNil) + So(params, ShouldResemble, tc.expect) + }) + }) + }) + }) + } + }) +} diff --git a/x/logic/legacy/v1beta2/types/genesis.pb.go b/x/logic/legacy/v1beta2/types/genesis.pb.go new file mode 100644 index 000000000..0b2904e53 --- /dev/null +++ b/x/logic/legacy/v1beta2/types/genesis.pb.go @@ -0,0 +1,322 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: logic/v1beta2/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the logic module's genesis state. +type GenesisState struct { + // The state parameters for the logic module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_712b71f2a5cb208f, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "logic.v1beta2.GenesisState") +} + +func init() { proto.RegisterFile("logic/v1beta2/genesis.proto", fileDescriptor_712b71f2a5cb208f) } + +var fileDescriptor_712b71f2a5cb208f = []byte{ + // 196 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xce, 0xc9, 0x4f, 0xcf, + 0x4c, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd2, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, + 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x05, 0x4b, 0xea, 0x41, 0x25, 0xa5, 0x44, + 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x32, 0xfa, 0x20, 0x16, 0x44, 0x91, 0x94, 0x14, 0xaa, 0x09, 0x05, + 0x89, 0x45, 0x89, 0xb9, 0x50, 0x03, 0x94, 0x9c, 0xb9, 0x78, 0xdc, 0x21, 0x26, 0x06, 0x97, 0x24, + 0x96, 0xa4, 0x0a, 0x19, 0x73, 0xb1, 0x41, 0xe4, 0x25, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0x44, + 0xf5, 0x50, 0x6c, 0xd0, 0x0b, 0x00, 0x4b, 0x3a, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x10, 0x04, 0x55, + 0xea, 0xe4, 0x71, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, + 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x7a, 0xe9, 0x99, + 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x89, 0x15, 0xf9, 0x79, 0xa9, 0xba, 0x60, + 0x6b, 0x93, 0xf3, 0x73, 0x20, 0xdc, 0x14, 0xfd, 0x0a, 0x7d, 0x88, 0xeb, 0x4a, 0x2a, 0x0b, 0x52, + 0x8b, 0x93, 0xd8, 0xc0, 0xd2, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1e, 0xa2, 0x99, 0xdd, + 0xf5, 0x00, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = 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] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: 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 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:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/logic/legacy/v1beta2/types/params.go b/x/logic/legacy/v1beta2/types/params.go new file mode 100644 index 000000000..4b9f756bb --- /dev/null +++ b/x/logic/legacy/v1beta2/types/params.go @@ -0,0 +1,7 @@ +package types + +// String implements the Stringer interface. +func (p Params) String() string { + return p.Interpreter.String() + "\n" + + p.Limits.String() +} diff --git a/x/logic/legacy/v1beta2/types/params.pb.go b/x/logic/legacy/v1beta2/types/params.pb.go new file mode 100644 index 000000000..9a4cb9d3c --- /dev/null +++ b/x/logic/legacy/v1beta2/types/params.pb.go @@ -0,0 +1,1862 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: logic/v1beta2/params.proto + +package types + +import ( + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params defines all the configuration parameters of the "logic" module. +type Params struct { + // Interpreter specifies the parameter for the logic interpreter. + Interpreter Interpreter `protobuf:"bytes,1,opt,name=interpreter,proto3" json:"interpreter" yaml:"interpreter"` + // Limits defines the limits of the logic module. + // The limits are used to prevent the interpreter from running for too long. + // If the interpreter runs for too long, the execution will be aborted. + Limits Limits `protobuf:"bytes,2,opt,name=limits,proto3" json:"limits" yaml:"limits"` + // GasPolicy defines the parameters for calculating predicate invocation costs. + GasPolicy GasPolicy `protobuf:"bytes,3,opt,name=gas_policy,json=gasPolicy,proto3" json:"gas_policy" yaml:"gas_policy"` +} + +func (m *Params) Reset() { *m = Params{} } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_3af0daa241de0fa3, []int{0} +} +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) GetInterpreter() Interpreter { + if m != nil { + return m.Interpreter + } + return Interpreter{} +} + +func (m *Params) GetLimits() Limits { + if m != nil { + return m.Limits + } + return Limits{} +} + +func (m *Params) GetGasPolicy() GasPolicy { + if m != nil { + return m.GasPolicy + } + return GasPolicy{} +} + +// Limits defines the limits of the logic module. +type Limits struct { + // max_size specifies the maximum size, in bytes, that is accepted for a program. + // nil value or 0 value remove size limitation. + MaxSize *cosmossdk_io_math.Uint `protobuf:"bytes,3,opt,name=max_size,json=maxSize,proto3,customtype=cosmossdk.io/math.Uint" json:"max_size,omitempty" yaml:"max_size"` + // max_result_count specifies the maximum number of results that can be requested for a query. + // nil value or 0 value remove max result count limitation. + MaxResultCount *cosmossdk_io_math.Uint `protobuf:"bytes,2,opt,name=max_result_count,json=maxResultCount,proto3,customtype=cosmossdk.io/math.Uint" json:"max_result_count,omitempty" yaml:"max_result_count"` + // max_user_output_size specifies the maximum number of bytes to keep in the user output. If the user output exceeds + // this size, the interpreter will overwrite the oldest bytes with the new ones to keep the size constant. + // nil value or 0 value means that no user output is used at all. + MaxUserOutputSize *cosmossdk_io_math.Uint `protobuf:"bytes,4,opt,name=max_user_output_size,json=maxUserOutputSize,proto3,customtype=cosmossdk.io/math.Uint" json:"max_user_output_size,omitempty" yaml:"max_user_output_size"` + // max_variables specifies the maximum number of variables that can be create by the interpreter. + // nil value or 0 value means that no limit is set. + MaxVariables *cosmossdk_io_math.Uint `protobuf:"bytes,5,opt,name=max_variables,json=maxVariables,proto3,customtype=cosmossdk.io/math.Uint" json:"max_variables,omitempty" yaml:"max_variables"` +} + +func (m *Limits) Reset() { *m = Limits{} } +func (m *Limits) String() string { return proto.CompactTextString(m) } +func (*Limits) ProtoMessage() {} +func (*Limits) Descriptor() ([]byte, []int) { + return fileDescriptor_3af0daa241de0fa3, []int{1} +} +func (m *Limits) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Limits) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Limits.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 *Limits) XXX_Merge(src proto.Message) { + xxx_messageInfo_Limits.Merge(m, src) +} +func (m *Limits) XXX_Size() int { + return m.Size() +} +func (m *Limits) XXX_DiscardUnknown() { + xxx_messageInfo_Limits.DiscardUnknown(m) +} + +var xxx_messageInfo_Limits proto.InternalMessageInfo + +// Filter defines the parameters for filtering the set of strings which can designate anything. +// The filter is used to whitelist or blacklist strings. +type Filter struct { + // whitelist specifies a list of strings that are allowed. + // If this field is not specified, all strings (in the context of the filter) are allowed. + Whitelist []string `protobuf:"bytes,1,rep,name=whitelist,proto3" json:"whitelist,omitempty" yaml:"whitelist"` + // blacklist specifies a list of strings that are excluded from the set of allowed strings. + // If a string is included in both whitelist and blacklist, it will be excluded. This means that + // blacklisted strings prevails over whitelisted ones. + // If this field is not specified, no strings are excluded. + Blacklist []string `protobuf:"bytes,2,rep,name=blacklist,proto3" json:"blacklist,omitempty" yaml:"blacklist"` +} + +func (m *Filter) Reset() { *m = Filter{} } +func (m *Filter) String() string { return proto.CompactTextString(m) } +func (*Filter) ProtoMessage() {} +func (*Filter) Descriptor() ([]byte, []int) { + return fileDescriptor_3af0daa241de0fa3, []int{2} +} +func (m *Filter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Filter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Filter.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 *Filter) XXX_Merge(src proto.Message) { + xxx_messageInfo_Filter.Merge(m, src) +} +func (m *Filter) XXX_Size() int { + return m.Size() +} +func (m *Filter) XXX_DiscardUnknown() { + xxx_messageInfo_Filter.DiscardUnknown(m) +} + +var xxx_messageInfo_Filter proto.InternalMessageInfo + +func (m *Filter) GetWhitelist() []string { + if m != nil { + return m.Whitelist + } + return nil +} + +func (m *Filter) GetBlacklist() []string { + if m != nil { + return m.Blacklist + } + return nil +} + +// Interpreter defines the various parameters for the interpreter. +type Interpreter struct { + // predicates_filter specifies the filter for the predicates that are allowed to be used by the interpreter. + // The filter is used to whitelist or blacklist predicates represented as `/[]`, for example: + // `findall/3`, or `call`. If a predicate name without arity is included in the filter, then all predicates with that + // name will be considered regardless of arity. For example, if `call` is included in the filter, then all predicates + // `call/1`, `call/2`, `call/3`... will be allowed. + PredicatesFilter Filter `protobuf:"bytes,1,opt,name=predicates_filter,json=predicatesFilter,proto3" json:"predicates_filter" yaml:"predicates_filter"` + // bootstrap specifies the initial program to run when booting the logic interpreter. + // If not specified, the default boot sequence will be executed. + Bootstrap string `protobuf:"bytes,3,opt,name=bootstrap,proto3" json:"bootstrap,omitempty" yaml:"bootstrap"` + // virtual_files_filter specifies the filter for the virtual files that are allowed to be used by the interpreter. + // The filter is used to whitelist or blacklist virtual files represented as URI, for example: + // `file:///path/to/file`, `cosmwasm:cw-storage:axone...?query=foo` + // The filter is applied to the components of the URI, for example: + // `file:///path/to/file` -> `file`, `/path/to/file` + // `cosmwasm:cw-storage:axone...?query=foo` -> `cosmwasm`, `cw-storage`, `axone...`, `query=foo` + // If a component is included in the filter, then all components with that name will be considered, starting from the + // beginning of the URI. For example, if `file` is included in the filter, then all URIs that start with `file` will be + // allowed, regardless of the rest of the components. But `file2` will not be allowed. + // If the component is not included in the filter, then the component is ignored and the next component is considered. + VirtualFilesFilter Filter `protobuf:"bytes,4,opt,name=virtual_files_filter,json=virtualFilesFilter,proto3" json:"virtual_files_filter" yaml:"filesystem_filter"` +} + +func (m *Interpreter) Reset() { *m = Interpreter{} } +func (m *Interpreter) String() string { return proto.CompactTextString(m) } +func (*Interpreter) ProtoMessage() {} +func (*Interpreter) Descriptor() ([]byte, []int) { + return fileDescriptor_3af0daa241de0fa3, []int{3} +} +func (m *Interpreter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Interpreter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Interpreter.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 *Interpreter) XXX_Merge(src proto.Message) { + xxx_messageInfo_Interpreter.Merge(m, src) +} +func (m *Interpreter) XXX_Size() int { + return m.Size() +} +func (m *Interpreter) XXX_DiscardUnknown() { + xxx_messageInfo_Interpreter.DiscardUnknown(m) +} + +var xxx_messageInfo_Interpreter proto.InternalMessageInfo + +func (m *Interpreter) GetPredicatesFilter() Filter { + if m != nil { + return m.PredicatesFilter + } + return Filter{} +} + +func (m *Interpreter) GetBootstrap() string { + if m != nil { + return m.Bootstrap + } + return "" +} + +func (m *Interpreter) GetVirtualFilesFilter() Filter { + if m != nil { + return m.VirtualFilesFilter + } + return Filter{} +} + +// GasPolicy defines the policy for calculating predicate invocation costs and the resulting gas consumption. +// The gas policy is defined as a list of predicates and their associated unit costs, a default unit cost for predicates +// if not specified in the list, and a weighting factor that is applied to the unit cost of each predicate to yield. +type GasPolicy struct { + // WeightingFactor is the factor that is applied to the unit cost of each predicate + // to yield the gas value. + // If not provided or set to 0, the value is set to 1. + WeightingFactor *cosmossdk_io_math.Uint `protobuf:"bytes,1,opt,name=weighting_factor,json=weightingFactor,proto3,customtype=cosmossdk.io/math.Uint" json:"weighting_factor,omitempty" yaml:"weighting_factor"` + // DefaultPredicateCost is the default unit cost of a predicate when not specified in the PredicateCosts list. + // If not provided or set to 0, the value is set to 1. + DefaultPredicateCost *cosmossdk_io_math.Uint `protobuf:"bytes,2,opt,name=default_predicate_cost,json=defaultPredicateCost,proto3,customtype=cosmossdk.io/math.Uint" json:"default_predicate_cost,omitempty" yaml:"default_predicate_cost"` + // PredicateCosts is the list of predicates and their associated unit costs. + PredicateCosts []PredicateCost `protobuf:"bytes,3,rep,name=predicate_costs,json=predicateCosts,proto3" json:"predicate_costs" yaml:"predicate_cost"` +} + +func (m *GasPolicy) Reset() { *m = GasPolicy{} } +func (m *GasPolicy) String() string { return proto.CompactTextString(m) } +func (*GasPolicy) ProtoMessage() {} +func (*GasPolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_3af0daa241de0fa3, []int{4} +} +func (m *GasPolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GasPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GasPolicy.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 *GasPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_GasPolicy.Merge(m, src) +} +func (m *GasPolicy) XXX_Size() int { + return m.Size() +} +func (m *GasPolicy) XXX_DiscardUnknown() { + xxx_messageInfo_GasPolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_GasPolicy proto.InternalMessageInfo + +func (m *GasPolicy) GetPredicateCosts() []PredicateCost { + if m != nil { + return m.PredicateCosts + } + return nil +} + +// PredicateCost defines the unit cost of a predicate during its invocation by the interpreter. +type PredicateCost struct { + // Predicate is the name of the predicate, optionally followed by its arity (e.g. "findall/3"). + // If no arity is specified, the unit cost is applied to all predicates with the same name. + Predicate string `protobuf:"bytes,1,opt,name=predicate,proto3" json:"predicate,omitempty" yaml:"predicate"` + // Cost is the unit cost of the predicate. + Cost *cosmossdk_io_math.Uint `protobuf:"bytes,2,opt,name=cost,proto3,customtype=cosmossdk.io/math.Uint" json:"cost,omitempty" yaml:"cost",omitempty` +} + +func (m *PredicateCost) Reset() { *m = PredicateCost{} } +func (m *PredicateCost) String() string { return proto.CompactTextString(m) } +func (*PredicateCost) ProtoMessage() {} +func (*PredicateCost) Descriptor() ([]byte, []int) { + return fileDescriptor_3af0daa241de0fa3, []int{5} +} +func (m *PredicateCost) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PredicateCost) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PredicateCost.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 *PredicateCost) XXX_Merge(src proto.Message) { + xxx_messageInfo_PredicateCost.Merge(m, src) +} +func (m *PredicateCost) XXX_Size() int { + return m.Size() +} +func (m *PredicateCost) XXX_DiscardUnknown() { + xxx_messageInfo_PredicateCost.DiscardUnknown(m) +} + +var xxx_messageInfo_PredicateCost proto.InternalMessageInfo + +func (m *PredicateCost) GetPredicate() string { + if m != nil { + return m.Predicate + } + return "" +} + +func init() { + proto.RegisterType((*Params)(nil), "logic.v1beta2.Params") + proto.RegisterType((*Limits)(nil), "logic.v1beta2.Limits") + proto.RegisterType((*Filter)(nil), "logic.v1beta2.Filter") + proto.RegisterType((*Interpreter)(nil), "logic.v1beta2.Interpreter") + proto.RegisterType((*GasPolicy)(nil), "logic.v1beta2.GasPolicy") + proto.RegisterType((*PredicateCost)(nil), "logic.v1beta2.PredicateCost") +} + +func init() { proto.RegisterFile("logic/v1beta2/params.proto", fileDescriptor_3af0daa241de0fa3) } + +var fileDescriptor_3af0daa241de0fa3 = []byte{ + // 762 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xcf, 0x6a, 0xdb, 0x48, + 0x18, 0xb7, 0x6c, 0xaf, 0x77, 0x3d, 0x5e, 0x27, 0x8e, 0x70, 0xb2, 0x5a, 0xef, 0xc6, 0x36, 0x73, + 0xca, 0x61, 0x57, 0x26, 0x59, 0xc8, 0xb2, 0x81, 0xa5, 0xa0, 0x94, 0xb4, 0xa5, 0x81, 0x86, 0x29, + 0x29, 0xa5, 0x3d, 0x98, 0xb1, 0x3c, 0x91, 0x87, 0x48, 0x1e, 0xa1, 0x19, 0x25, 0x72, 0x8e, 0x7d, + 0x80, 0xd2, 0x43, 0x0f, 0x3d, 0xf4, 0xd0, 0xc7, 0xc9, 0xa9, 0xe4, 0x58, 0x7a, 0x30, 0x25, 0x79, + 0x83, 0x3c, 0x41, 0xd1, 0x8c, 0x2c, 0xd9, 0x6a, 0xc0, 0xe4, 0x26, 0x7d, 0xbf, 0xef, 0xf7, 0x47, + 0xdf, 0x7c, 0x83, 0x40, 0xcb, 0x65, 0x0e, 0xb5, 0x7b, 0x67, 0xdb, 0x03, 0x22, 0xf0, 0x4e, 0xcf, + 0xc7, 0x01, 0xf6, 0xb8, 0xe9, 0x07, 0x4c, 0x30, 0xbd, 0x2e, 0x31, 0x33, 0xc1, 0x5a, 0x4d, 0x87, + 0x39, 0x4c, 0x22, 0xbd, 0xf8, 0x49, 0x35, 0xc1, 0x37, 0x45, 0x50, 0x39, 0x92, 0x2c, 0xfd, 0x25, + 0xa8, 0xd1, 0xb1, 0x20, 0x81, 0x1f, 0x10, 0x41, 0x02, 0x43, 0xeb, 0x6a, 0x5b, 0xb5, 0x9d, 0x96, + 0xb9, 0xa0, 0x62, 0x3e, 0xc9, 0x3a, 0xac, 0xd6, 0xe5, 0xb4, 0x53, 0xb8, 0x9d, 0x76, 0xf4, 0x09, + 0xf6, 0xdc, 0x3d, 0x38, 0x47, 0x86, 0x68, 0x5e, 0x4a, 0x7f, 0x08, 0x2a, 0x2e, 0xf5, 0xa8, 0xe0, + 0x46, 0x51, 0x8a, 0xae, 0xe7, 0x44, 0x0f, 0x25, 0x68, 0xad, 0x27, 0x7a, 0x75, 0xa5, 0xa7, 0x28, + 0x10, 0x25, 0x5c, 0x1d, 0x01, 0xe0, 0x60, 0xde, 0xf7, 0x99, 0x4b, 0xed, 0x89, 0x51, 0x92, 0x4a, + 0x46, 0x4e, 0xe9, 0x11, 0xe6, 0x47, 0x12, 0xb7, 0x7e, 0x4f, 0xc4, 0xd6, 0x94, 0x58, 0xc6, 0x84, + 0xa8, 0xea, 0xcc, 0xba, 0xf6, 0xca, 0x1f, 0x3e, 0x75, 0x0a, 0xf0, 0x6d, 0x09, 0x54, 0x54, 0x06, + 0xfd, 0x10, 0xfc, 0xe2, 0xe1, 0xa8, 0xcf, 0xe9, 0x05, 0x91, 0x16, 0x55, 0x6b, 0xfb, 0x72, 0xda, + 0xd1, 0xbe, 0x4e, 0x3b, 0x1b, 0x36, 0xe3, 0x1e, 0xe3, 0x7c, 0x78, 0x6a, 0x52, 0xd6, 0xf3, 0xb0, + 0x18, 0x99, 0xc7, 0x74, 0x2c, 0x6e, 0xa7, 0x9d, 0x55, 0x65, 0x31, 0xe3, 0x41, 0xf4, 0xb3, 0x87, + 0xa3, 0xe7, 0xf4, 0x82, 0xe8, 0x36, 0x68, 0xc4, 0xd5, 0x80, 0xf0, 0xd0, 0x15, 0x7d, 0x9b, 0x85, + 0x63, 0x21, 0x47, 0x50, 0xb5, 0xfe, 0x5b, 0xaa, 0xfa, 0x5b, 0xa6, 0x3a, 0xcf, 0x87, 0x68, 0xc5, + 0xc3, 0x11, 0x92, 0x95, 0xfd, 0xb8, 0xa0, 0x8f, 0x41, 0x33, 0x6e, 0x0a, 0x39, 0x09, 0xfa, 0x2c, + 0x14, 0x7e, 0x28, 0x54, 0xfc, 0xb2, 0x34, 0xfa, 0x7f, 0xa9, 0xd1, 0x1f, 0x99, 0x51, 0x5e, 0x03, + 0xa2, 0x35, 0x0f, 0x47, 0xc7, 0x9c, 0x04, 0xcf, 0x64, 0x51, 0x7e, 0xd4, 0x6b, 0x50, 0x8f, 0x7b, + 0xcf, 0x70, 0x40, 0xf1, 0xc0, 0x25, 0xdc, 0xf8, 0x49, 0x1a, 0xed, 0x2e, 0x35, 0x6a, 0x66, 0x46, + 0x29, 0x19, 0xa2, 0x5f, 0x3d, 0x1c, 0xbd, 0x98, 0xbd, 0xca, 0x03, 0xd1, 0x60, 0x04, 0x2a, 0x07, + 0xd4, 0x8d, 0x57, 0x67, 0x17, 0x54, 0xcf, 0x47, 0x54, 0x10, 0x97, 0x72, 0x61, 0x68, 0xdd, 0xd2, + 0x56, 0xd5, 0x32, 0x62, 0xa3, 0xdb, 0x69, 0xa7, 0xa1, 0xe4, 0x52, 0x18, 0xa2, 0xac, 0x35, 0xe6, + 0x0d, 0x5c, 0x6c, 0x9f, 0x4a, 0x5e, 0xf1, 0x2e, 0x5e, 0x0a, 0x43, 0x94, 0xb5, 0xc2, 0x8f, 0x45, + 0x50, 0x9b, 0xdb, 0x71, 0x7d, 0x08, 0xd6, 0xfc, 0x80, 0x0c, 0xa9, 0x8d, 0x05, 0xe1, 0xfd, 0x13, + 0x19, 0x2a, 0xb9, 0x1a, 0xf9, 0x2d, 0x56, 0x89, 0xad, 0x6e, 0xb2, 0x78, 0x86, 0xb2, 0xf9, 0x81, + 0x0d, 0x51, 0x23, 0xab, 0x65, 0x5f, 0x39, 0x60, 0x4c, 0x70, 0x11, 0x60, 0x3f, 0x59, 0xbb, 0x7c, + 0xda, 0x19, 0x1c, 0xa7, 0x9d, 0x3d, 0xeb, 0x14, 0x34, 0xcf, 0x68, 0x20, 0x42, 0xec, 0xc6, 0xe2, + 0x59, 0xc0, 0xf2, 0x3d, 0x02, 0x4a, 0xe2, 0x84, 0x0b, 0xe2, 0xa5, 0x01, 0xf5, 0x44, 0xf4, 0x20, + 0x86, 0x14, 0x2b, 0x39, 0x98, 0xcf, 0x45, 0x50, 0x4d, 0xef, 0x98, 0x3e, 0x04, 0x8d, 0x73, 0x42, + 0x9d, 0x91, 0xa0, 0x63, 0xa7, 0x7f, 0x82, 0x6d, 0xc1, 0xd4, 0x6c, 0xee, 0xb1, 0xde, 0x79, 0x3e, + 0x44, 0xab, 0x69, 0xe9, 0x40, 0x56, 0xf4, 0x10, 0x6c, 0x0c, 0xc9, 0x09, 0x8e, 0x6f, 0x40, 0x3a, + 0xb8, 0xbe, 0xcd, 0xf8, 0xec, 0x2a, 0x3d, 0x58, 0xea, 0xb5, 0xa9, 0xbc, 0xee, 0x56, 0x81, 0xa8, + 0x99, 0x00, 0x47, 0xb3, 0xfa, 0x3e, 0xe3, 0x42, 0x1f, 0x82, 0xd5, 0xc5, 0x46, 0x6e, 0x94, 0xba, + 0xa5, 0xad, 0xda, 0xce, 0x9f, 0xb9, 0xb1, 0x2e, 0xd0, 0xac, 0xcd, 0x64, 0xba, 0xeb, 0xb9, 0xe3, + 0x4f, 0xbc, 0x56, 0xfc, 0xf9, 0x6e, 0x0e, 0xdf, 0x6b, 0xa0, 0xbe, 0xe8, 0xbb, 0x0b, 0xaa, 0x69, + 0x4f, 0x32, 0xcd, 0xdc, 0x2e, 0xa4, 0x30, 0x44, 0x59, 0xab, 0xfe, 0x14, 0x94, 0xe7, 0x86, 0xf2, + 0xef, 0xd2, 0xa1, 0x24, 0x01, 0x65, 0xac, 0xbf, 0x98, 0x47, 0x05, 0xf1, 0x7c, 0x31, 0x41, 0x52, + 0xc4, 0x7a, 0x7c, 0x79, 0xdd, 0xd6, 0xae, 0xae, 0xdb, 0xda, 0xb7, 0xeb, 0xb6, 0xf6, 0xee, 0xa6, + 0x5d, 0xb8, 0xba, 0x69, 0x17, 0xbe, 0xdc, 0xb4, 0x0b, 0xaf, 0x4c, 0x87, 0x8a, 0x51, 0x38, 0x30, + 0x6d, 0xe6, 0xf5, 0x70, 0xc4, 0xc6, 0xe4, 0x6f, 0xf9, 0x23, 0xb1, 0x99, 0xab, 0x5e, 0x87, 0xbd, + 0xa8, 0xa7, 0x7e, 0x4a, 0x62, 0xe2, 0x13, 0x3e, 0xa8, 0x48, 0xf8, 0x9f, 0xef, 0x01, 0x00, 0x00, + 0xff, 0xff, 0x53, 0x14, 0xc3, 0x1a, 0xaa, 0x06, 0x00, 0x00, +} + +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 + { + size, err := m.GasPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Limits.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.Interpreter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Limits) 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 *Limits) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Limits) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxVariables != nil { + { + size := m.MaxVariables.Size() + i -= size + if _, err := m.MaxVariables.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.MaxUserOutputSize != nil { + { + size := m.MaxUserOutputSize.Size() + i -= size + if _, err := m.MaxUserOutputSize.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.MaxSize != nil { + { + size := m.MaxSize.Size() + i -= size + if _, err := m.MaxSize.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.MaxResultCount != nil { + { + size := m.MaxResultCount.Size() + i -= size + if _, err := m.MaxResultCount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} + +func (m *Filter) 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 *Filter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Blacklist) > 0 { + for iNdEx := len(m.Blacklist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Blacklist[iNdEx]) + copy(dAtA[i:], m.Blacklist[iNdEx]) + i = encodeVarintParams(dAtA, i, uint64(len(m.Blacklist[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Whitelist) > 0 { + for iNdEx := len(m.Whitelist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Whitelist[iNdEx]) + copy(dAtA[i:], m.Whitelist[iNdEx]) + i = encodeVarintParams(dAtA, i, uint64(len(m.Whitelist[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Interpreter) 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 *Interpreter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Interpreter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.VirtualFilesFilter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.Bootstrap) > 0 { + i -= len(m.Bootstrap) + copy(dAtA[i:], m.Bootstrap) + i = encodeVarintParams(dAtA, i, uint64(len(m.Bootstrap))) + i-- + dAtA[i] = 0x1a + } + { + size, err := m.PredicatesFilter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *GasPolicy) 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 *GasPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GasPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PredicateCosts) > 0 { + for iNdEx := len(m.PredicateCosts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PredicateCosts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.DefaultPredicateCost != nil { + { + size := m.DefaultPredicateCost.Size() + i -= size + if _, err := m.DefaultPredicateCost.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.WeightingFactor != nil { + { + size := m.WeightingFactor.Size() + i -= size + if _, err := m.WeightingFactor.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PredicateCost) 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 *PredicateCost) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PredicateCost) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Cost != nil { + { + size := m.Cost.Size() + i -= size + if _, err := m.Cost.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Predicate) > 0 { + i -= len(m.Predicate) + copy(dAtA[i:], m.Predicate) + i = encodeVarintParams(dAtA, i, uint64(len(m.Predicate))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Interpreter.Size() + n += 1 + l + sovParams(uint64(l)) + l = m.Limits.Size() + n += 1 + l + sovParams(uint64(l)) + l = m.GasPolicy.Size() + n += 1 + l + sovParams(uint64(l)) + return n +} + +func (m *Limits) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MaxResultCount != nil { + l = m.MaxResultCount.Size() + n += 1 + l + sovParams(uint64(l)) + } + if m.MaxSize != nil { + l = m.MaxSize.Size() + n += 1 + l + sovParams(uint64(l)) + } + if m.MaxUserOutputSize != nil { + l = m.MaxUserOutputSize.Size() + n += 1 + l + sovParams(uint64(l)) + } + if m.MaxVariables != nil { + l = m.MaxVariables.Size() + n += 1 + l + sovParams(uint64(l)) + } + return n +} + +func (m *Filter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Whitelist) > 0 { + for _, s := range m.Whitelist { + l = len(s) + n += 1 + l + sovParams(uint64(l)) + } + } + if len(m.Blacklist) > 0 { + for _, s := range m.Blacklist { + l = len(s) + n += 1 + l + sovParams(uint64(l)) + } + } + return n +} + +func (m *Interpreter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.PredicatesFilter.Size() + n += 1 + l + sovParams(uint64(l)) + l = len(m.Bootstrap) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + l = m.VirtualFilesFilter.Size() + n += 1 + l + sovParams(uint64(l)) + return n +} + +func (m *GasPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.WeightingFactor != nil { + l = m.WeightingFactor.Size() + n += 1 + l + sovParams(uint64(l)) + } + if m.DefaultPredicateCost != nil { + l = m.DefaultPredicateCost.Size() + n += 1 + l + sovParams(uint64(l)) + } + if len(m.PredicateCosts) > 0 { + for _, e := range m.PredicateCosts { + l = e.Size() + n += 1 + l + sovParams(uint64(l)) + } + } + return n +} + +func (m *PredicateCost) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Predicate) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + if m.Cost != nil { + l = m.Cost.Size() + n += 1 + l + sovParams(uint64(l)) + } + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +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 ErrIntOverflowParams + } + 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 != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Interpreter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Interpreter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Limits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Limits.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GasPolicy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.GasPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Limits) 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 ErrIntOverflowParams + } + 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: Limits: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Limits: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxResultCount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Uint + m.MaxResultCount = &v + if err := m.MaxResultCount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxSize", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Uint + m.MaxSize = &v + if err := m.MaxSize.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxUserOutputSize", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Uint + m.MaxUserOutputSize = &v + if err := m.MaxUserOutputSize.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxVariables", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Uint + m.MaxVariables = &v + if err := m.MaxVariables.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Filter) 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 ErrIntOverflowParams + } + 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: Filter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Filter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Whitelist", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Whitelist = append(m.Whitelist, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blacklist", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Blacklist = append(m.Blacklist, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Interpreter) 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 ErrIntOverflowParams + } + 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: Interpreter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Interpreter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PredicatesFilter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PredicatesFilter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bootstrap", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bootstrap = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VirtualFilesFilter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.VirtualFilesFilter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GasPolicy) 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 ErrIntOverflowParams + } + 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: GasPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GasPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WeightingFactor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Uint + m.WeightingFactor = &v + if err := m.WeightingFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultPredicateCost", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Uint + m.DefaultPredicateCost = &v + if err := m.DefaultPredicateCost.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PredicateCosts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PredicateCosts = append(m.PredicateCosts, PredicateCost{}) + if err := m.PredicateCosts[len(m.PredicateCosts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PredicateCost) 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 ErrIntOverflowParams + } + 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: PredicateCost: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PredicateCost: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Predicate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Predicate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cost", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Uint + m.Cost = &v + if err := m.Cost.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/logic/legacy/v1beta2/types/query.pb.go b/x/logic/legacy/v1beta2/types/query.pb.go new file mode 100644 index 000000000..3009b892d --- /dev/null +++ b/x/logic/legacy/v1beta2/types/query.pb.go @@ -0,0 +1,1184 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: logic/v1beta2/query.proto + +package types + +import ( + context "context" + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryServiceParamsRequest is request type for the QueryService/Params RPC method. +type QueryServiceParamsRequest struct { +} + +func (m *QueryServiceParamsRequest) Reset() { *m = QueryServiceParamsRequest{} } +func (m *QueryServiceParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryServiceParamsRequest) ProtoMessage() {} +func (*QueryServiceParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_008a54e610b23239, []int{0} +} +func (m *QueryServiceParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryServiceParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryServiceParamsRequest.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 *QueryServiceParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryServiceParamsRequest.Merge(m, src) +} +func (m *QueryServiceParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryServiceParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryServiceParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryServiceParamsRequest proto.InternalMessageInfo + +// QueryServiceParamsResponse is response type for the QueryService/Params RPC method. +type QueryServiceParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params" yaml:"params",omitempty` +} + +func (m *QueryServiceParamsResponse) Reset() { *m = QueryServiceParamsResponse{} } +func (m *QueryServiceParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryServiceParamsResponse) ProtoMessage() {} +func (*QueryServiceParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_008a54e610b23239, []int{1} +} +func (m *QueryServiceParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryServiceParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryServiceParamsResponse.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 *QueryServiceParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryServiceParamsResponse.Merge(m, src) +} +func (m *QueryServiceParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryServiceParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryServiceParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryServiceParamsResponse proto.InternalMessageInfo + +func (m *QueryServiceParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// QueryServiceAskRequest is request type for the QueryService/Ask RPC method. +type QueryServiceAskRequest struct { + // program is the logic program to be queried. + Program string `protobuf:"bytes,1,opt,name=program,proto3" json:"program,omitempty" yaml:"program",omitempty` + // query is the query string to be executed. + Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty" yaml:"query",omitempty` + // limit specifies the maximum number of solutions to be returned. This field is governed by + // max_result_count, which defines the upper limit of results that may be requested per query. + // If this field is not explicitly set, a default value of 1 is applied. + Limit *cosmossdk_io_math.Uint `protobuf:"bytes,3,opt,name=limit,proto3,customtype=cosmossdk.io/math.Uint" json:"limit,omitempty" yaml:"limit",omitempty` +} + +func (m *QueryServiceAskRequest) Reset() { *m = QueryServiceAskRequest{} } +func (m *QueryServiceAskRequest) String() string { return proto.CompactTextString(m) } +func (*QueryServiceAskRequest) ProtoMessage() {} +func (*QueryServiceAskRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_008a54e610b23239, []int{2} +} +func (m *QueryServiceAskRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryServiceAskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryServiceAskRequest.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 *QueryServiceAskRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryServiceAskRequest.Merge(m, src) +} +func (m *QueryServiceAskRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryServiceAskRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryServiceAskRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryServiceAskRequest proto.InternalMessageInfo + +func (m *QueryServiceAskRequest) GetProgram() string { + if m != nil { + return m.Program + } + return "" +} + +func (m *QueryServiceAskRequest) GetQuery() string { + if m != nil { + return m.Query + } + return "" +} + +// QueryServiceAskResponse is response type for the QueryService/Ask RPC method. +type QueryServiceAskResponse struct { + // height is the block height at which the query was executed. + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty" yaml:"height",omitempty` + // gas_used is the amount of gas used to execute the query. + GasUsed uint64 `protobuf:"varint,2,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty" yaml:"gas_used",omitempty` + // answer is the answer to the query. + Answer *Answer `protobuf:"bytes,3,opt,name=answer,proto3" json:"answer,omitempty" yaml:"answer",omitempty` + // user_output is the output of the query execution, if any. + // the length of the output is limited by the max_query_output_size parameter. + UserOutput string `protobuf:"bytes,4,opt,name=user_output,json=userOutput,proto3" json:"user_output,omitempty" yaml:"user_output",omitempty` +} + +func (m *QueryServiceAskResponse) Reset() { *m = QueryServiceAskResponse{} } +func (m *QueryServiceAskResponse) String() string { return proto.CompactTextString(m) } +func (*QueryServiceAskResponse) ProtoMessage() {} +func (*QueryServiceAskResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_008a54e610b23239, []int{3} +} +func (m *QueryServiceAskResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryServiceAskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryServiceAskResponse.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 *QueryServiceAskResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryServiceAskResponse.Merge(m, src) +} +func (m *QueryServiceAskResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryServiceAskResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryServiceAskResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryServiceAskResponse proto.InternalMessageInfo + +func (m *QueryServiceAskResponse) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *QueryServiceAskResponse) GetGasUsed() uint64 { + if m != nil { + return m.GasUsed + } + return 0 +} + +func (m *QueryServiceAskResponse) GetAnswer() *Answer { + if m != nil { + return m.Answer + } + return nil +} + +func (m *QueryServiceAskResponse) GetUserOutput() string { + if m != nil { + return m.UserOutput + } + return "" +} + +func init() { + proto.RegisterType((*QueryServiceParamsRequest)(nil), "logic.v1beta2.QueryServiceParamsRequest") + proto.RegisterType((*QueryServiceParamsResponse)(nil), "logic.v1beta2.QueryServiceParamsResponse") + proto.RegisterType((*QueryServiceAskRequest)(nil), "logic.v1beta2.QueryServiceAskRequest") + proto.RegisterType((*QueryServiceAskResponse)(nil), "logic.v1beta2.QueryServiceAskResponse") +} + +func init() { proto.RegisterFile("logic/v1beta2/query.proto", fileDescriptor_008a54e610b23239) } + +var fileDescriptor_008a54e610b23239 = []byte{ + // 592 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x31, 0x6f, 0xd3, 0x40, + 0x18, 0xcd, 0xa5, 0x69, 0x80, 0x2b, 0x2c, 0x27, 0x68, 0x13, 0x27, 0xd8, 0x91, 0x51, 0x51, 0x41, + 0xd4, 0x6e, 0x53, 0x09, 0x55, 0xdd, 0x92, 0x09, 0x31, 0x14, 0x28, 0xea, 0xc2, 0x52, 0x5d, 0x92, + 0x93, 0x73, 0x8a, 0xed, 0x73, 0x7d, 0xe7, 0xd0, 0xac, 0xb0, 0xb0, 0x81, 0xc4, 0xc2, 0x82, 0xc4, + 0xc4, 0xcc, 0xcf, 0xc8, 0x58, 0x89, 0xa5, 0x62, 0xb0, 0x50, 0x82, 0xc4, 0xee, 0x5f, 0x80, 0x72, + 0xe7, 0x28, 0x76, 0x4b, 0x0b, 0x9b, 0xfd, 0xbd, 0xf7, 0xbe, 0xef, 0x7d, 0xef, 0xee, 0x60, 0xd5, + 0x65, 0x0e, 0xed, 0xda, 0xc3, 0xed, 0x0e, 0x11, 0xb8, 0x69, 0x1f, 0x47, 0x24, 0x1c, 0x59, 0x41, + 0xc8, 0x04, 0x43, 0xb7, 0x24, 0x64, 0xa5, 0x90, 0x56, 0xeb, 0x32, 0xee, 0x31, 0xae, 0x28, 0xf6, + 0x70, 0x3b, 0xcb, 0xd5, 0x6e, 0x3b, 0xcc, 0x61, 0xf2, 0xd3, 0x9e, 0x7d, 0xa5, 0xd5, 0xba, 0xc3, + 0x98, 0xe3, 0x12, 0x1b, 0x07, 0xd4, 0xc6, 0xbe, 0xcf, 0x04, 0x16, 0x94, 0xf9, 0x3c, 0x45, 0xb5, + 0xfc, 0xe8, 0x00, 0x87, 0xd8, 0x9b, 0x63, 0xe7, 0x6c, 0x89, 0x51, 0x40, 0x52, 0xc8, 0xac, 0xc1, + 0xea, 0x8b, 0xd9, 0xe4, 0x97, 0x24, 0x1c, 0xd2, 0x2e, 0x79, 0x2e, 0x65, 0x07, 0xe4, 0x38, 0x22, + 0x5c, 0x98, 0x2e, 0xd4, 0xfe, 0x06, 0xf2, 0x80, 0xf9, 0x9c, 0xa0, 0x7d, 0x58, 0x56, 0x53, 0x2a, + 0xa0, 0x01, 0x36, 0x56, 0x9a, 0x77, 0xac, 0xdc, 0x8a, 0x96, 0xa2, 0xb7, 0x8d, 0x71, 0x6c, 0x14, + 0x92, 0xd8, 0x58, 0x1b, 0x61, 0xcf, 0xdd, 0x33, 0x95, 0xc4, 0x7c, 0xc4, 0x3c, 0x2a, 0x88, 0x17, + 0x88, 0xd1, 0x41, 0xda, 0xc5, 0x3c, 0x03, 0x70, 0x35, 0x3b, 0xae, 0xc5, 0x07, 0xa9, 0x11, 0xf4, + 0x18, 0x5e, 0x0b, 0x42, 0xe6, 0x84, 0xd8, 0x93, 0xb3, 0x6e, 0xb4, 0xeb, 0x49, 0x6c, 0x54, 0xd2, + 0x86, 0x0a, 0xc8, 0x76, 0x9c, 0x93, 0xd1, 0x16, 0x5c, 0x96, 0xb9, 0x56, 0x8a, 0x52, 0xa5, 0x25, + 0xb1, 0xb1, 0xaa, 0x54, 0xb2, 0x9c, 0xd5, 0x28, 0x22, 0xda, 0x87, 0xcb, 0x2e, 0xf5, 0xa8, 0xa8, + 0x2c, 0x49, 0xc5, 0xee, 0x38, 0x36, 0xc0, 0x8f, 0xd8, 0x58, 0x55, 0xc7, 0xc5, 0x7b, 0x03, 0x8b, + 0x32, 0xdb, 0xc3, 0xa2, 0x6f, 0x1d, 0x52, 0x5f, 0x2c, 0xfa, 0x49, 0x51, 0xae, 0x9f, 0xac, 0xec, + 0x95, 0x3e, 0x7d, 0x31, 0x80, 0xf9, 0xb9, 0x08, 0xd7, 0x2e, 0xac, 0x96, 0xc6, 0xb8, 0x03, 0xcb, + 0x7d, 0x42, 0x9d, 0xbe, 0x90, 0xab, 0x95, 0xda, 0xb5, 0x45, 0x56, 0xaa, 0x9e, 0xcb, 0x4a, 0x95, + 0xd0, 0x2e, 0xbc, 0xee, 0x60, 0x7e, 0x14, 0x71, 0xd2, 0x93, 0xbb, 0x95, 0xda, 0x77, 0x93, 0xd8, + 0xa8, 0x2a, 0xd9, 0x1c, 0xc9, 0x45, 0xe2, 0x60, 0x7e, 0xc8, 0x49, 0x0f, 0x3d, 0x85, 0x65, 0xec, + 0xf3, 0xd7, 0x24, 0x94, 0x1b, 0x5e, 0x3c, 0xb5, 0x96, 0x04, 0xb3, 0x2e, 0x14, 0x3d, 0xe7, 0x42, + 0x95, 0x50, 0x0b, 0xae, 0x44, 0x9c, 0x84, 0x47, 0x2c, 0x12, 0x41, 0x24, 0x2a, 0x25, 0x19, 0x59, + 0x23, 0x89, 0x8d, 0xba, 0x52, 0x66, 0xc0, 0xac, 0x1c, 0xce, 0xea, 0xcf, 0x64, 0x59, 0xe5, 0xd3, + 0xfc, 0x5a, 0x84, 0x37, 0xb3, 0xf9, 0xa0, 0xf7, 0x00, 0x96, 0xd5, 0xfd, 0x41, 0x1b, 0xe7, 0x0c, + 0x5e, 0x7a, 0x5d, 0xb5, 0x07, 0xff, 0xc1, 0x54, 0xa1, 0x9b, 0x5b, 0xef, 0x7e, 0x7f, 0x7b, 0x08, + 0xde, 0x7c, 0xff, 0xf5, 0xb1, 0xb8, 0x8e, 0xee, 0xd9, 0xf8, 0x84, 0xf9, 0x64, 0x53, 0xbe, 0x88, + 0x2e, 0x73, 0xd5, 0x6f, 0xcf, 0x56, 0xaf, 0x46, 0xdd, 0x4e, 0xf4, 0x16, 0xc0, 0xa5, 0x16, 0x1f, + 0xa0, 0xf5, 0x2b, 0x86, 0x2c, 0x6e, 0xac, 0x76, 0xff, 0x5f, 0xb4, 0xd4, 0xc8, 0xe6, 0xc2, 0x88, + 0x89, 0x1a, 0x57, 0x1a, 0xc1, 0x7c, 0xd0, 0x7e, 0x32, 0x9e, 0xe8, 0xe0, 0x74, 0xa2, 0x83, 0x9f, + 0x13, 0x1d, 0x7c, 0x98, 0xea, 0x85, 0xd3, 0xa9, 0x5e, 0x38, 0x9b, 0xea, 0x85, 0x57, 0x96, 0x43, + 0x45, 0x3f, 0xea, 0x58, 0x5d, 0xe6, 0x5d, 0xd2, 0xe5, 0x24, 0xed, 0x23, 0x9f, 0x7f, 0xa7, 0x2c, + 0xe1, 0x9d, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe7, 0x25, 0x50, 0x93, 0xb3, 0x04, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryServiceClient is the client API for QueryService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryServiceClient interface { + // Params queries all parameters for the logic module. + Params(ctx context.Context, in *QueryServiceParamsRequest, opts ...grpc.CallOption) (*QueryServiceParamsResponse, error) + // Ask executes a logic query and returns the solutions found. + // Since the query is without any side-effect, the query is not executed in the context of a transaction and no fee + // is charged for this, but the execution is constrained by the current limits configured in the module. + Ask(ctx context.Context, in *QueryServiceAskRequest, opts ...grpc.CallOption) (*QueryServiceAskResponse, error) +} + +type queryServiceClient struct { + cc grpc1.ClientConn +} + +func NewQueryServiceClient(cc grpc1.ClientConn) QueryServiceClient { + return &queryServiceClient{cc} +} + +func (c *queryServiceClient) Params(ctx context.Context, in *QueryServiceParamsRequest, opts ...grpc.CallOption) (*QueryServiceParamsResponse, error) { + out := new(QueryServiceParamsResponse) + err := c.cc.Invoke(ctx, "/logic.v1beta2.QueryService/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryServiceClient) Ask(ctx context.Context, in *QueryServiceAskRequest, opts ...grpc.CallOption) (*QueryServiceAskResponse, error) { + out := new(QueryServiceAskResponse) + err := c.cc.Invoke(ctx, "/logic.v1beta2.QueryService/Ask", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServiceServer is the server API for QueryService service. +type QueryServiceServer interface { + // Params queries all parameters for the logic module. + Params(context.Context, *QueryServiceParamsRequest) (*QueryServiceParamsResponse, error) + // Ask executes a logic query and returns the solutions found. + // Since the query is without any side-effect, the query is not executed in the context of a transaction and no fee + // is charged for this, but the execution is constrained by the current limits configured in the module. + Ask(context.Context, *QueryServiceAskRequest) (*QueryServiceAskResponse, error) +} + +// UnimplementedQueryServiceServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServiceServer struct { +} + +func (*UnimplementedQueryServiceServer) Params(ctx context.Context, req *QueryServiceParamsRequest) (*QueryServiceParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServiceServer) Ask(ctx context.Context, req *QueryServiceAskRequest) (*QueryServiceAskResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ask not implemented") +} + +func RegisterQueryServiceServer(s grpc1.Server, srv QueryServiceServer) { + s.RegisterService(&_QueryService_serviceDesc, srv) +} + +func _QueryService_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryServiceParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServiceServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/logic.v1beta2.QueryService/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServiceServer).Params(ctx, req.(*QueryServiceParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _QueryService_Ask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryServiceAskRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServiceServer).Ask(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/logic.v1beta2.QueryService/Ask", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServiceServer).Ask(ctx, req.(*QueryServiceAskRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _QueryService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "logic.v1beta2.QueryService", + HandlerType: (*QueryServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _QueryService_Params_Handler, + }, + { + MethodName: "Ask", + Handler: _QueryService_Ask_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "logic/v1beta2/query.proto", +} + +func (m *QueryServiceParamsRequest) 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 *QueryServiceParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryServiceParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryServiceParamsResponse) 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 *QueryServiceParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryServiceParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + 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 (m *QueryServiceAskRequest) 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 *QueryServiceAskRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryServiceAskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Limit != nil { + { + size := m.Limit.Size() + i -= size + if _, err := m.Limit.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Query) > 0 { + i -= len(m.Query) + copy(dAtA[i:], m.Query) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Query))) + i-- + dAtA[i] = 0x12 + } + if len(m.Program) > 0 { + i -= len(m.Program) + copy(dAtA[i:], m.Program) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Program))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryServiceAskResponse) 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 *QueryServiceAskResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryServiceAskResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.UserOutput) > 0 { + i -= len(m.UserOutput) + copy(dAtA[i:], m.UserOutput) + i = encodeVarintQuery(dAtA, i, uint64(len(m.UserOutput))) + i-- + dAtA[i] = 0x22 + } + if m.Answer != nil { + { + size, err := m.Answer.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.GasUsed != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.GasUsed)) + i-- + dAtA[i] = 0x10 + } + if m.Height != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryServiceParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryServiceParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryServiceAskRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Program) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Query) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Limit != nil { + l = m.Limit.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryServiceAskResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovQuery(uint64(m.Height)) + } + if m.GasUsed != 0 { + n += 1 + sovQuery(uint64(m.GasUsed)) + } + if m.Answer != nil { + l = m.Answer.Size() + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.UserOutput) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryServiceParamsRequest) 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: QueryServiceParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryServiceParamsRequest: 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryServiceParamsResponse) 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: QueryServiceParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryServiceParamsResponse: 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 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryServiceAskRequest) 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: QueryServiceAskRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryServiceAskRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Program", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Program = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Query = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Uint + m.Limit = &v + if err := m.Limit.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryServiceAskResponse) 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: QueryServiceAskResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryServiceAskResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) + } + m.GasUsed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GasUsed |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Answer", 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.Answer == nil { + m.Answer = &Answer{} + } + if err := m.Answer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UserOutput", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UserOutput = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/logic/legacy/v1beta2/types/tx.pb.go b/x/logic/legacy/v1beta2/types/tx.pb.go new file mode 100644 index 000000000..599b1f509 --- /dev/null +++ b/x/logic/legacy/v1beta2/types/tx.pb.go @@ -0,0 +1,594 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: logic/v1beta2/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgUpdateParams defines a Msg for updating the x/logic module parameters. +type MsgUpdateParams struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/logic parameters to update. + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_19bfd5fc1a0735fe, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_19bfd5fc1a0735fe, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "logic.v1beta2.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "logic.v1beta2.MsgUpdateParamsResponse") +} + +func init() { proto.RegisterFile("logic/v1beta2/tx.proto", fileDescriptor_19bfd5fc1a0735fe) } + +var fileDescriptor_19bfd5fc1a0735fe = []byte{ + // 320 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcb, 0xc9, 0x4f, 0xcf, + 0x4c, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd2, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, + 0x2f, 0xc9, 0x17, 0xe2, 0x05, 0x8b, 0xeb, 0x41, 0xc5, 0xa5, 0xc4, 0x93, 0xf3, 0x8b, 0x73, 0xf3, + 0x8b, 0xf5, 0x73, 0x8b, 0xd3, 0xf5, 0xcb, 0x0c, 0x41, 0x14, 0x44, 0x9d, 0x94, 0x24, 0x44, 0x22, + 0x1e, 0xcc, 0xd3, 0x87, 0x70, 0xa0, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x10, 0x71, 0x10, 0x0b, + 0x2a, 0x2a, 0x85, 0x6a, 0x61, 0x41, 0x62, 0x51, 0x62, 0x2e, 0x54, 0x87, 0x52, 0x1f, 0x23, 0x17, + 0xbf, 0x6f, 0x71, 0x7a, 0x68, 0x41, 0x4a, 0x62, 0x49, 0x6a, 0x00, 0x58, 0x46, 0xc8, 0x8c, 0x8b, + 0x33, 0xb1, 0xb4, 0x24, 0x23, 0xbf, 0x28, 0xb3, 0xa4, 0x52, 0x82, 0x51, 0x81, 0x51, 0x83, 0xd3, + 0x49, 0xe2, 0xd2, 0x16, 0x5d, 0x11, 0xa8, 0x55, 0x8e, 0x29, 0x29, 0x45, 0xa9, 0xc5, 0xc5, 0xc1, + 0x25, 0x45, 0x99, 0x79, 0xe9, 0x41, 0x08, 0xa5, 0x42, 0xc6, 0x5c, 0x6c, 0x10, 0xb3, 0x25, 0x98, + 0x14, 0x18, 0x35, 0xb8, 0x8d, 0x44, 0xf5, 0x50, 0x7c, 0xa4, 0x07, 0x31, 0xde, 0x89, 0xe5, 0xc4, + 0x3d, 0x79, 0x86, 0x20, 0xa8, 0x52, 0x2b, 0xbe, 0xa6, 0xe7, 0x1b, 0xb4, 0x10, 0x86, 0x28, 0x49, + 0x72, 0x89, 0xa3, 0xb9, 0x27, 0x28, 0xb5, 0xb8, 0x20, 0x3f, 0xaf, 0x38, 0xd5, 0x28, 0x85, 0x8b, + 0xcb, 0xb7, 0x38, 0x3d, 0x38, 0xb5, 0xa8, 0x2c, 0x33, 0x39, 0x55, 0x28, 0x8c, 0x8b, 0x07, 0xc5, + 0xd5, 0x72, 0x68, 0xb6, 0xa1, 0x99, 0x22, 0xa5, 0x86, 0x5f, 0x1e, 0x66, 0x8b, 0x93, 0xc7, 0x89, + 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, + 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xe9, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, + 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x27, 0x56, 0xe4, 0xe7, 0xa5, 0xea, 0x82, 0xc3, 0x30, 0x39, 0x3f, + 0x07, 0xc2, 0x4d, 0xd1, 0xaf, 0xd0, 0x87, 0x04, 0x75, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, + 0x58, 0xda, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x06, 0xfc, 0x7f, 0xed, 0xf1, 0x01, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgServiceClient is the client API for MsgService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgServiceClient interface { + // UpdateParams defined a governance operation for updating the x/logic module parameters. + // The authority is hard-coded to the Cosmos SDK x/gov module account + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgServiceClient struct { + cc grpc1.ClientConn +} + +func NewMsgServiceClient(cc grpc1.ClientConn) MsgServiceClient { + return &msgServiceClient{cc} +} + +func (c *msgServiceClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/logic.v1beta2.MsgService/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServiceServer is the server API for MsgService service. +type MsgServiceServer interface { + // UpdateParams defined a governance operation for updating the x/logic module parameters. + // The authority is hard-coded to the Cosmos SDK x/gov module account + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServiceServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServiceServer struct { +} + +func (*UnimplementedMsgServiceServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} + +func RegisterMsgServiceServer(s grpc1.Server, srv MsgServiceServer) { + s.RegisterService(&_MsgService_serviceDesc, srv) +} + +func _MsgService_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServiceServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/logic.v1beta2.MsgService/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServiceServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +var _MsgService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "logic.v1beta2.MsgService", + HandlerType: (*MsgServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _MsgService_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "logic/v1beta2/tx.proto", +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateParams) 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 ErrIntOverflowTx + } + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/logic/legacy/v1beta2/types/types.pb.go b/x/logic/legacy/v1beta2/types/types.pb.go new file mode 100644 index 000000000..a3c23e754 --- /dev/null +++ b/x/logic/legacy/v1beta2/types/types.pb.go @@ -0,0 +1,901 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: logic/v1beta2/types.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Substitution represents a substitution made to the variables in the query to obtain the answer. +type Substitution struct { + // variable is the name of the variable. + Variable string `protobuf:"bytes,1,opt,name=variable,proto3" json:"variable,omitempty" yaml:"variable",omitempty` + // expression is the value substituted for the variable, represented directly as a Prolog term (e.g., atom, number, compound). + Expression string `protobuf:"bytes,2,opt,name=expression,proto3" json:"expression,omitempty" yaml:"expression",omitempty` +} + +func (m *Substitution) Reset() { *m = Substitution{} } +func (m *Substitution) String() string { return proto.CompactTextString(m) } +func (*Substitution) ProtoMessage() {} +func (*Substitution) Descriptor() ([]byte, []int) { + return fileDescriptor_f3c73c95465ca7a8, []int{0} +} +func (m *Substitution) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Substitution) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Substitution.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 *Substitution) XXX_Merge(src proto.Message) { + xxx_messageInfo_Substitution.Merge(m, src) +} +func (m *Substitution) XXX_Size() int { + return m.Size() +} +func (m *Substitution) XXX_DiscardUnknown() { + xxx_messageInfo_Substitution.DiscardUnknown(m) +} + +var xxx_messageInfo_Substitution proto.InternalMessageInfo + +func (m *Substitution) GetVariable() string { + if m != nil { + return m.Variable + } + return "" +} + +func (m *Substitution) GetExpression() string { + if m != nil { + return m.Expression + } + return "" +} + +// Result represents the result of a query. +type Result struct { + // error specifies the error message if the query caused an error. + Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty" yaml:"error",omitempty` + // substitutions represent all the substitutions made to the variables in the query to obtain the answer. + Substitutions []Substitution `protobuf:"bytes,2,rep,name=substitutions,proto3" json:"substitutions" yaml:"substitutions",omitempty` +} + +func (m *Result) Reset() { *m = Result{} } +func (m *Result) String() string { return proto.CompactTextString(m) } +func (*Result) ProtoMessage() {} +func (*Result) Descriptor() ([]byte, []int) { + return fileDescriptor_f3c73c95465ca7a8, []int{1} +} +func (m *Result) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Result.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 *Result) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result.Merge(m, src) +} +func (m *Result) XXX_Size() int { + return m.Size() +} +func (m *Result) XXX_DiscardUnknown() { + xxx_messageInfo_Result.DiscardUnknown(m) +} + +var xxx_messageInfo_Result proto.InternalMessageInfo + +func (m *Result) GetError() string { + if m != nil { + return m.Error + } + return "" +} + +func (m *Result) GetSubstitutions() []Substitution { + if m != nil { + return m.Substitutions + } + return nil +} + +// Answer represents the answer to a logic query. +type Answer struct { + // has_more specifies if there are more solutions than the ones returned. + HasMore bool `protobuf:"varint,2,opt,name=has_more,json=hasMore,proto3" json:"has_more,omitempty" yaml:"has_more",omitempty` + // variables represent all the variables in the query. + Variables []string `protobuf:"bytes,3,rep,name=variables,proto3" json:"variables,omitempty" yaml:"variables",omitempty` + // results represent all the results of the query. + Results []Result `protobuf:"bytes,4,rep,name=results,proto3" json:"results" yaml:"results",omitempty` +} + +func (m *Answer) Reset() { *m = Answer{} } +func (m *Answer) String() string { return proto.CompactTextString(m) } +func (*Answer) ProtoMessage() {} +func (*Answer) Descriptor() ([]byte, []int) { + return fileDescriptor_f3c73c95465ca7a8, []int{2} +} +func (m *Answer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Answer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Answer.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 *Answer) XXX_Merge(src proto.Message) { + xxx_messageInfo_Answer.Merge(m, src) +} +func (m *Answer) XXX_Size() int { + return m.Size() +} +func (m *Answer) XXX_DiscardUnknown() { + xxx_messageInfo_Answer.DiscardUnknown(m) +} + +var xxx_messageInfo_Answer proto.InternalMessageInfo + +func (m *Answer) GetHasMore() bool { + if m != nil { + return m.HasMore + } + return false +} + +func (m *Answer) GetVariables() []string { + if m != nil { + return m.Variables + } + return nil +} + +func (m *Answer) GetResults() []Result { + if m != nil { + return m.Results + } + return nil +} + +func init() { + proto.RegisterType((*Substitution)(nil), "logic.v1beta2.Substitution") + proto.RegisterType((*Result)(nil), "logic.v1beta2.Result") + proto.RegisterType((*Answer)(nil), "logic.v1beta2.Answer") +} + +func init() { proto.RegisterFile("logic/v1beta2/types.proto", fileDescriptor_f3c73c95465ca7a8) } + +var fileDescriptor_f3c73c95465ca7a8 = []byte{ + // 411 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0xb1, 0xae, 0xd3, 0x30, + 0x18, 0x85, 0xe3, 0xdb, 0x7b, 0x7b, 0x7b, 0x0d, 0x77, 0xb1, 0x00, 0xe5, 0xb6, 0xc2, 0x8e, 0x32, + 0xa0, 0x0e, 0x90, 0x88, 0xc2, 0x00, 0x15, 0x12, 0x22, 0x13, 0x0b, 0x03, 0x65, 0x63, 0x41, 0x49, + 0xb1, 0x52, 0x4b, 0x49, 0x1c, 0xd9, 0x4e, 0x69, 0xdf, 0xa2, 0x23, 0x23, 0x6f, 0xc0, 0x6b, 0x74, + 0xec, 0x08, 0x4b, 0x84, 0xda, 0x37, 0xc8, 0x13, 0xa0, 0xda, 0x29, 0x75, 0xd8, 0x92, 0x7c, 0xff, + 0x39, 0xf9, 0xcf, 0xd1, 0x0f, 0xef, 0x32, 0x9e, 0xb2, 0x79, 0xb8, 0x7c, 0x9e, 0x50, 0x15, 0x4f, + 0x42, 0xb5, 0x2e, 0xa9, 0x0c, 0x4a, 0xc1, 0x15, 0x47, 0xb7, 0x1a, 0x05, 0x2d, 0x1a, 0x3e, 0x48, + 0x79, 0xca, 0x35, 0x09, 0x8f, 0x4f, 0x66, 0xc8, 0xdf, 0x00, 0x78, 0xff, 0x53, 0x95, 0x48, 0xc5, + 0x54, 0xa5, 0x18, 0x2f, 0xd0, 0x6b, 0x38, 0x58, 0xc6, 0x82, 0xc5, 0x49, 0x46, 0x5d, 0xe0, 0x81, + 0xf1, 0x4d, 0xf4, 0xb8, 0xa9, 0xc9, 0xdd, 0x3a, 0xce, 0xb3, 0xa9, 0x7f, 0x22, 0xfe, 0x53, 0x9e, + 0x33, 0x45, 0xf3, 0x52, 0xad, 0x67, 0xff, 0xc6, 0xd1, 0x5b, 0x08, 0xe9, 0xaa, 0x14, 0x54, 0x4a, + 0xc6, 0x0b, 0xf7, 0x42, 0x8b, 0x49, 0x53, 0x93, 0x91, 0x11, 0x9f, 0x99, 0x2d, 0xb7, 0x24, 0xd3, + 0xcb, 0xef, 0x3f, 0x08, 0xf0, 0x7f, 0x02, 0xd8, 0x9f, 0x51, 0x59, 0x65, 0x0a, 0xbd, 0x84, 0x57, + 0x54, 0x08, 0x2e, 0xdc, 0x2b, 0x6d, 0x86, 0xb7, 0x35, 0x01, 0x4d, 0x4d, 0x1e, 0xb5, 0x86, 0x47, + 0x64, 0x7b, 0x99, 0x61, 0xc4, 0xe0, 0xad, 0xb4, 0x22, 0x49, 0xf7, 0xc2, 0xeb, 0x8d, 0xef, 0x4d, + 0x46, 0x41, 0xa7, 0x90, 0xc0, 0x8e, 0x1d, 0x3d, 0xd9, 0xd6, 0xc4, 0x69, 0x6a, 0x82, 0x8d, 0x75, + 0x47, 0x6f, 0xff, 0xa2, 0xeb, 0xdc, 0x6e, 0xfc, 0x1b, 0xc0, 0xfe, 0xbb, 0x42, 0x7e, 0xa3, 0x02, + 0xbd, 0x82, 0x83, 0x45, 0x2c, 0xbf, 0xe4, 0x5c, 0x50, 0xdd, 0xc0, 0xc0, 0xae, 0xef, 0x44, 0x6c, + 0xc3, 0xeb, 0x45, 0x2c, 0x3f, 0x70, 0x41, 0xd1, 0x1b, 0x78, 0x73, 0x6a, 0x52, 0xba, 0x3d, 0xaf, + 0x77, 0xcc, 0xdb, 0xd4, 0x64, 0xd8, 0x6d, 0xbe, 0xb3, 0xcc, 0x59, 0x80, 0x3e, 0xc2, 0x6b, 0xa1, + 0x3b, 0x93, 0xee, 0xa5, 0x4e, 0xfb, 0xf0, 0xbf, 0xb4, 0xa6, 0xd1, 0xc8, 0x6b, 0x73, 0xba, 0xc6, + 0xb6, 0xd5, 0x74, 0x16, 0x6a, 0xbf, 0x99, 0x6c, 0xd1, 0xfb, 0xed, 0x1e, 0x83, 0xdd, 0x1e, 0x83, + 0x3f, 0x7b, 0x0c, 0x36, 0x07, 0xec, 0xec, 0x0e, 0xd8, 0xf9, 0x75, 0xc0, 0xce, 0xe7, 0x20, 0x65, + 0x6a, 0x51, 0x25, 0xc1, 0x9c, 0xe7, 0x61, 0xbc, 0xe2, 0x05, 0x7d, 0xa6, 0x4f, 0x6a, 0xce, 0x33, + 0xf3, 0xfa, 0x35, 0x5c, 0x85, 0xe6, 0x3a, 0xf5, 0x55, 0x26, 0x7d, 0x8d, 0x5f, 0xfc, 0x0d, 0x00, + 0x00, 0xff, 0xff, 0x01, 0xe7, 0x0f, 0xdf, 0xb3, 0x02, 0x00, 0x00, +} + +func (m *Substitution) 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 *Substitution) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Substitution) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Expression) > 0 { + i -= len(m.Expression) + copy(dAtA[i:], m.Expression) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Expression))) + i-- + dAtA[i] = 0x12 + } + if len(m.Variable) > 0 { + i -= len(m.Variable) + copy(dAtA[i:], m.Variable) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Variable))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Result) 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 *Result) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0x2a + } + if len(m.Substitutions) > 0 { + for iNdEx := len(m.Substitutions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Substitutions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + return len(dAtA) - i, nil +} + +func (m *Answer) 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 *Answer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Answer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Results) > 0 { + for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Results[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Variables) > 0 { + for iNdEx := len(m.Variables) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Variables[iNdEx]) + copy(dAtA[i:], m.Variables[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Variables[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if m.HasMore { + i-- + if m.HasMore { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Substitution) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Variable) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Expression) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *Result) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Substitutions) > 0 { + for _, e := range m.Substitutions { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + l = len(m.Error) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *Answer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HasMore { + n += 2 + } + if len(m.Variables) > 0 { + for _, s := range m.Variables { + l = len(s) + n += 1 + l + sovTypes(uint64(l)) + } + } + if len(m.Results) > 0 { + for _, e := range m.Results { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Substitution) 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 ErrIntOverflowTypes + } + 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: Substitution: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Substitution: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Variable", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Variable = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expression", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Expression = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Result) 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 ErrIntOverflowTypes + } + 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: Result: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Result: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Substitutions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Substitutions = append(m.Substitutions, Substitution{}) + if err := m.Substitutions[len(m.Substitutions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Answer) 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 ErrIntOverflowTypes + } + 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: Answer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Answer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HasMore", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.HasMore = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Variables", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Variables = append(m.Variables, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Results = append(m.Results, Result{}) + if err := m.Results[len(m.Results)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTypes(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTypes + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTypes + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTypes + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTypes + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/logic/module.go b/x/logic/module.go index 1ae088462..f135e71aa 100644 --- a/x/logic/module.go +++ b/x/logic/module.go @@ -124,6 +124,10 @@ func (am AppModule) IsAppModule() {} func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServiceServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServiceServer(cfg.QueryServer(), am.keeper) + + if err := cfg.RegisterMigration(types.ModuleName, 3, keeper.MigrateStoreV3ToV4(am.keeper)); err != nil { + panic(err) + } } // InitGenesis performs the module's genesis initialization. It returns no validator updates. @@ -143,7 +147,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw // ConsensusVersion is a sequence number for state-breaking change of the module. It should be incremented on each // consensus-breaking change introduced by the module. To avoid wrong/empty versions, the initial version should be set to 1. -func (AppModule) ConsensusVersion() uint64 { return 3 } +func (AppModule) ConsensusVersion() uint64 { return 4 } // BeginBlock contains the logic that is automatically triggered at the beginning of each block. func (am AppModule) BeginBlock(_ context.Context) error {