Skip to content

Commit bc85eca

Browse files
committed
fix .gitignore & create release
1 parent b6fca64 commit bc85eca

File tree

98 files changed

+6885
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+6885
-0
lines changed

src/cosmospy_protobuf/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.pyc
2+
*.pyi
3+
*.py
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
syntax = "proto3";
2+
package cosmos.auth.v1beta1;
3+
4+
import "cosmos_proto/cosmos.proto";
5+
import "gogoproto/gogo.proto";
6+
import "google/protobuf/any.proto";
7+
8+
option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types";
9+
10+
// BaseAccount defines a base account type. It contains all the necessary fields
11+
// for basic account functionality. Any custom account type should extend this
12+
// type for additional functionality (e.g. vesting).
13+
message BaseAccount {
14+
option (gogoproto.goproto_getters) = false;
15+
option (gogoproto.goproto_stringer) = false;
16+
option (gogoproto.equal) = false;
17+
18+
option (cosmos_proto.implements_interface) = "AccountI";
19+
20+
string address = 1;
21+
google.protobuf.Any pub_key = 2
22+
[(gogoproto.jsontag) = "public_key,omitempty", (gogoproto.moretags) = "yaml:\"public_key\""];
23+
uint64 account_number = 3 [(gogoproto.moretags) = "yaml:\"account_number\""];
24+
uint64 sequence = 4;
25+
}
26+
27+
// ModuleAccount defines an account for modules that holds coins on a pool.
28+
message ModuleAccount {
29+
option (gogoproto.goproto_getters) = false;
30+
option (gogoproto.goproto_stringer) = false;
31+
option (cosmos_proto.implements_interface) = "ModuleAccountI";
32+
33+
BaseAccount base_account = 1 [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_account\""];
34+
string name = 2;
35+
repeated string permissions = 3;
36+
}
37+
38+
// Params defines the parameters for the auth module.
39+
message Params {
40+
option (gogoproto.equal) = true;
41+
option (gogoproto.goproto_stringer) = false;
42+
43+
uint64 max_memo_characters = 1 [(gogoproto.moretags) = "yaml:\"max_memo_characters\""];
44+
uint64 tx_sig_limit = 2 [(gogoproto.moretags) = "yaml:\"tx_sig_limit\""];
45+
uint64 tx_size_cost_per_byte = 3 [(gogoproto.moretags) = "yaml:\"tx_size_cost_per_byte\""];
46+
uint64 sig_verify_cost_ed25519 = 4
47+
[(gogoproto.customname) = "SigVerifyCostED25519", (gogoproto.moretags) = "yaml:\"sig_verify_cost_ed25519\""];
48+
uint64 sig_verify_cost_secp256k1 = 5
49+
[(gogoproto.customname) = "SigVerifyCostSecp256k1", (gogoproto.moretags) = "yaml:\"sig_verify_cost_secp256k1\""];
50+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
syntax = "proto3";
2+
package cosmos.auth.v1beta1;
3+
4+
import "google/protobuf/any.proto";
5+
import "gogoproto/gogo.proto";
6+
import "cosmos/auth/v1beta1/auth.proto";
7+
8+
option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types";
9+
10+
// GenesisState defines the auth module's genesis state.
11+
message GenesisState {
12+
// params defines all the paramaters of the module.
13+
Params params = 1 [(gogoproto.nullable) = false];
14+
15+
// accounts are the accounts present at genesis.
16+
repeated google.protobuf.Any accounts = 2;
17+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
syntax = "proto3";
2+
package cosmos.auth.v1beta1;
3+
4+
import "cosmos/base/query/v1beta1/pagination.proto";
5+
import "gogoproto/gogo.proto";
6+
import "google/protobuf/any.proto";
7+
import "google/api/annotations.proto";
8+
import "cosmos/auth/v1beta1/auth.proto";
9+
import "cosmos_proto/cosmos.proto";
10+
11+
option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types";
12+
13+
// Query defines the gRPC querier service.
14+
service Query {
15+
// Accounts returns all the existing accounts
16+
//
17+
// Since: cosmos-sdk 0.43
18+
rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) {
19+
option (google.api.http).get = "/cosmos/auth/v1beta1/accounts";
20+
}
21+
22+
// Account returns account details based on address.
23+
rpc Account(QueryAccountRequest) returns (QueryAccountResponse) {
24+
option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}";
25+
}
26+
27+
// Params queries all parameters.
28+
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
29+
option (google.api.http).get = "/cosmos/auth/v1beta1/params";
30+
}
31+
}
32+
33+
// QueryAccountsRequest is the request type for the Query/Accounts RPC method.
34+
//
35+
// Since: cosmos-sdk 0.43
36+
message QueryAccountsRequest {
37+
// pagination defines an optional pagination for the request.
38+
cosmos.base.query.v1beta1.PageRequest pagination = 1;
39+
}
40+
41+
// QueryAccountsResponse is the response type for the Query/Accounts RPC method.
42+
//
43+
// Since: cosmos-sdk 0.43
44+
message QueryAccountsResponse {
45+
// accounts are the existing accounts
46+
repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "AccountI"];
47+
48+
// pagination defines the pagination in the response.
49+
cosmos.base.query.v1beta1.PageResponse pagination = 2;
50+
}
51+
52+
// QueryAccountRequest is the request type for the Query/Account RPC method.
53+
message QueryAccountRequest {
54+
option (gogoproto.equal) = false;
55+
option (gogoproto.goproto_getters) = false;
56+
57+
// address defines the address to query for.
58+
string address = 1;
59+
}
60+
61+
// QueryAccountResponse is the response type for the Query/Account RPC method.
62+
message QueryAccountResponse {
63+
// account defines the account of the corresponding address.
64+
google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "AccountI"];
65+
}
66+
67+
// QueryParamsRequest is the request type for the Query/Params RPC method.
68+
message QueryParamsRequest {}
69+
70+
// QueryParamsResponse is the response type for the Query/Params RPC method.
71+
message QueryParamsResponse {
72+
// params defines the parameters of the module.
73+
Params params = 1 [(gogoproto.nullable) = false];
74+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Since: cosmos-sdk 0.43
2+
syntax = "proto3";
3+
package cosmos.authz.v1beta1;
4+
5+
import "cosmos_proto/cosmos.proto";
6+
import "google/protobuf/timestamp.proto";
7+
import "gogoproto/gogo.proto";
8+
import "google/protobuf/any.proto";
9+
10+
option go_package = "github.com/cosmos/cosmos-sdk/x/authz";
11+
option (gogoproto.goproto_getters_all) = false;
12+
13+
// GenericAuthorization gives the grantee unrestricted permissions to execute
14+
// the provided method on behalf of the granter's account.
15+
message GenericAuthorization {
16+
option (cosmos_proto.implements_interface) = "Authorization";
17+
18+
// Msg, identified by it's type URL, to grant unrestricted permissions to execute
19+
string msg = 1;
20+
}
21+
22+
// Grant gives permissions to execute
23+
// the provide method with expiration time.
24+
message Grant {
25+
google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "Authorization"];
26+
google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
27+
}
28+
29+
// GrantAuthorization extends a grant with both the addresses of the grantee and granter.
30+
// It is used in genesis.proto and query.proto
31+
//
32+
// Since: cosmos-sdk 0.45.2
33+
message GrantAuthorization {
34+
string granter = 1;
35+
string grantee = 2;
36+
37+
google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "Authorization"];
38+
google.protobuf.Timestamp expiration = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
39+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Since: cosmos-sdk 0.43
2+
syntax = "proto3";
3+
package cosmos.authz.v1beta1;
4+
5+
option go_package = "github.com/cosmos/cosmos-sdk/x/authz";
6+
7+
// EventGrant is emitted on Msg/Grant
8+
message EventGrant {
9+
// Msg type URL for which an autorization is granted
10+
string msg_type_url = 2;
11+
// Granter account address
12+
string granter = 3;
13+
// Grantee account address
14+
string grantee = 4;
15+
}
16+
17+
// EventRevoke is emitted on Msg/Revoke
18+
message EventRevoke {
19+
// Msg type URL for which an autorization is revoked
20+
string msg_type_url = 2;
21+
// Granter account address
22+
string granter = 3;
23+
// Grantee account address
24+
string grantee = 4;
25+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Since: cosmos-sdk 0.43
2+
syntax = "proto3";
3+
package cosmos.authz.v1beta1;
4+
5+
import "gogoproto/gogo.proto";
6+
import "cosmos/authz/v1beta1/authz.proto";
7+
8+
option go_package = "github.com/cosmos/cosmos-sdk/x/authz";
9+
10+
// GenesisState defines the authz module's genesis state.
11+
message GenesisState {
12+
repeated GrantAuthorization authorization = 1 [(gogoproto.nullable) = false];
13+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
// Since: cosmos-sdk 0.43
2+
syntax = "proto3";
3+
package cosmos.authz.v1beta1;
4+
5+
import "google/api/annotations.proto";
6+
import "cosmos/base/query/v1beta1/pagination.proto";
7+
import "cosmos/authz/v1beta1/authz.proto";
8+
9+
option go_package = "github.com/cosmos/cosmos-sdk/x/authz";
10+
11+
// Query defines the gRPC querier service.
12+
service Query {
13+
// Returns list of `Authorization`, granted to the grantee by the granter.
14+
rpc Grants(QueryGrantsRequest) returns (QueryGrantsResponse) {
15+
option (google.api.http).get = "/cosmos/authz/v1beta1/grants";
16+
}
17+
18+
// GranterGrants returns list of `GrantAuthorization`, granted by granter.
19+
//
20+
// Since: cosmos-sdk 0.45.2
21+
rpc GranterGrants(QueryGranterGrantsRequest) returns (QueryGranterGrantsResponse) {
22+
option (google.api.http).get = "/cosmos/authz/v1beta1/grants/granter/{granter}";
23+
}
24+
25+
// GranteeGrants returns a list of `GrantAuthorization` by grantee.
26+
//
27+
// Since: cosmos-sdk 0.45.2
28+
rpc GranteeGrants(QueryGranteeGrantsRequest) returns (QueryGranteeGrantsResponse) {
29+
option (google.api.http).get = "/cosmos/authz/v1beta1/grants/grantee/{grantee}";
30+
}
31+
}
32+
33+
// QueryGrantsRequest is the request type for the Query/Grants RPC method.
34+
message QueryGrantsRequest {
35+
string granter = 1;
36+
string grantee = 2;
37+
// Optional, msg_type_url, when set, will query only grants matching given msg type.
38+
string msg_type_url = 3;
39+
// pagination defines an pagination for the request.
40+
cosmos.base.query.v1beta1.PageRequest pagination = 4;
41+
}
42+
43+
// QueryGrantsResponse is the response type for the Query/Authorizations RPC method.
44+
message QueryGrantsResponse {
45+
// authorizations is a list of grants granted for grantee by granter.
46+
repeated Grant grants = 1;
47+
// pagination defines an pagination for the response.
48+
cosmos.base.query.v1beta1.PageResponse pagination = 2;
49+
}
50+
51+
// QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method.
52+
message QueryGranterGrantsRequest {
53+
string granter = 1;
54+
55+
// pagination defines an pagination for the request.
56+
cosmos.base.query.v1beta1.PageRequest pagination = 2;
57+
}
58+
59+
// QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method.
60+
message QueryGranterGrantsResponse {
61+
// grants is a list of grants granted by the granter.
62+
repeated GrantAuthorization grants = 1;
63+
// pagination defines an pagination for the response.
64+
cosmos.base.query.v1beta1.PageResponse pagination = 2;
65+
}
66+
67+
// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method.
68+
message QueryGranteeGrantsRequest {
69+
string grantee = 1;
70+
71+
// pagination defines an pagination for the request.
72+
cosmos.base.query.v1beta1.PageRequest pagination = 2;
73+
}
74+
75+
// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method.
76+
message QueryGranteeGrantsResponse {
77+
// grants is a list of grants granted to the grantee.
78+
repeated GrantAuthorization grants = 1;
79+
// pagination defines an pagination for the response.
80+
cosmos.base.query.v1beta1.PageResponse pagination = 2;
81+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// Since: cosmos-sdk 0.43
2+
syntax = "proto3";
3+
package cosmos.authz.v1beta1;
4+
5+
import "cosmos_proto/cosmos.proto";
6+
import "gogoproto/gogo.proto";
7+
import "google/protobuf/timestamp.proto";
8+
import "google/protobuf/any.proto";
9+
import "cosmos/base/abci/v1beta1/abci.proto";
10+
import "cosmos/authz/v1beta1/authz.proto";
11+
12+
option go_package = "github.com/cosmos/cosmos-sdk/x/authz";
13+
option (gogoproto.goproto_getters_all) = false;
14+
15+
// Msg defines the authz Msg service.
16+
service Msg {
17+
// Grant grants the provided authorization to the grantee on the granter's
18+
// account with the provided expiration time. If there is already a grant
19+
// for the given (granter, grantee, Authorization) triple, then the grant
20+
// will be overwritten.
21+
rpc Grant(MsgGrant) returns (MsgGrantResponse);
22+
23+
// Exec attempts to execute the provided messages using
24+
// authorizations granted to the grantee. Each message should have only
25+
// one signer corresponding to the granter of the authorization.
26+
rpc Exec(MsgExec) returns (MsgExecResponse);
27+
28+
// Revoke revokes any authorization corresponding to the provided method name on the
29+
// granter's account that has been granted to the grantee.
30+
rpc Revoke(MsgRevoke) returns (MsgRevokeResponse);
31+
}
32+
33+
// MsgGrant is a request type for Grant method. It declares authorization to the grantee
34+
// on behalf of the granter with the provided expiration time.
35+
message MsgGrant {
36+
string granter = 1;
37+
string grantee = 2;
38+
39+
cosmos.authz.v1beta1.Grant grant = 3 [(gogoproto.nullable) = false];
40+
}
41+
42+
// MsgExecResponse defines the Msg/MsgExecResponse response type.
43+
message MsgExecResponse {
44+
repeated bytes results = 1;
45+
}
46+
47+
// MsgExec attempts to execute the provided messages using
48+
// authorizations granted to the grantee. Each message should have only
49+
// one signer corresponding to the granter of the authorization.
50+
message MsgExec {
51+
string grantee = 1;
52+
// Authorization Msg requests to execute. Each msg must implement Authorization interface
53+
// The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg))
54+
// triple and validate it.
55+
repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "sdk.Msg, authz.Authorization"];
56+
}
57+
58+
// MsgGrantResponse defines the Msg/MsgGrant response type.
59+
message MsgGrantResponse {}
60+
61+
// MsgRevoke revokes any authorization with the provided sdk.Msg type on the
62+
// granter's account with that has been granted to the grantee.
63+
message MsgRevoke {
64+
string granter = 1;
65+
string grantee = 2;
66+
string msg_type_url = 3;
67+
}
68+
69+
// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type.
70+
message MsgRevokeResponse {}

0 commit comments

Comments
 (0)