Skip to content

Commit

Permalink
Merge branch 'main' into bez/12189-vesting-base-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbez authored Jun 13, 2022
2 parents f1cc335 + b786d5d commit 08d103a
Show file tree
Hide file tree
Showing 11 changed files with 6,295 additions and 14 deletions.
504 changes: 504 additions & 0 deletions api/cosmos/evidence/module/v1/module.pulsar.go

Large diffs are not rendered by default.

5,376 changes: 5,376 additions & 0 deletions api/cosmos/orm/query/v1alpha1/query.pulsar.go

Large diffs are not rendered by default.

145 changes: 145 additions & 0 deletions api/cosmos/orm/query/v1alpha1/query_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions proto/cosmos/evidence/module/v1/module.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
syntax = "proto3";

package cosmos.evidence.module.v1;

import "cosmos/app/v1alpha1/module.proto";

// Module is the config object of the evidence module.
message Module {
option (cosmos.app.v1alpha1.module) = {
go_import: "github.com/cosmos/cosmos-sdk/x/evidence"
};
}
131 changes: 131 additions & 0 deletions proto/cosmos/orm/query/v1alpha1/query.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
syntax = "proto3";

package cosmos.orm.query.v1alpha1;

import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/any.proto";
import "cosmos/base/query/v1beta1/pagination.proto";

// Query is a generic gRPC service for querying ORM data.
service Query {

// Get queries an ORM table against an unique index.
rpc Get(GetRequest) returns (GetResponse);

// List queries an ORM table against an index.
rpc List(ListRequest) returns (ListResponse);
}

// GetRequest is the Query/Get request type.
message GetRequest {
// message_name is the fully-qualified message name of the ORM table being queried.
string message_name = 1;

// index is the index fields expression used in orm definitions. If it
// is empty, the table's primary key is assumed. If it is non-empty, it must
// refer to an unique index.
string index = 2;

// values are the values of the fields corresponding to the requested index.
// There must be as many values provided as there are fields in the index and
// these values must correspond to the index field types.
repeated IndexValue values = 3;
}

// GetResponse is the Query/Get response type.
message GetResponse {

// result is the result of the get query. If no value is found, the gRPC
// status code NOT_FOUND will be returned.
google.protobuf.Any result = 1;
}

// ListRequest is the Query/List request type.
message ListRequest {
// message_name is the fully-qualified message name of the ORM table being queried.
string message_name = 1;

// index is the index fields expression used in orm definitions. If it
// is empty, the table's primary key is assumed.
string index = 2;

// query is the query expression corresponding to the provided index. If
// neither prefix nor range is specified, the query will list all the fields
// in the index.
oneof query {

// prefix defines a prefix query.
Prefix prefix = 3;

// range defines a range query.
Range range = 4;
}

// pagination is the pagination request.
cosmos.base.query.v1beta1.PageRequest pagination = 5;

// Prefix specifies the arguments to a prefix query.
message Prefix {
// values specifies the index values for the prefix query.
// It is valid to special a partial prefix with fewer values than
// the number of fields in the index.
repeated IndexValue values = 1;
}

// Range specifies the arguments to a range query.
message Range {
// start specifies the starting index values for the range query.
// It is valid to provide fewer values than the number of fields in the
// index.
repeated IndexValue start = 1;

// end specifies the inclusive ending index values for the range query.
// It is valid to provide fewer values than the number of fields in the
// index.
repeated IndexValue end = 2;
}
}

// ListResponse is the Query/List response type.
message ListResponse {

// results are the results of the query.
repeated google.protobuf.Any results = 1;

// pagination is the pagination response.
cosmos.base.query.v1beta1.PageResponse pagination = 5;
}

// IndexValue represents the value of a field in an ORM index expression.
message IndexValue {

// value specifies the index value
oneof value {
// uint specifies a value for an uint32, fixed32, uint64, or fixed64
// index field.
uint64 uint = 1;

// int64 specifies a value for an int32, sfixed32, int64, or sfixed64
// index field.
int64 int = 2;

// str specifies a value for a string index field.
string str = 3;

// bytes specifies a value for a bytes index field.
bytes bytes = 4;

// enum specifies a value for an enum index field.
string enum = 5;

// bool specifies a value for a bool index field.
bool bool = 6;

// timestamp specifies a value for a timestamp index field.
google.protobuf.Timestamp timestamp = 7;

// duration specifies a value for a duration index field.
google.protobuf.Duration duration = 8;
}
}
10 changes: 1 addition & 9 deletions simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ func NewSimApp(
&app.NFTKeeper,
&app.SlashingKeeper,
&app.MintKeeper,
&app.EvidenceKeeper,
&msgServiceRouter,
); err != nil {
panic(err)
Expand All @@ -238,7 +239,6 @@ func NewSimApp(
distrtypes.StoreKey,
govtypes.StoreKey,
upgradetypes.StoreKey,
evidencetypes.StoreKey,
group.StoreKey,
)
// NOTE: The testingkey is just mounted for testing purposes. Actual applications should
Expand Down Expand Up @@ -296,13 +296,6 @@ func NewSimApp(
// set the governance module account as the authority for conducting upgrades
app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, app.keys[upgradetypes.StoreKey], app.appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String())

// create evidence keeper with router
evidenceKeeper := evidencekeeper.NewKeeper(
app.appCodec, app.keys[evidencetypes.StoreKey], app.StakingKeeper, app.SlashingKeeper,
)
// If evidence needs to be handled for the app, set routes in router here and seal
app.EvidenceKeeper = *evidenceKeeper

/**** Module Options ****/

// NOTE: we may consider parsing `appOpts` inside module constructors. For the moment
Expand All @@ -317,7 +310,6 @@ func NewSimApp(
gov.NewAppModule(app.appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper),
distr.NewAppModule(app.appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
upgrade.NewAppModule(app.UpgradeKeeper),
evidence.NewAppModule(app.EvidenceKeeper),
groupmodule.NewAppModule(app.appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
); err != nil {
panic(err)
Expand Down
4 changes: 4 additions & 0 deletions simapp/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,7 @@ modules:
- name: mint
config:
"@type": cosmos.mint.module.v1.Module

- name: evidence
config:
"@type": cosmos.evidence.module.v1.Module
9 changes: 6 additions & 3 deletions x/evidence/client/testutil/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ package testutil
import (
"testing"

"github.com/cosmos/cosmos-sdk/testutil/network"

"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"

"github.com/cosmos/cosmos-sdk/testutil/network"
"github.com/cosmos/cosmos-sdk/x/evidence/testutil"
)

func TestIntegrationTestSuite(t *testing.T) {
cfg := network.DefaultConfig()
cfg, err := network.DefaultConfigWithAppConfig(testutil.AppConfig)
require.NoError(t, err)
cfg.NumValidators = 1
suite.Run(t, NewIntegrationTestSuite(cfg))
}
Loading

0 comments on commit 08d103a

Please sign in to comment.