diff --git a/app/app.go b/app/app.go index b26ecbe..a596fa4 100644 --- a/app/app.go +++ b/app/app.go @@ -1002,4 +1002,7 @@ func (app *App) setupUpgradeHandlers() { app.UpgradeKeeper.SetUpgradeHandler("v0.10.5", func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { return app.mm.RunMigrations(ctx, app.configurator, fromVM) }) + app.UpgradeKeeper.SetUpgradeHandler("v0.11.0", func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return app.mm.RunMigrations(ctx, app.configurator, fromVM) + }) } diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index b222602..1bd2c66 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -47505,6 +47505,39 @@ paths: type: boolean tags: - Query + /planetmint/machine/activated_trust_anchor_count: + get: + summary: Queries a list of ActivatedTrustAnchorCount items. + operationId: PlanetmintgoMachineActivatedTrustAnchorCount + responses: + '200': + description: A successful response. + schema: + type: object + properties: + count: + type: string + format: uint64 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query /planetmint/machine/active_trust_anchor_count: get: summary: Queries a list of ActiveTrustAnchorCount items. @@ -77230,6 +77263,12 @@ definitions: dao_machine_funding_denom: type: string description: Params defines the parameters for the module. + planetmintgo.machine.QueryActivatedTrustAnchorCountResponse: + type: object + properties: + count: + type: string + format: uint64 planetmintgo.machine.QueryActiveTrustAnchorCountResponse: type: object properties: diff --git a/proto/planetmintgo/machine/query.proto b/proto/planetmintgo/machine/query.proto index af5d744..d254adf 100644 --- a/proto/planetmintgo/machine/query.proto +++ b/proto/planetmintgo/machine/query.proto @@ -47,6 +47,11 @@ service Query { // Queries a list of ActiveTrustAnchorCount items. rpc ActiveTrustAnchorCount (QueryActiveTrustAnchorCountRequest) returns (QueryActiveTrustAnchorCountResponse) { option (google.api.http).get = "/planetmint/machine/active_trust_anchor_count"; + } + + // Queries a list of ActivatedTrustAnchorCount items. + rpc ActivatedTrustAnchorCount (QueryActivatedTrustAnchorCountRequest) returns (QueryActivatedTrustAnchorCountResponse) { + option (google.api.http).get = "/planetmint/machine/activated_trust_anchor_count"; } } @@ -99,3 +104,9 @@ message QueryActiveTrustAnchorCountResponse { uint64 count = 1; } +message QueryActivatedTrustAnchorCountRequest {} + +message QueryActivatedTrustAnchorCountResponse { + uint64 count = 1; +} + diff --git a/x/machine/client/cli/query.go b/x/machine/client/cli/query.go index b2f29e5..68cf88b 100644 --- a/x/machine/client/cli/query.go +++ b/x/machine/client/cli/query.go @@ -33,6 +33,7 @@ func GetQueryCmd(_ string) *cobra.Command { cmd.AddCommand(CmdGetLiquidAssetsByMachineid()) cmd.AddCommand(CmdActiveTrustAnchorCount()) + cmd.AddCommand(CmdActivatedTrustAnchorCount()) // this line is used by starport scaffolding # 1 diff --git a/x/machine/client/cli/query_activated_trust_anchor_count.go b/x/machine/client/cli/query_activated_trust_anchor_count.go new file mode 100644 index 0000000..91d4c6e --- /dev/null +++ b/x/machine/client/cli/query_activated_trust_anchor_count.go @@ -0,0 +1,41 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/planetmint/planetmint-go/x/machine/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdActivatedTrustAnchorCount() *cobra.Command { + cmd := &cobra.Command{ + Use: "activated-trust-anchor-count", + Short: "Query activated-trust-anchor-count", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryActivatedTrustAnchorCountRequest{} + + res, err := queryClient.ActivatedTrustAnchorCount(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/machine/keeper/migrations.go b/x/machine/keeper/migrations.go index decb5a1..668d453 100644 --- a/x/machine/keeper/migrations.go +++ b/x/machine/keeper/migrations.go @@ -3,6 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" v2 "github.com/planetmint/planetmint-go/x/machine/migrations/v2" + v3 "github.com/planetmint/planetmint-go/x/machine/migrations/v3" ) // Migrator is a struct for handling in-place store migrations. @@ -19,3 +20,7 @@ func NewMigrator(keeper Keeper) Migrator { func (m Migrator) Migrate1to2(ctx sdk.Context) error { return v2.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc) } + +func (m Migrator) Migrate2to3(ctx sdk.Context) error { + return v3.MigrateStore(ctx, m.keeper.taStoreKey, m.keeper.cdc) +} diff --git a/x/machine/keeper/query_activated_trust_anchor_count.go b/x/machine/keeper/query_activated_trust_anchor_count.go new file mode 100644 index 0000000..88b93eb --- /dev/null +++ b/x/machine/keeper/query_activated_trust_anchor_count.go @@ -0,0 +1,21 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/planetmint/planetmint-go/x/machine/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) ActivatedTrustAnchorCount(goCtx context.Context, req *types.QueryActivatedTrustAnchorCountRequest) (*types.QueryActivatedTrustAnchorCountResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + count := k.GetActivatedTACount(ctx) + + return &types.QueryActivatedTrustAnchorCountResponse{Count: count}, nil +} diff --git a/x/machine/keeper/query_activated_trust_anchor_count_test.go b/x/machine/keeper/query_activated_trust_anchor_count_test.go new file mode 100644 index 0000000..86d5a0a --- /dev/null +++ b/x/machine/keeper/query_activated_trust_anchor_count_test.go @@ -0,0 +1,19 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + keepertest "github.com/planetmint/planetmint-go/testutil/keeper" + "github.com/planetmint/planetmint-go/x/machine/types" + "github.com/stretchr/testify/assert" +) + +func TestActivatedTrustAnchorCount(t *testing.T) { + keeper, ctx := keepertest.MachineKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + createNTrustAnchor(t, keeper, ctx, 100) + response, err := keeper.ActivatedTrustAnchorCount(wctx, &types.QueryActivatedTrustAnchorCountRequest{}) + assert.NoError(t, err) + assert.Equal(t, uint64(50), response.Count) +} diff --git a/x/machine/keeper/trust_anchor.go b/x/machine/keeper/trust_anchor.go index 55ce039..b40f6a1 100644 --- a/x/machine/keeper/trust_anchor.go +++ b/x/machine/keeper/trust_anchor.go @@ -1,6 +1,7 @@ package keeper import ( + "encoding/binary" "errors" "github.com/planetmint/planetmint-go/util" @@ -16,6 +17,8 @@ func (k Keeper) StoreTrustAnchor(ctx sdk.Context, ta types.TrustAnchor, activate var appendValue []byte if activated { appendValue = []byte{1} + counter := k.GetActivatedTACount(ctx) + k.setActivatedTACount(ctx, counter+1) } else { appendValue = []byte{0} } @@ -46,3 +49,20 @@ func (k Keeper) GetTrustAnchor(ctx sdk.Context, pubKey string) (val types.TrustA } return val, false, true } + +func (k Keeper) setActivatedTACount(ctx sdk.Context, counter uint64) { + taCounterStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ActivatedTACounterPrefix)) + bz := make([]byte, 8) + binary.BigEndian.PutUint64(bz, counter) + taCounterStore.Set([]byte{1}, bz) +} + +func (k Keeper) GetActivatedTACount(ctx sdk.Context) (counter uint64) { + taCounterStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ActivatedTACounterPrefix)) + bz := taCounterStore.Get([]byte{1}) + if bz == nil { + return 0 + } + counter = binary.BigEndian.Uint64(bz) + return +} diff --git a/x/machine/keeper/trust_anchor_test.go b/x/machine/keeper/trust_anchor_test.go index 6962bba..412c10b 100644 --- a/x/machine/keeper/trust_anchor_test.go +++ b/x/machine/keeper/trust_anchor_test.go @@ -69,3 +69,11 @@ func TestUpdateTrustAnchor(t *testing.T) { assert.True(t, activated) } } + +func TestActivatedTACounter(t *testing.T) { + t.Parallel() + keeper, ctx := keepertest.MachineKeeper(t) + createNTrustAnchor(t, keeper, ctx, 100) + counter := keeper.GetActivatedTACount(ctx) + assert.Equal(t, uint64(50), counter) +} diff --git a/x/machine/migrations/v3/migrate.go b/x/machine/migrations/v3/migrate.go new file mode 100644 index 0000000..7cb67d5 --- /dev/null +++ b/x/machine/migrations/v3/migrate.go @@ -0,0 +1,31 @@ +package v3 + +import ( + "encoding/binary" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/store/prefix" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/planetmint/planetmint-go/x/machine/types" +) + +func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, _ codec.BinaryCodec) error { + store := prefix.NewStore(ctx.KVStore(storeKey), types.KeyPrefix(types.TrustAnchorKey)) + + count := uint64(0) + iterator := store.Iterator(nil, nil) + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + if iterator.Value()[0] == 1 { + count++ + } + } + + bz := make([]byte, 8) + binary.BigEndian.PutUint64(bz, count) + countStore := prefix.NewStore(ctx.KVStore(storeKey), types.KeyPrefix(types.ActivatedTACounterPrefix)) + countStore.Set([]byte{1}, bz) + + return nil +} diff --git a/x/machine/module.go b/x/machine/module.go index c028031..db9a783 100644 --- a/x/machine/module.go +++ b/x/machine/module.go @@ -121,6 +121,9 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { if err := cfg.RegisterMigration(types.ModuleName, 2, m.Migrate1to2); err != nil { panic(fmt.Errorf("failed to register migration of %s to v2: %w", types.ModuleName, err)) } + if err := cfg.RegisterMigration(types.ModuleName, 3, m.Migrate2to3); err != nil { + panic(fmt.Errorf("failed to register migration of %s to v3: %w", types.ModuleName, err)) + } } // RegisterInvariants registers the invariants of the module. If an invariant deviates from its predicted value, the InvariantRegistry triggers appropriate logic (most often the chain will be halted) diff --git a/x/machine/types/keys.go b/x/machine/types/keys.go index a6860ab..0fb0932 100644 --- a/x/machine/types/keys.go +++ b/x/machine/types/keys.go @@ -28,6 +28,8 @@ const ( LiquidAssetKey = "Machine/LiquidAsset/" ParamsKey = "Machine/Params" + + ActivatedTACounterPrefix = "ActivatedTACounter" ) func KeyPrefix(p string) []byte { diff --git a/x/machine/types/query.pb.go b/x/machine/types/query.pb.go index 4fa362c..2b53648 100644 --- a/x/machine/types/query.pb.go +++ b/x/machine/types/query.pb.go @@ -557,6 +557,88 @@ func (m *QueryActiveTrustAnchorCountResponse) GetCount() uint64 { return 0 } +type QueryActivatedTrustAnchorCountRequest struct { +} + +func (m *QueryActivatedTrustAnchorCountRequest) Reset() { *m = QueryActivatedTrustAnchorCountRequest{} } +func (m *QueryActivatedTrustAnchorCountRequest) String() string { return proto.CompactTextString(m) } +func (*QueryActivatedTrustAnchorCountRequest) ProtoMessage() {} +func (*QueryActivatedTrustAnchorCountRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_bf7841d43d757203, []int{12} +} +func (m *QueryActivatedTrustAnchorCountRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryActivatedTrustAnchorCountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryActivatedTrustAnchorCountRequest.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 *QueryActivatedTrustAnchorCountRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryActivatedTrustAnchorCountRequest.Merge(m, src) +} +func (m *QueryActivatedTrustAnchorCountRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryActivatedTrustAnchorCountRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryActivatedTrustAnchorCountRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryActivatedTrustAnchorCountRequest proto.InternalMessageInfo + +type QueryActivatedTrustAnchorCountResponse struct { + Count uint64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (m *QueryActivatedTrustAnchorCountResponse) Reset() { + *m = QueryActivatedTrustAnchorCountResponse{} +} +func (m *QueryActivatedTrustAnchorCountResponse) String() string { return proto.CompactTextString(m) } +func (*QueryActivatedTrustAnchorCountResponse) ProtoMessage() {} +func (*QueryActivatedTrustAnchorCountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bf7841d43d757203, []int{13} +} +func (m *QueryActivatedTrustAnchorCountResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryActivatedTrustAnchorCountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryActivatedTrustAnchorCountResponse.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 *QueryActivatedTrustAnchorCountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryActivatedTrustAnchorCountResponse.Merge(m, src) +} +func (m *QueryActivatedTrustAnchorCountResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryActivatedTrustAnchorCountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryActivatedTrustAnchorCountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryActivatedTrustAnchorCountResponse proto.InternalMessageInfo + +func (m *QueryActivatedTrustAnchorCountResponse) GetCount() uint64 { + if m != nil { + return m.Count + } + return 0 +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "planetmintgo.machine.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "planetmintgo.machine.QueryParamsResponse") @@ -570,59 +652,65 @@ func init() { proto.RegisterType((*QueryGetLiquidAssetsByMachineidResponse)(nil), "planetmintgo.machine.QueryGetLiquidAssetsByMachineidResponse") proto.RegisterType((*QueryActiveTrustAnchorCountRequest)(nil), "planetmintgo.machine.QueryActiveTrustAnchorCountRequest") proto.RegisterType((*QueryActiveTrustAnchorCountResponse)(nil), "planetmintgo.machine.QueryActiveTrustAnchorCountResponse") + proto.RegisterType((*QueryActivatedTrustAnchorCountRequest)(nil), "planetmintgo.machine.QueryActivatedTrustAnchorCountRequest") + proto.RegisterType((*QueryActivatedTrustAnchorCountResponse)(nil), "planetmintgo.machine.QueryActivatedTrustAnchorCountResponse") } func init() { proto.RegisterFile("planetmintgo/machine/query.proto", fileDescriptor_bf7841d43d757203) } var fileDescriptor_bf7841d43d757203 = []byte{ - // 752 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x5f, 0x4f, 0x13, 0x4b, - 0x14, 0xef, 0x12, 0xfe, 0x0e, 0x2f, 0x37, 0x43, 0xef, 0x0d, 0xd9, 0xf4, 0x96, 0x32, 0xf7, 0x2a, - 0x48, 0xa4, 0x13, 0x20, 0x80, 0x8a, 0x26, 0xb6, 0xa2, 0x86, 0x68, 0x13, 0xa8, 0x3e, 0x69, 0x4c, - 0x33, 0xdd, 0x4e, 0x96, 0x8d, 0xed, 0xce, 0xb2, 0x33, 0x4b, 0xd8, 0x10, 0x1e, 0xf4, 0x13, 0x98, - 0xf8, 0x51, 0x7c, 0xf7, 0xc9, 0x07, 0x1e, 0x49, 0x7c, 0xf1, 0xc9, 0x18, 0xea, 0x07, 0x31, 0x9d, - 0x9d, 0xed, 0x2e, 0x74, 0x58, 0x01, 0x9f, 0x3a, 0x7b, 0xfa, 0xfb, 0x9d, 0xf3, 0x3b, 0x67, 0xcf, - 0x39, 0xb3, 0xa0, 0xe4, 0xb5, 0x89, 0x4b, 0x45, 0xc7, 0x71, 0x85, 0xcd, 0x70, 0x87, 0x58, 0xbb, - 0x8e, 0x4b, 0xf1, 0x5e, 0x40, 0xfd, 0xb0, 0xec, 0xf9, 0x4c, 0x30, 0x98, 0x4f, 0x23, 0xca, 0x0a, - 0x61, 0xe6, 0x6d, 0x66, 0x33, 0x09, 0xc0, 0xbd, 0x53, 0x84, 0x35, 0x0b, 0x36, 0x63, 0x76, 0x9b, - 0x62, 0xe2, 0x39, 0x98, 0xb8, 0x2e, 0x13, 0x44, 0x38, 0xcc, 0xe5, 0xea, 0xdf, 0x05, 0x8b, 0xf1, - 0x0e, 0xe3, 0xb8, 0x49, 0xb8, 0x0a, 0x81, 0xf7, 0x97, 0x9a, 0x54, 0x90, 0x25, 0xec, 0x11, 0xdb, - 0x71, 0x25, 0x58, 0x61, 0x67, 0xb5, 0xba, 0x3c, 0xe2, 0x93, 0x4e, 0xec, 0x0e, 0x69, 0x21, 0xea, - 0x57, 0x61, 0xe6, 0xb4, 0x98, 0xb6, 0xb3, 0x17, 0x38, 0xad, 0x06, 0xe1, 0x9c, 0x8a, 0x08, 0x88, - 0xf2, 0x00, 0xee, 0xf4, 0x14, 0x6d, 0xcb, 0x08, 0x75, 0xba, 0x17, 0x50, 0x2e, 0xd0, 0x0e, 0x98, - 0x3a, 0x63, 0xe5, 0x1e, 0x73, 0x39, 0x85, 0xf7, 0xc0, 0x68, 0xa4, 0x64, 0xda, 0x28, 0x19, 0xf3, - 0x93, 0xcb, 0x85, 0xb2, 0xae, 0x46, 0xe5, 0x88, 0x55, 0x1d, 0x3e, 0xfe, 0x3e, 0x93, 0xab, 0x2b, - 0x06, 0xaa, 0x80, 0x59, 0xe9, 0xf2, 0x29, 0x15, 0xb5, 0x08, 0x57, 0x0d, 0xb7, 0x83, 0x66, 0xdb, - 0xb1, 0x9e, 0xd1, 0x50, 0xc5, 0x85, 0x05, 0x30, 0xe1, 0xc5, 0x36, 0x19, 0x63, 0xa2, 0x9e, 0x18, - 0xd0, 0x1b, 0x80, 0xb2, 0x5c, 0x28, 0x91, 0xeb, 0x60, 0x4c, 0x09, 0x51, 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, 0x73, 0x0d, 0xb3, 0x1a, 0x3b, 0x73, 0x61, 0x98, 0x77, - 0xaf, 0xc1, 0xbc, 0x4c, 0x1a, 0xf2, 0x52, 0xa0, 0x8d, 0x74, 0x73, 0x35, 0xe4, 0x96, 0xa9, 0xd6, - 0x8e, 0x4f, 0x8b, 0xc6, 0xc9, 0x69, 0xd1, 0xf8, 0x71, 0x5a, 0x34, 0x3e, 0x74, 0x8b, 0xb9, 0x93, - 0x6e, 0x31, 0xf7, 0xad, 0x5b, 0xcc, 0xbd, 0x5a, 0xb1, 0x1d, 0xb1, 0x1b, 0x34, 0xcb, 0x16, 0xeb, - 0xa4, 0x5d, 0x26, 0xc7, 0x45, 0x9b, 0xe1, 0x83, 0xa4, 0x71, 0x43, 0x8f, 0xf2, 0xe6, 0xa8, 0xfc, - 0x58, 0x58, 0xf9, 0x15, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x39, 0x3a, 0xcf, 0x36, 0x09, 0x00, 0x00, + // 803 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4d, 0x6f, 0xd3, 0x48, + 0x18, 0x8e, 0xab, 0x7e, 0x6c, 0xa7, 0x97, 0xd5, 0x34, 0xbb, 0xea, 0x5a, 0xd9, 0x34, 0xf5, 0x6e, + 0x49, 0xa9, 0x68, 0x86, 0xa6, 0xea, 0x07, 0xa4, 0x20, 0x12, 0x0a, 0xa8, 0x82, 0x48, 0x6d, 0xe0, + 0x04, 0x42, 0xd1, 0xc4, 0x19, 0xb9, 0x16, 0x89, 0xc7, 0xcd, 0x8c, 0xab, 0x46, 0x55, 0x0f, 0xf0, + 0x0b, 0x90, 0xf8, 0x29, 0x48, 0x1c, 0x39, 0x71, 0xe8, 0xb1, 0x12, 0x17, 0x4e, 0x08, 0xb5, 0xfc, + 0x10, 0xe4, 0xf1, 0x38, 0x76, 0x9b, 0x89, 0xfb, 0xc1, 0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 0x67, 0x55, 0x1e, + 0x64, 0x58, 0xa1, 0x03, 0xf9, 0x70, 0x08, 0x8f, 0x35, 0xa0, 0x0f, 0x4e, 0x03, 0xb8, 0x9e, 0xac, + 0x22, 0x39, 0x8c, 0xf4, 0x7b, 0xd7, 0x64, 0x4b, 0x2b, 0xcb, 0xc2, 0x0a, 0x82, 0x0b, 0x2a, 0x2b, + 0xf1, 0x2f, 0x6e, 0xb4, 0x11, 0x9b, 0x1b, 0xe2, 0x3c, 0xfd, 0xad, 0x0e, 0x10, 0x98, 0x74, 0xb0, + 0x13, 0x93, 0x49, 0xbf, 0x73, 0x0d, 0xe6, 0x65, 0x6c, 0x88, 0xaf, 0x0f, 0xa9, 0xc7, 0x0f, 0x57, + 0x5d, 0xa4, 0x8c, 0xbf, 0x33, 0xff, 0x0c, 0x4c, 0x28, 0x58, 0xba, 0x48, 0x4f, 0x42, 0x00, 0xea, + 0xeb, 0xd7, 0x23, 0x4b, 0x3f, 0x6b, 0xc2, 0x4f, 0x11, 0xde, 0x1e, 0xe8, 0xc7, 0xa7, 0x2b, 0x2c, + 0x55, 0xaa, 0x47, 0x27, 0x59, 0xed, 0xf8, 0x24, 0xab, 0xfd, 0x38, 0xc9, 0x6a, 0xef, 0x4f, 0xb3, + 0xa9, 0xe3, 0xd3, 0x6c, 0xea, 0xdb, 0x69, 0x36, 0xf5, 0x72, 0xc9, 0xb2, 0xf9, 0x8e, 0xd7, 0x28, + 0x98, 0xb4, 0x1d, 0xaf, 0x1a, 0x3d, 0x2e, 0x58, 0x14, 0xed, 0x47, 0x77, 0xb1, 0xeb, 0x12, 0xd6, + 0x18, 0x15, 0x3f, 0xb4, 0x96, 0x7e, 0x05, 0x00, 0x00, 0xff, 0xff, 0xc1, 0xb3, 0x94, 0x4b, 0x72, + 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -649,6 +737,8 @@ type QueryClient interface { GetLiquidAssetsByMachineid(ctx context.Context, in *QueryGetLiquidAssetsByMachineidRequest, opts ...grpc.CallOption) (*QueryGetLiquidAssetsByMachineidResponse, error) // Queries a list of ActiveTrustAnchorCount items. ActiveTrustAnchorCount(ctx context.Context, in *QueryActiveTrustAnchorCountRequest, opts ...grpc.CallOption) (*QueryActiveTrustAnchorCountResponse, error) + // Queries a list of ActivatedTrustAnchorCount items. + ActivatedTrustAnchorCount(ctx context.Context, in *QueryActivatedTrustAnchorCountRequest, opts ...grpc.CallOption) (*QueryActivatedTrustAnchorCountResponse, error) } type queryClient struct { @@ -713,6 +803,15 @@ func (c *queryClient) ActiveTrustAnchorCount(ctx context.Context, in *QueryActiv return out, nil } +func (c *queryClient) ActivatedTrustAnchorCount(ctx context.Context, in *QueryActivatedTrustAnchorCountRequest, opts ...grpc.CallOption) (*QueryActivatedTrustAnchorCountResponse, error) { + out := new(QueryActivatedTrustAnchorCountResponse) + err := c.cc.Invoke(ctx, "/planetmintgo.machine.Query/ActivatedTrustAnchorCount", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -727,6 +826,8 @@ type QueryServer interface { GetLiquidAssetsByMachineid(context.Context, *QueryGetLiquidAssetsByMachineidRequest) (*QueryGetLiquidAssetsByMachineidResponse, error) // Queries a list of ActiveTrustAnchorCount items. ActiveTrustAnchorCount(context.Context, *QueryActiveTrustAnchorCountRequest) (*QueryActiveTrustAnchorCountResponse, error) + // Queries a list of ActivatedTrustAnchorCount items. + ActivatedTrustAnchorCount(context.Context, *QueryActivatedTrustAnchorCountRequest) (*QueryActivatedTrustAnchorCountResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -751,6 +852,9 @@ func (*UnimplementedQueryServer) GetLiquidAssetsByMachineid(ctx context.Context, func (*UnimplementedQueryServer) ActiveTrustAnchorCount(ctx context.Context, req *QueryActiveTrustAnchorCountRequest) (*QueryActiveTrustAnchorCountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ActiveTrustAnchorCount not implemented") } +func (*UnimplementedQueryServer) ActivatedTrustAnchorCount(ctx context.Context, req *QueryActivatedTrustAnchorCountRequest) (*QueryActivatedTrustAnchorCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ActivatedTrustAnchorCount not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -864,6 +968,24 @@ func _Query_ActiveTrustAnchorCount_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _Query_ActivatedTrustAnchorCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryActivatedTrustAnchorCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ActivatedTrustAnchorCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/planetmintgo.machine.Query/ActivatedTrustAnchorCount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ActivatedTrustAnchorCount(ctx, req.(*QueryActivatedTrustAnchorCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "planetmintgo.machine.Query", HandlerType: (*QueryServer)(nil), @@ -892,6 +1014,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "ActiveTrustAnchorCount", Handler: _Query_ActiveTrustAnchorCount_Handler, }, + { + MethodName: "ActivatedTrustAnchorCount", + Handler: _Query_ActivatedTrustAnchorCount_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "planetmintgo/machine/query.proto", @@ -1269,6 +1395,57 @@ func (m *QueryActiveTrustAnchorCountResponse) MarshalToSizedBuffer(dAtA []byte) return len(dAtA) - i, nil } +func (m *QueryActivatedTrustAnchorCountRequest) 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 *QueryActivatedTrustAnchorCountRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryActivatedTrustAnchorCountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryActivatedTrustAnchorCountResponse) 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 *QueryActivatedTrustAnchorCountResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryActivatedTrustAnchorCountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Count != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1428,6 +1605,27 @@ func (m *QueryActiveTrustAnchorCountResponse) Size() (n int) { return n } +func (m *QueryActivatedTrustAnchorCountRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryActivatedTrustAnchorCountResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Count != 0 { + n += 1 + sovQuery(uint64(m.Count)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2374,6 +2572,125 @@ func (m *QueryActiveTrustAnchorCountResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryActivatedTrustAnchorCountRequest) 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: QueryActivatedTrustAnchorCountRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryActivatedTrustAnchorCountRequest: 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 *QueryActivatedTrustAnchorCountResponse) 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: QueryActivatedTrustAnchorCountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryActivatedTrustAnchorCountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + m.Count = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Count |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 diff --git a/x/machine/types/query.pb.gw.go b/x/machine/types/query.pb.gw.go index 40b8a82..17ef825 100644 --- a/x/machine/types/query.pb.gw.go +++ b/x/machine/types/query.pb.gw.go @@ -285,6 +285,24 @@ func local_request_Query_ActiveTrustAnchorCount_0(ctx context.Context, marshaler } +func request_Query_ActivatedTrustAnchorCount_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryActivatedTrustAnchorCountRequest + var metadata runtime.ServerMetadata + + msg, err := client.ActivatedTrustAnchorCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ActivatedTrustAnchorCount_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryActivatedTrustAnchorCountRequest + var metadata runtime.ServerMetadata + + msg, err := server.ActivatedTrustAnchorCount(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -429,6 +447,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_ActivatedTrustAnchorCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ActivatedTrustAnchorCount_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ActivatedTrustAnchorCount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -590,6 +631,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_ActivatedTrustAnchorCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ActivatedTrustAnchorCount_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ActivatedTrustAnchorCount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -605,6 +666,8 @@ var ( pattern_Query_GetLiquidAssetsByMachineid_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"planetmint", "machine", "liquid_assets", "machineID"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_ActiveTrustAnchorCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"planetmint", "machine", "active_trust_anchor_count"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_ActivatedTrustAnchorCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"planetmint", "machine", "activated_trust_anchor_count"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -619,4 +682,6 @@ var ( forward_Query_GetLiquidAssetsByMachineid_0 = runtime.ForwardResponseMessage forward_Query_ActiveTrustAnchorCount_0 = runtime.ForwardResponseMessage + + forward_Query_ActivatedTrustAnchorCount_0 = runtime.ForwardResponseMessage )