provwasm_std/types/capability/
v1.rs

1use provwasm_proc_macro::CosmwasmExt;
2/// Capability defines an implementation of an object capability. The index
3/// provided to a Capability must be globally unique.
4#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
6#[proto_message(type_url = "/capability.v1.Capability")]
7pub struct Capability {
8    #[prost(uint64, tag = "1")]
9    pub index: u64,
10}
11/// Owner defines a single capability owner. An owner is defined by the name of
12/// capability and the module name.
13#[allow(clippy::derive_partial_eq_without_eq)]
14#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
15#[proto_message(type_url = "/capability.v1.Owner")]
16pub struct Owner {
17    #[prost(string, tag = "1")]
18    pub module: ::prost::alloc::string::String,
19    #[prost(string, tag = "2")]
20    pub name: ::prost::alloc::string::String,
21}
22/// CapabilityOwners defines a set of owners of a single Capability. The set of
23/// owners must be unique.
24#[allow(clippy::derive_partial_eq_without_eq)]
25#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
26#[proto_message(type_url = "/capability.v1.CapabilityOwners")]
27pub struct CapabilityOwners {
28    #[prost(message, repeated, tag = "1")]
29    pub owners: ::prost::alloc::vec::Vec<Owner>,
30}
31/// GenesisOwners defines the capability owners with their corresponding index.
32#[allow(clippy::derive_partial_eq_without_eq)]
33#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
34#[proto_message(type_url = "/capability.v1.GenesisOwners")]
35pub struct GenesisOwners {
36    /// index is the index of the capability owner.
37    #[prost(uint64, tag = "1")]
38    pub index: u64,
39    /// index_owners are the owners at the given index.
40    #[prost(message, optional, tag = "2")]
41    pub index_owners: ::core::option::Option<CapabilityOwners>,
42}
43/// GenesisState defines the capability module's genesis state.
44#[allow(clippy::derive_partial_eq_without_eq)]
45#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
46#[proto_message(type_url = "/capability.v1.GenesisState")]
47pub struct GenesisState {
48    /// index is the capability global index.
49    #[prost(uint64, tag = "1")]
50    pub index: u64,
51    /// owners represents a map from index to owners of the capability index
52    /// index key is string to allow amino marshalling.
53    #[prost(message, repeated, tag = "2")]
54    pub owners: ::prost::alloc::vec::Vec<GenesisOwners>,
55}