1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
// @generated
// This file is @generated by prost-build.
/// Permissions are the permissions that an account has to trip
/// or reset the circuit breaker.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Permissions {
/// level is the level of permissions granted to this account.
#[prost(enumeration = "permissions::Level", tag = "1")]
pub level: i32,
/// limit_type_urls is used with LEVEL_SOME_MSGS to limit the lists of Msg type
/// URLs that the account can trip. It is an error to use limit_type_urls with
/// a level other than LEVEL_SOME_MSGS.
#[prost(string, repeated, tag = "2")]
pub limit_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Nested message and enum types in `Permissions`.
pub mod permissions {
/// Level is the permission level.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Level {
/// LEVEL_NONE_UNSPECIFIED indicates that the account will have no circuit
/// breaker permissions.
NoneUnspecified = 0,
/// LEVEL_SOME_MSGS indicates that the account will have permission to
/// trip or reset the circuit breaker for some Msg type URLs. If this level
/// is chosen, a non-empty list of Msg type URLs must be provided in
/// limit_type_urls.
SomeMsgs = 1,
/// LEVEL_ALL_MSGS indicates that the account can trip or reset the circuit
/// breaker for Msg's of all type URLs.
AllMsgs = 2,
/// LEVEL_SUPER_ADMIN indicates that the account can take all circuit breaker
/// actions and can grant permissions to other accounts.
SuperAdmin = 3,
}
impl Level {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::NoneUnspecified => "LEVEL_NONE_UNSPECIFIED",
Self::SomeMsgs => "LEVEL_SOME_MSGS",
Self::AllMsgs => "LEVEL_ALL_MSGS",
Self::SuperAdmin => "LEVEL_SUPER_ADMIN",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LEVEL_NONE_UNSPECIFIED" => Some(Self::NoneUnspecified),
"LEVEL_SOME_MSGS" => Some(Self::SomeMsgs),
"LEVEL_ALL_MSGS" => Some(Self::AllMsgs),
"LEVEL_SUPER_ADMIN" => Some(Self::SuperAdmin),
_ => None,
}
}
}
}
/// GenesisAccountPermissions is the account permissions for the circuit breaker in genesis
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenesisAccountPermissions {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub permissions: ::core::option::Option<Permissions>,
}
/// GenesisState is the state that must be provided at genesis.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenesisState {
#[prost(message, repeated, tag = "1")]
pub account_permissions: ::prost::alloc::vec::Vec<GenesisAccountPermissions>,
#[prost(string, repeated, tag = "2")]
pub disabled_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// QueryAccountRequest is the request type for the Query/Account RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAccountRequest {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
}
/// AccountResponse is the response type for the Query/Account RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountResponse {
#[prost(message, optional, tag = "1")]
pub permission: ::core::option::Option<Permissions>,
}
/// QueryAccountsRequest is the request type for the Query/Accounts RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAccountsRequest {
/// pagination defines an optional pagination for the request.
#[prost(message, optional, tag = "1")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
}
/// AccountsResponse is the response type for the Query/Accounts RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountsResponse {
#[prost(message, repeated, tag = "1")]
pub accounts: ::prost::alloc::vec::Vec<GenesisAccountPermissions>,
/// pagination defines the pagination in the response.
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
}
/// QueryDisableListRequest is the request type for the Query/DisabledList RPC method.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct QueryDisabledListRequest {}
/// DisabledListResponse is the response type for the Query/DisabledList RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DisabledListResponse {
#[prost(string, repeated, tag = "1")]
pub disabled_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// MsgAuthorizeCircuitBreaker defines the Msg/AuthorizeCircuitBreaker request type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgAuthorizeCircuitBreaker {
/// granter is the granter of the circuit breaker permissions and must have
/// LEVEL_SUPER_ADMIN.
#[prost(string, tag = "1")]
pub granter: ::prost::alloc::string::String,
/// grantee is the account authorized with the provided permissions.
#[prost(string, tag = "2")]
pub grantee: ::prost::alloc::string::String,
/// permissions are the circuit breaker permissions that the grantee receives.
/// These will overwrite any existing permissions. LEVEL_NONE_UNSPECIFIED can
/// be specified to revoke all permissions.
#[prost(message, optional, tag = "3")]
pub permissions: ::core::option::Option<Permissions>,
}
/// MsgAuthorizeCircuitBreakerResponse defines the Msg/AuthorizeCircuitBreaker response type.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct MsgAuthorizeCircuitBreakerResponse {
#[prost(bool, tag = "1")]
pub success: bool,
}
/// MsgTripCircuitBreaker defines the Msg/TripCircuitBreaker request type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgTripCircuitBreaker {
/// authority is the account authorized to trip the circuit breaker.
#[prost(string, tag = "1")]
pub authority: ::prost::alloc::string::String,
/// msg_type_urls specifies a list of type URLs to immediately stop processing.
/// IF IT IS LEFT EMPTY, ALL MSG PROCESSING WILL STOP IMMEDIATELY.
/// This value is validated against the authority's permissions and if the
/// authority does not have permissions to trip the specified msg type URLs
/// (or all URLs), the operation will fail.
#[prost(string, repeated, tag = "2")]
pub msg_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// MsgTripCircuitBreakerResponse defines the Msg/TripCircuitBreaker response type.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct MsgTripCircuitBreakerResponse {
#[prost(bool, tag = "1")]
pub success: bool,
}
/// MsgResetCircuitBreaker defines the Msg/ResetCircuitBreaker request type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgResetCircuitBreaker {
/// authority is the account authorized to trip or reset the circuit breaker.
#[prost(string, tag = "1")]
pub authority: ::prost::alloc::string::String,
/// msg_type_urls specifies a list of Msg type URLs to resume processing. If
/// it is left empty all Msg processing for type URLs that the account is
/// authorized to trip will resume.
#[prost(string, repeated, tag = "3")]
pub msg_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// MsgResetCircuitBreakerResponse defines the Msg/ResetCircuitBreaker response type.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct MsgResetCircuitBreakerResponse {
#[prost(bool, tag = "1")]
pub success: bool,
}
include!("cosmos.circuit.v1.tonic.rs");
// @@protoc_insertion_point(module)