From 70be558e13a40cdbff4161c67e07d5a3c0582687 Mon Sep 17 00:00:00 2001 From: Stephen Cirner Date: Fri, 9 Aug 2024 09:56:18 -0400 Subject: [PATCH] feat: upgrade to v1.19.1 --- proto-build/Cargo.toml | 10 +- proto-build/src/main.rs | 2 +- provenance-sdk-go | 2 +- provenance-sdk-proto/Cargo.toml | 6 +- provenance-sdk-proto/src/lib.rs | 6 - .../provenance-sdk/PROVENANCE_SDK_COMMIT | 2 +- .../provenance-sdk/provenance.attribute.v1.rs | 941 +++++- .../provenance-sdk/provenance.marker.v1.rs | 2785 ++++++++++++++--- .../provenance.metadata.v1.p8e.rs | 127 +- .../provenance-sdk/provenance.metadata.v1.rs | 2646 ++++++++++++---- .../provenance-sdk/provenance.msgfees.v1.rs | 798 ++++- .../provenance-sdk/provenance.name.v1.rs | 569 +++- .../provenance-sdk/provenance.reward.v1.rs | 1463 --------- 13 files changed, 6433 insertions(+), 2924 deletions(-) delete mode 100644 provenance-sdk-proto/src/prost/provenance-sdk/provenance.reward.v1.rs diff --git a/proto-build/Cargo.toml b/proto-build/Cargo.toml index 4b88b6c..a4cc164 100644 --- a/proto-build/Cargo.toml +++ b/proto-build/Cargo.toml @@ -7,9 +7,9 @@ edition = "2021" publish = false [dependencies] -prost = "0.11" -prost-build = "0.11" -tonic = "0.8" -tonic-build = "0.8" +prost = "0.13" +prost-build = "0.13" +tonic = "0.12" +tonic-build = "0.12" regex = "1" -walkdir = "2.3" +walkdir = "2.5" diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index 24bd1fe..8da0007 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -19,7 +19,7 @@ use walkdir::WalkDir; static QUIET: AtomicBool = AtomicBool::new(false); /// The Provenance SDK commit or tag to be cloned and used to build the proto files -const PROVENANCE_SDK_REV: &str = "v1.13.0"; +const PROVENANCE_SDK_REV: &str = "v1.19.1"; // All paths must end with a / and either be absolute or include a ./ to reference the current // working directory. diff --git a/provenance-sdk-go b/provenance-sdk-go index 0c4de0b..d1119ab 160000 --- a/provenance-sdk-go +++ b/provenance-sdk-go @@ -1 +1 @@ -Subproject commit 0c4de0bdcbc298f1c1b256650b3e721171f3c83d +Subproject commit d1119ab02c423d86a0f485a8f124e73511ec1b9b diff --git a/provenance-sdk-proto/Cargo.toml b/provenance-sdk-proto/Cargo.toml index abc9a3c..dfcc0d7 100644 --- a/provenance-sdk-proto/Cargo.toml +++ b/provenance-sdk-proto/Cargo.toml @@ -11,9 +11,9 @@ keywords = ["blockchain", "cosmos", "proto", "provenance", "tendermint"] edition = "2021" [dependencies] -cosmos-sdk-proto = { version = "0.16", default-features = false } -prost = "0.11" -prost-types = "0.11" +cosmos-sdk-proto = { version = "0.23", default-features = false } +prost = "0.13" +prost-types = "0.13" [package.metadata.docs.rs] all-features = true diff --git a/provenance-sdk-proto/src/lib.rs b/provenance-sdk-proto/src/lib.rs index 88079f2..1f0e4f1 100644 --- a/provenance-sdk-proto/src/lib.rs +++ b/provenance-sdk-proto/src/lib.rs @@ -40,10 +40,4 @@ pub mod provenance { include!("prost/provenance-sdk/provenance.name.v1.rs"); } } - - pub mod reward { - pub mod v1 { - include!("prost/provenance-sdk/provenance.reward.v1.rs"); - } - } } diff --git a/provenance-sdk-proto/src/prost/provenance-sdk/PROVENANCE_SDK_COMMIT b/provenance-sdk-proto/src/prost/provenance-sdk/PROVENANCE_SDK_COMMIT index e58d236..8e63bed 100644 --- a/provenance-sdk-proto/src/prost/provenance-sdk/PROVENANCE_SDK_COMMIT +++ b/provenance-sdk-proto/src/prost/provenance-sdk/PROVENANCE_SDK_COMMIT @@ -1 +1 @@ -v1.13.0 \ No newline at end of file +v1.19.1 \ No newline at end of file diff --git a/provenance-sdk-proto/src/prost/provenance-sdk/provenance.attribute.v1.rs b/provenance-sdk-proto/src/prost/provenance-sdk/provenance.attribute.v1.rs index ee3b9d1..4236a93 100644 --- a/provenance-sdk-proto/src/prost/provenance-sdk/provenance.attribute.v1.rs +++ b/provenance-sdk-proto/src/prost/provenance-sdk/provenance.attribute.v1.rs @@ -1,6 +1,7 @@ +// This file is @generated by prost-build. /// Params defines the set of params for the attribute module. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Params { /// maximum length of data to allow in an attribute value #[prost(uint32, tag = "1")] @@ -22,6 +23,9 @@ pub struct Attribute { /// The address the attribute is bound to #[prost(string, tag = "4")] pub address: ::prost::alloc::string::String, + /// Time that an attribute will expire. + #[prost(message, optional, tag = "5")] + pub expiration_date: ::core::option::Option<::prost_types::Timestamp>, } /// EventAttributeAdd event emitted when attribute is added #[allow(clippy::derive_partial_eq_without_eq)] @@ -37,6 +41,8 @@ pub struct EventAttributeAdd { pub account: ::prost::alloc::string::String, #[prost(string, tag = "5")] pub owner: ::prost::alloc::string::String, + #[prost(string, tag = "6")] + pub expiration: ::prost::alloc::string::String, } /// EventAttributeUpdate event emitted when attribute is updated #[allow(clippy::derive_partial_eq_without_eq)] @@ -57,6 +63,23 @@ pub struct EventAttributeUpdate { #[prost(string, tag = "7")] pub owner: ::prost::alloc::string::String, } +/// EventAttributeExpirationUpdate event emitted when attribute expiration is updated +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventAttributeExpirationUpdate { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub value: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub account: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub owner: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub original_expiration: ::prost::alloc::string::String, + #[prost(string, tag = "6")] + pub updated_expiration: ::prost::alloc::string::String, +} /// EventAttributeDelete event emitted when attribute is deleted #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -83,6 +106,35 @@ pub struct EventAttributeDistinctDelete { #[prost(string, tag = "5")] pub owner: ::prost::alloc::string::String, } +/// EventAttributeExpired event emitted when attribute has expired and been deleted in BeginBlocker +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventAttributeExpired { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub value_hash: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub attribute_type: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub account: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub expiration: ::prost::alloc::string::String, +} +/// EventAccountDataUpdated event emitted when accountdata is set, updated, or deleted. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventAccountDataUpdated { + #[prost(string, tag = "1")] + pub account: ::prost::alloc::string::String, +} +/// EventAttributeParamsUpdated event emitted when attribute params are updated. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventAttributeParamsUpdated { + #[prost(string, tag = "1")] + pub max_value_length: ::prost::alloc::string::String, +} /// AttributeType defines the type of the data stored in the attribute value #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -124,8 +176,23 @@ impl AttributeType { AttributeType::Bytes => "ATTRIBUTE_TYPE_BYTES", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ATTRIBUTE_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "ATTRIBUTE_TYPE_UUID" => Some(Self::Uuid), + "ATTRIBUTE_TYPE_JSON" => Some(Self::Json), + "ATTRIBUTE_TYPE_STRING" => Some(Self::String), + "ATTRIBUTE_TYPE_URI" => Some(Self::Uri), + "ATTRIBUTE_TYPE_INT" => Some(Self::Int), + "ATTRIBUTE_TYPE_FLOAT" => Some(Self::Float), + "ATTRIBUTE_TYPE_PROTO" => Some(Self::Proto), + "ATTRIBUTE_TYPE_BYTES" => Some(Self::Bytes), + _ => None, + } + } } -/// MsgAddAttributeRequest defines an sdk.Msg type that is used to add a new attribute to an account +/// MsgAddAttributeRequest defines an sdk.Msg type that is used to add a new attribute to an account. /// Attributes may only be set in an account by the account that the attribute name resolves to. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -145,12 +212,15 @@ pub struct MsgAddAttributeRequest { /// The address that the name must resolve to. #[prost(string, tag = "5")] pub owner: ::prost::alloc::string::String, + /// Time that an attribute will expire. + #[prost(message, optional, tag = "6")] + pub expiration_date: ::core::option::Option<::prost_types::Timestamp>, } -/// MsgAddAttributeResponse defines the Msg/Vote response type. +/// MsgAddAttributeResponse defines the Msg/AddAttribute response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgAddAttributeResponse {} -/// MsgUpdateAttributeRequest defines an sdk.Msg type that is used to update an existing attribute to an account +/// MsgUpdateAttributeRequest defines an sdk.Msg type that is used to update an existing attribute to an account. /// Attributes may only be set in an account by the account that the attribute name resolves to. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -177,12 +247,37 @@ pub struct MsgUpdateAttributeRequest { #[prost(string, tag = "7")] pub owner: ::prost::alloc::string::String, } -/// MsgUpdateAttributeResponse defines the Msg/Vote response type. +/// MsgUpdateAttributeResponse defines the Msg/UpdateAttribute response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgUpdateAttributeResponse {} +/// MsgUpdateAttributeExpirationRequest defines an sdk.Msg type that is used to update an existing attribute's expiration +/// date +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateAttributeExpirationRequest { + /// The attribute name. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// The original attribute value. + #[prost(bytes = "vec", tag = "2")] + pub value: ::prost::alloc::vec::Vec, + /// Time that an attribute will expire. + #[prost(message, optional, tag = "3")] + pub expiration_date: ::core::option::Option<::prost_types::Timestamp>, + /// The account to add the attribute to. + #[prost(string, tag = "4")] + pub account: ::prost::alloc::string::String, + /// The address that the name must resolve to. + #[prost(string, tag = "5")] + pub owner: ::prost::alloc::string::String, +} +/// MsgUpdateAttributeExpirationResponse defines the Msg/Vote response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgUpdateAttributeExpirationResponse {} /// MsgDeleteAttributeRequest defines a message to delete an attribute from an account -/// Attributes may only be remove from an account by the account that the attribute name resolves to. +/// Attributes may only be removed from an account by the account that the attribute name resolves to. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDeleteAttributeRequest { @@ -196,12 +291,12 @@ pub struct MsgDeleteAttributeRequest { #[prost(string, tag = "3")] pub owner: ::prost::alloc::string::String, } -/// MsgDeleteAttributeResponse defines the Msg/Vote response type. +/// MsgDeleteAttributeResponse defines the Msg/DeleteAttribute response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgDeleteAttributeResponse {} /// MsgDeleteDistinctAttributeRequest defines a message to delete an attribute with matching name, value, and type from -/// an account Attributes may only be remove from an account by the account that the attribute name resolves to. +/// an account. Attributes may only be removed from an account by the account that the attribute name resolves to. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDeleteDistinctAttributeRequest { @@ -218,10 +313,38 @@ pub struct MsgDeleteDistinctAttributeRequest { #[prost(string, tag = "4")] pub owner: ::prost::alloc::string::String, } -/// MsgDeleteDistinctAttributeResponse defines the Msg/Vote response type. +/// MsgDeleteDistinctAttributeResponse defines the Msg/DeleteDistinctAttribute response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgDeleteDistinctAttributeResponse {} +/// MsgSetAccountDataRequest defines a message to set an account's accountdata attribute. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetAccountDataRequest { + #[prost(string, tag = "1")] + pub value: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub account: ::prost::alloc::string::String, +} +/// MsgSetAccountDataResponse defines the Msg/SetAccountData response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgSetAccountDataResponse {} +/// MsgUpdateParamsRequest is a request message for the UpdateParams endpoint. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsRequest { + /// authority should be the governance module account address. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params are the new param values to set. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse is a response message for the UpdateParams endpoint. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] @@ -240,7 +363,7 @@ pub mod msg_client { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where - D: std::convert::TryInto, + D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; @@ -292,11 +415,28 @@ pub mod msg_client { self.inner = self.inner.accept_compressed(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } /// AddAttribute defines a method to verify a particular invariance. pub async fn add_attribute( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -306,13 +446,19 @@ pub mod msg_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.attribute.v1.Msg/AddAttribute"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Msg", + "AddAttribute", + )); + self.inner.unary(req, path, codec).await } /// UpdateAttribute defines a method to verify a particular invariance. pub async fn update_attribute( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -323,13 +469,44 @@ pub mod msg_client { let path = http::uri::PathAndQuery::from_static( "/provenance.attribute.v1.Msg/UpdateAttribute", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Msg", + "UpdateAttribute", + )); + self.inner.unary(req, path, codec).await + } + /// UpdateAttributeExpiration defines a method to verify a particular invariance. + pub async fn update_attribute_expiration( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.attribute.v1.Msg/UpdateAttributeExpiration", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Msg", + "UpdateAttributeExpiration", + )); + self.inner.unary(req, path, codec).await } /// DeleteAttribute defines a method to verify a particular invariance. pub async fn delete_attribute( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -340,14 +517,21 @@ pub mod msg_client { let path = http::uri::PathAndQuery::from_static( "/provenance.attribute.v1.Msg/DeleteAttribute", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Msg", + "DeleteAttribute", + )); + self.inner.unary(req, path, codec).await } /// DeleteDistinctAttribute defines a method to verify a particular invariance. pub async fn delete_distinct_attribute( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -358,7 +542,56 @@ pub mod msg_client { let path = http::uri::PathAndQuery::from_static( "/provenance.attribute.v1.Msg/DeleteDistinctAttribute", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Msg", + "DeleteDistinctAttribute", + )); + self.inner.unary(req, path, codec).await + } + /// SetAccountData defines a method for setting/updating an account's accountdata attribute. + pub async fn set_account_data( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/provenance.attribute.v1.Msg/SetAccountData"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Msg", + "SetAccountData", + )); + self.inner.unary(req, path, codec).await + } + /// UpdateParams is a governance proposal endpoint for updating the attribute module's params. + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/provenance.attribute.v1.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Msg", + "UpdateParams", + )); + self.inner.unary(req, path, codec).await } } } @@ -375,41 +608,64 @@ pub mod msg_server { async fn add_attribute( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// UpdateAttribute defines a method to verify a particular invariance. async fn update_attribute( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; + /// UpdateAttributeExpiration defines a method to verify a particular invariance. + async fn update_attribute_expiration( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// DeleteAttribute defines a method to verify a particular invariance. async fn delete_attribute( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// DeleteDistinctAttribute defines a method to verify a particular invariance. async fn delete_distinct_attribute( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// SetAccountData defines a method for setting/updating an account's accountdata attribute. + async fn set_account_data( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// UpdateParams is a governance proposal endpoint for updating the attribute module's params. + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } /// Msg defines the attribute module Msg service. #[derive(Debug)] pub struct MsgServer { - inner: _Inner, + inner: Arc, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, } - struct _Inner(Arc); impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService @@ -430,6 +686,22 @@ pub mod msg_server { self.send_compression_encodings.enable(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } } impl tonic::codegen::Service> for MsgServer where @@ -440,11 +712,13 @@ pub mod msg_server { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); match req.uri().path() { "/provenance.attribute.v1.Msg/AddAttribute" => { #[allow(non_camel_case_types)] @@ -456,22 +730,29 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).add_attribute(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::add_attribute(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = AddAttributeSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -489,22 +770,71 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).update_attribute(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::update_attribute(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = UpdateAttributeSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.attribute.v1.Msg/UpdateAttributeExpiration" => { + #[allow(non_camel_case_types)] + struct UpdateAttributeExpirationSvc(pub Arc); + impl + tonic::server::UnaryService + for UpdateAttributeExpirationSvc + { + type Response = super::MsgUpdateAttributeExpirationResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_attribute_expiration(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = UpdateAttributeExpirationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -522,22 +852,29 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).delete_attribute(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::delete_attribute(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = DeleteAttributeSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -556,23 +893,106 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = - async move { (*inner).delete_distinct_attribute(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_distinct_attribute(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = DeleteDistinctAttributeSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.attribute.v1.Msg/SetAccountData" => { + #[allow(non_camel_case_types)] + struct SetAccountDataSvc(pub Arc); + impl tonic::server::UnaryService for SetAccountDataSvc { + type Response = super::MsgSetAccountDataResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::set_account_data(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = SetAccountDataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.attribute.v1.Msg/UpdateParams" => { + #[allow(non_camel_case_types)] + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::update_params(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = UpdateParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -581,8 +1001,11 @@ pub mod msg_server { _ => Box::pin(async move { Ok(http::Response::builder() .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") + .header("grpc-status", tonic::Code::Unimplemented as i32) + .header( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ) .body(empty_body()) .unwrap()) }), @@ -596,30 +1019,22 @@ pub mod msg_server { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, } } } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(self.0.clone()) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } impl tonic::server::NamedService for MsgServer { const NAME: &'static str = "provenance.attribute.v1.Msg"; } } /// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} /// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { /// params defines the parameters of the module. #[prost(message, optional, tag = "1")] @@ -667,7 +1082,7 @@ pub struct QueryAttributesRequest { pub pagination: ::core::option::Option, } -/// QueryAttributesResponse is the response type for the Query/Attribute method. +/// QueryAttributesResponse is the response type for the Query/Attributes method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAttributesResponse { @@ -682,7 +1097,7 @@ pub struct QueryAttributesResponse { pub pagination: ::core::option::Option, } -/// QueryScanRequest is the request type for the Query/Scan account attributes method. +/// QueryScanRequest is the request type for the Query/Scan method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryScanRequest { @@ -697,7 +1112,7 @@ pub struct QueryScanRequest { pub pagination: ::core::option::Option, } -/// QueryScanResponse is the response type for the Query/Attribute method. +/// QueryScanResponse is the response type for the Query/Scan method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryScanResponse { @@ -712,6 +1127,46 @@ pub struct QueryScanResponse { pub pagination: ::core::option::Option, } +/// QueryAttributeAccountsRequest is the request type for the Query/AttributeAccounts method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAttributeAccountsRequest { + /// name is the attribute name to query for + #[prost(string, tag = "1")] + pub attribute_name: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// QueryAttributeAccountsResponse is the response type for the Query/AttributeAccounts method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAttributeAccountsResponse { + /// list of account addresses that have attributes of request name + #[prost(string, repeated, tag = "1")] + pub accounts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// QueryAccountDataRequest is the request type for the Query/AccountData method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAccountDataRequest { + /// account is the bech32 address of the account to get the data for + #[prost(string, tag = "1")] + pub account: ::prost::alloc::string::String, +} +/// QueryAccountDataResponse is the response type for the Query/AccountData method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAccountDataResponse { + /// value is the accountdata attribute value for the requested account. + #[prost(string, tag = "1")] + pub value: ::prost::alloc::string::String, +} /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] @@ -730,7 +1185,7 @@ pub mod query_client { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where - D: std::convert::TryInto, + D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; @@ -785,11 +1240,28 @@ pub mod query_client { self.inner = self.inner.accept_compressed(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } /// Params queries params of the attribute module. pub async fn params( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -799,13 +1271,17 @@ pub mod query_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.attribute.v1.Query/Params"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.attribute.v1.Query", "Params")); + self.inner.unary(req, path, codec).await } /// Attribute queries attributes on a given account (address) for one (or more) with the given name pub async fn attribute( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -815,13 +1291,19 @@ pub mod query_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.attribute.v1.Query/Attribute"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Query", + "Attribute", + )); + self.inner.unary(req, path, codec).await } /// Attributes queries attributes on a given account (address) for any defined attributes pub async fn attributes( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -831,13 +1313,18 @@ pub mod query_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.attribute.v1.Query/Attributes"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Query", + "Attributes", + )); + self.inner.unary(req, path, codec).await } /// Scan queries attributes on a given account (address) for any that match the provided suffix pub async fn scan( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -846,7 +1333,57 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.attribute.v1.Query/Scan"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.attribute.v1.Query", "Scan")); + self.inner.unary(req, path, codec).await + } + /// AttributeAccounts queries accounts on a given attribute name + pub async fn attribute_accounts( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.attribute.v1.Query/AttributeAccounts", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Query", + "AttributeAccounts", + )); + self.inner.unary(req, path, codec).await + } + /// AccountData returns the accountdata for a specified account. + pub async fn account_data( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/provenance.attribute.v1.Query/AccountData"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Query", + "AccountData", + )); + self.inner.unary(req, path, codec).await } } } @@ -863,41 +1400,56 @@ pub mod query_server { async fn params( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// Attribute queries attributes on a given account (address) for one (or more) with the given name async fn attribute( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// Attributes queries attributes on a given account (address) for any defined attributes async fn attributes( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// Scan queries attributes on a given account (address) for any that match the provided suffix async fn scan( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; + /// AttributeAccounts queries accounts on a given attribute name + async fn attribute_accounts( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// AccountData returns the accountdata for a specified account. + async fn account_data( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } /// Query defines the gRPC querier service for attribute module. #[derive(Debug)] pub struct QueryServer { - inner: _Inner, + inner: Arc, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, } - struct _Inner(Arc); impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService @@ -918,6 +1470,22 @@ pub mod query_server { self.send_compression_encodings.enable(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } } impl tonic::codegen::Service> for QueryServer where @@ -928,11 +1496,13 @@ pub mod query_server { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); match req.uri().path() { "/provenance.attribute.v1.Query/Params" => { #[allow(non_camel_case_types)] @@ -944,22 +1514,28 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).params(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::params(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -975,22 +1551,28 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).attribute(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::attribute(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = AttributeSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -1006,22 +1588,29 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).attributes(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::attributes(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = AttributesSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -1037,22 +1626,107 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).scan(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::scan(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = ScanSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.attribute.v1.Query/AttributeAccounts" => { + #[allow(non_camel_case_types)] + struct AttributeAccountsSvc(pub Arc); + impl tonic::server::UnaryService + for AttributeAccountsSvc + { + type Response = super::QueryAttributeAccountsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::attribute_accounts(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = AttributeAccountsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.attribute.v1.Query/AccountData" => { + #[allow(non_camel_case_types)] + struct AccountDataSvc(pub Arc); + impl tonic::server::UnaryService for AccountDataSvc { + type Response = super::QueryAccountDataResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::account_data(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = AccountDataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -1061,8 +1735,11 @@ pub mod query_server { _ => Box::pin(async move { Ok(http::Response::builder() .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") + .header("grpc-status", tonic::Code::Unimplemented as i32) + .header( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ) .body(empty_body()) .unwrap()) }), @@ -1076,19 +1753,11 @@ pub mod query_server { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, } } } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(self.0.clone()) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } impl tonic::server::NamedService for QueryServer { const NAME: &'static str = "provenance.attribute.v1.Query"; } diff --git a/provenance-sdk-proto/src/prost/provenance-sdk/provenance.marker.v1.rs b/provenance-sdk-proto/src/prost/provenance-sdk/provenance.marker.v1.rs index 2313554..1b6dc70 100644 --- a/provenance-sdk-proto/src/prost/provenance-sdk/provenance.marker.v1.rs +++ b/provenance-sdk-proto/src/prost/provenance-sdk/provenance.marker.v1.rs @@ -1,4 +1,5 @@ -/// AccessGrant associates a colelction of permisssions with an address for delegated marker account control. +// This file is @generated by prost-build. +/// AccessGrant associates a collection of permissions with an address for delegated marker account control. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AccessGrant { @@ -13,23 +14,32 @@ pub struct AccessGrant { pub enum Access { /// ACCESS_UNSPECIFIED defines a no-op vote option. Unspecified = 0, - /// ACCESS_MINT is the ability to increase the supply of a marker + /// ACCESS_MINT is the ability to increase the supply of a marker. Mint = 1, /// ACCESS_BURN is the ability to decrease the supply of the marker using coin held by the marker. Burn = 2, - /// ACCESS_DEPOSIT is the ability to set a marker reference to this marker in the metadata/scopes module + /// ACCESS_DEPOSIT is the ability to transfer funds from another account to this marker account + /// or to set a reference to this marker in the metadata/scopes module. Deposit = 3, - /// ACCESS_WITHDRAW is the ability to remove marker references to this marker in from metadata/scopes or - /// transfer coin from this marker account to another account. + /// ACCESS_WITHDRAW is the ability to transfer funds from this marker account to another account + /// or to remove a reference to this marker in the metadata/scopes module. Withdraw = 4, - /// ACCESS_DELETE is the ability to move a proposed, finalized or active marker into the cancelled state. This - /// access also allows cancelled markers to be marked for deletion + /// ACCESS_DELETE is the ability to move a proposed, finalized or active marker into the cancelled state. + /// This access also allows cancelled markers to be marked for deletion. Delete = 5, /// ACCESS_ADMIN is the ability to add access grants for accounts to the list of marker permissions. + /// This access also gives the ability to update the marker's denom metadata. Admin = 6, - /// ACCESS_TRANSFER is the ability to invoke a send operation using the marker module to facilitate exchange. + /// ACCESS_TRANSFER is the ability to manage transfer settings and broker transfers of the marker. + /// Accounts with this access can: + /// - Update the marker's required attributes. + /// - Update the send-deny list. + /// - Use the transfer or bank send endpoints to move marker funds out of their own account. /// This access right is only supported on RESTRICTED markers. Transfer = 7, + /// ACCESS_FORCE_TRANSFER is the ability to transfer restricted coins from a 3rd-party account without their signature. + /// This access right is only supported on RESTRICTED markers and only has meaning when allow_forced_transfer is true. + ForceTransfer = 8, } impl Access { /// String value of the enum field names used in the ProtoBuf definition. @@ -46,6 +56,22 @@ impl Access { Access::Delete => "ACCESS_DELETE", Access::Admin => "ACCESS_ADMIN", Access::Transfer => "ACCESS_TRANSFER", + Access::ForceTransfer => "ACCESS_FORCE_TRANSFER", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ACCESS_UNSPECIFIED" => Some(Self::Unspecified), + "ACCESS_MINT" => Some(Self::Mint), + "ACCESS_BURN" => Some(Self::Burn), + "ACCESS_DEPOSIT" => Some(Self::Deposit), + "ACCESS_WITHDRAW" => Some(Self::Withdraw), + "ACCESS_DELETE" => Some(Self::Delete), + "ACCESS_ADMIN" => Some(Self::Admin), + "ACCESS_TRANSFER" => Some(Self::Transfer), + "ACCESS_FORCE_TRANSFER" => Some(Self::ForceTransfer), + _ => None, } } } @@ -53,7 +79,8 @@ impl Access { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { - /// maximum amount of supply to allow a marker to be created with + /// Deprecated: Prefer to use `max_supply` instead. Maximum amount of supply to allow a marker to be created with + #[deprecated] #[prost(uint64, tag = "1")] pub max_total_supply: u64, /// indicates if governance based controls of markers is allowed. @@ -63,6 +90,9 @@ pub struct Params { /// requests are only subject to platform coin validation denom expression) #[prost(string, tag = "3")] pub unrestricted_denom_regex: ::prost::alloc::string::String, + /// maximum amount of supply to allow a marker to be created with + #[prost(string, tag = "4")] + pub max_supply: ::prost::alloc::string::String, } /// MarkerAccount holds the marker configuration information in addition to a base account structure. #[allow(clippy::derive_partial_eq_without_eq)] @@ -97,6 +127,27 @@ pub struct MarkerAccount { /// indicates that governance based control is allowed for this marker #[prost(bool, tag = "9")] pub allow_governance_control: bool, + /// Whether an admin can transfer restricted coins from a 3rd-party account without their signature. + #[prost(bool, tag = "10")] + pub allow_forced_transfer: bool, + /// list of required attributes on restricted marker in order to send and receive transfers if sender does not have + /// transfer authority + #[prost(string, repeated, tag = "11")] + pub required_attributes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// NetAssetValue defines a marker's net asset value +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct NetAssetValue { + /// price is the complete value of the asset's volume + #[prost(message, optional, tag = "1")] + pub price: ::core::option::Option, + /// volume is the number of tokens of the marker that were purchased for the price + #[prost(uint64, tag = "2")] + pub volume: u64, + /// updated_block_height is the block height of last update + #[prost(uint64, tag = "3")] + pub updated_block_height: u64, } /// EventMarkerAdd event emitted when marker is added #[allow(clippy::derive_partial_eq_without_eq)] @@ -112,6 +163,8 @@ pub struct EventMarkerAdd { pub manager: ::prost::alloc::string::String, #[prost(string, tag = "5")] pub marker_type: ::prost::alloc::string::String, + #[prost(string, tag = "6")] + pub address: ::prost::alloc::string::String, } /// EventMarkerAddAccess event emitted when marker access is added #[allow(clippy::derive_partial_eq_without_eq)] @@ -260,6 +313,30 @@ pub struct EventDenomUnit { #[prost(string, repeated, tag = "3")] pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// EventSetNetAssetValue event emitted when Net Asset Value for marker is update or added +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventSetNetAssetValue { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub price: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub volume: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub source: ::prost::alloc::string::String, +} +/// EventMarkerParamsUpdated event emitted when marker params are updated. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventMarkerParamsUpdated { + #[prost(string, tag = "1")] + pub enable_governance: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub unrestricted_denom_regex: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub max_supply: ::prost::alloc::string::String, +} /// MarkerType defines the types of marker #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -283,6 +360,15 @@ impl MarkerType { MarkerType::Restricted => "MARKER_TYPE_RESTRICTED", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "MARKER_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "MARKER_TYPE_COIN" => Some(Self::Coin), + "MARKER_TYPE_RESTRICTED" => Some(Self::Restricted), + _ => None, + } + } } /// MarkerStatus defines the various states a marker account can be in. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -317,6 +403,18 @@ impl MarkerStatus { MarkerStatus::Destroyed => "MARKER_STATUS_DESTROYED", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "MARKER_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "MARKER_STATUS_PROPOSED" => Some(Self::Proposed), + "MARKER_STATUS_FINALIZED" => Some(Self::Finalized), + "MARKER_STATUS_ACTIVE" => Some(Self::Active), + "MARKER_STATUS_CANCELLED" => Some(Self::Cancelled), + "MARKER_STATUS_DESTROYED" => Some(Self::Destroyed), + _ => None, + } + } } /// MsgGrantAllowanceRequest validates permission to create a fee grant based on marker admin access. If /// successful a feegrant is recorded where the marker account itself is the grantor @@ -336,9 +434,10 @@ pub struct MsgGrantAllowanceRequest { } /// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgGrantAllowanceResponse {} -/// MsgAddMarkerRequest defines the Msg/AddMarker request type +/// MsgAddMarkerRequest defines the Msg/AddMarker request type. +/// If being provided as a governance proposal, set the from_address to the gov module's account address. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgAddMarkerRequest { @@ -358,10 +457,21 @@ pub struct MsgAddMarkerRequest { pub supply_fixed: bool, #[prost(bool, tag = "9")] pub allow_governance_control: bool, + #[prost(bool, tag = "10")] + pub allow_forced_transfer: bool, + #[prost(string, repeated, tag = "11")] + pub required_attributes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[deprecated] + #[prost(uint64, tag = "12")] + pub usd_cents: u64, + #[prost(uint64, tag = "13")] + pub volume: u64, + #[prost(uint64, tag = "14")] + pub usd_mills: u64, } /// MsgAddMarkerResponse defines the Msg/AddMarker response type #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgAddMarkerResponse {} /// MsgAddAccessRequest defines the Msg/AddAccess request type #[allow(clippy::derive_partial_eq_without_eq)] @@ -376,7 +486,7 @@ pub struct MsgAddAccessRequest { } /// MsgAddAccessResponse defines the Msg/AddAccess response type #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgAddAccessResponse {} /// MsgDeleteAccessRequest defines the Msg/DeleteAccess request type #[allow(clippy::derive_partial_eq_without_eq)] @@ -391,7 +501,7 @@ pub struct MsgDeleteAccessRequest { } /// MsgDeleteAccessResponse defines the Msg/DeleteAccess response type #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgDeleteAccessResponse {} /// MsgFinalizeRequest defines the Msg/Finalize request type #[allow(clippy::derive_partial_eq_without_eq)] @@ -404,7 +514,7 @@ pub struct MsgFinalizeRequest { } /// MsgFinalizeResponse defines the Msg/Finalize response type #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgFinalizeResponse {} /// MsgActivateRequest defines the Msg/Activate request type #[allow(clippy::derive_partial_eq_without_eq)] @@ -417,7 +527,7 @@ pub struct MsgActivateRequest { } /// MsgActivateResponse defines the Msg/Activate response type #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgActivateResponse {} /// MsgCancelRequest defines the Msg/Cancel request type #[allow(clippy::derive_partial_eq_without_eq)] @@ -430,7 +540,7 @@ pub struct MsgCancelRequest { } /// MsgCancelResponse defines the Msg/Cancel response type #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgCancelResponse {} /// MsgDeleteRequest defines the Msg/Delete request type #[allow(clippy::derive_partial_eq_without_eq)] @@ -443,7 +553,7 @@ pub struct MsgDeleteRequest { } /// MsgDeleteResponse defines the Msg/Delete response type #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgDeleteResponse {} /// MsgMintRequest defines the Msg/Mint request type #[allow(clippy::derive_partial_eq_without_eq)] @@ -456,7 +566,7 @@ pub struct MsgMintRequest { } /// MsgMintResponse defines the Msg/Mint response type #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgMintResponse {} /// MsgBurnRequest defines the Msg/Burn request type #[allow(clippy::derive_partial_eq_without_eq)] @@ -469,7 +579,7 @@ pub struct MsgBurnRequest { } /// MsgBurnResponse defines the Msg/Burn response type #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgBurnResponse {} /// MsgWithdrawRequest defines the Msg/Withdraw request type #[allow(clippy::derive_partial_eq_without_eq)] @@ -486,7 +596,7 @@ pub struct MsgWithdrawRequest { } /// MsgWithdrawResponse defines the Msg/Withdraw response type #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgWithdrawResponse {} /// MsgTransferRequest defines the Msg/Transfer request type #[allow(clippy::derive_partial_eq_without_eq)] @@ -503,7 +613,7 @@ pub struct MsgTransferRequest { } /// MsgTransferResponse defines the Msg/Transfer response type #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgTransferResponse {} /// MsgIbcTransferRequest defines the Msg/IbcTransfer request type for markers. #[allow(clippy::derive_partial_eq_without_eq)] @@ -517,7 +627,7 @@ pub struct MsgIbcTransferRequest { } /// MsgIbcTransferResponse defines the Msg/IbcTransfer response type #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgIbcTransferResponse {} /// MsgSetDenomMetadataRequest defines the Msg/SetDenomMetadata request type #[allow(clippy::derive_partial_eq_without_eq)] @@ -530,8 +640,267 @@ pub struct MsgSetDenomMetadataRequest { } /// MsgSetDenomMetadataResponse defines the Msg/SetDenomMetadata response type #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgSetDenomMetadataResponse {} +/// MsgAddFinalizeActivateMarkerRequest defines the Msg/AddFinalizeActivateMarker request type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgAddFinalizeActivateMarkerRequest { + #[prost(message, optional, tag = "1")] + pub amount: ::core::option::Option, + #[prost(string, tag = "3")] + pub manager: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub from_address: ::prost::alloc::string::String, + #[prost(enumeration = "MarkerType", tag = "5")] + pub marker_type: i32, + #[prost(message, repeated, tag = "6")] + pub access_list: ::prost::alloc::vec::Vec, + #[prost(bool, tag = "7")] + pub supply_fixed: bool, + #[prost(bool, tag = "8")] + pub allow_governance_control: bool, + #[prost(bool, tag = "9")] + pub allow_forced_transfer: bool, + #[prost(string, repeated, tag = "10")] + pub required_attributes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[deprecated] + #[prost(uint64, tag = "11")] + pub usd_cents: u64, + #[prost(uint64, tag = "12")] + pub volume: u64, + #[prost(uint64, tag = "13")] + pub usd_mills: u64, +} +/// MsgAddFinalizeActivateMarkerResponse defines the Msg/AddFinalizeActivateMarker response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgAddFinalizeActivateMarkerResponse {} +/// MsgSupplyIncreaseProposalRequest defines a governance proposal to administer a marker and increase total supply of +/// the marker through minting coin and placing it within the marker or assigning it directly to an account +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSupplyIncreaseProposalRequest { + #[prost(message, optional, tag = "1")] + pub amount: ::core::option::Option, + /// an optional target address for the minted coin from this request + #[prost(string, tag = "2")] + pub target_address: ::prost::alloc::string::String, + /// signer of the proposal + #[prost(string, tag = "3")] + pub authority: ::prost::alloc::string::String, +} +/// MsgSupplyIncreaseProposalResponse defines the Msg/SupplyIncreaseProposal response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgSupplyIncreaseProposalResponse {} +/// MsgSupplyDecreaseProposalRequest defines a governance proposal to decrease total supply of the marker +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSupplyDecreaseProposalRequest { + #[prost(message, optional, tag = "1")] + pub amount: ::core::option::Option, + /// signer of the proposal + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +/// MsgSupplyIncreaseProposalResponse defines the Msg/SupplyDecreaseProposal response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgSupplyDecreaseProposalResponse {} +/// MsgUpdateRequiredAttributesRequest defines a msg to update/add/remove required attributes from a resticted marker +/// signer must have transfer authority to change attributes, to update attribute add current to remove list and new to +/// add list +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateRequiredAttributesRequest { + /// The denomination of the marker to update. + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + /// List of required attributes to remove from marker. + #[prost(string, repeated, tag = "2")] + pub remove_required_attributes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// List of required attributes to add to marker. + #[prost(string, repeated, tag = "3")] + pub add_required_attributes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// The signer of the message. Must have transfer authority to marker or be governance module account address. + #[prost(string, tag = "4")] + pub transfer_authority: ::prost::alloc::string::String, +} +/// MsgUpdateRequiredAttributesResponse defines the Msg/UpdateRequiredAttributes response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgUpdateRequiredAttributesResponse {} +/// MsgUpdateForcedTransferRequest defines a msg to update the allow_forced_transfer field of a marker. +/// It is only usable via governance proposal. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateForcedTransferRequest { + /// The denomination of the marker to update. + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + /// Whether an admin can transfer restricted coins from a 3rd-party account without their signature. + #[prost(bool, tag = "2")] + pub allow_forced_transfer: bool, + /// The signer of this message. Must be the governance module account address. + #[prost(string, tag = "3")] + pub authority: ::prost::alloc::string::String, +} +/// MsgUpdateForcedTransferResponse defines the Msg/UpdateForcedTransfer response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgUpdateForcedTransferResponse {} +/// MsgSetAccountDataRequest defines a msg to set/update/delete the account data for a marker. +/// Signer must have deposit authority or be a gov proposal. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetAccountDataRequest { + /// The denomination of the marker to update. + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + /// The desired accountdata value. + #[prost(string, tag = "2")] + pub value: ::prost::alloc::string::String, + /// The signer of this message. Must have deposit authority or be the governance module account address. + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgSetAccountDataResponse defines the Msg/SetAccountData response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgSetAccountDataResponse {} +/// MsgUpdateSendDenyListRequest defines a msg to add/remove addresses to send deny list for a resticted marker +/// signer must have transfer authority +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateSendDenyListRequest { + /// The denomination of the marker to update. + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + /// List of bech32 addresses to remove from the deny send list. + #[prost(string, repeated, tag = "2")] + pub remove_denied_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// List of bech32 addresses to add to the deny send list. + #[prost(string, repeated, tag = "3")] + pub add_denied_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// The signer of the message. Must have admin authority to marker or be governance module account address. + #[prost(string, tag = "4")] + pub authority: ::prost::alloc::string::String, +} +/// MsgUpdateSendDenyListResponse defines the Msg/UpdateSendDenyList response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgUpdateSendDenyListResponse {} +/// MsgAddNetAssetValuesRequest defines the Msg/AddNetAssetValues request type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgAddNetAssetValuesRequest { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub administrator: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub net_asset_values: ::prost::alloc::vec::Vec, +} +/// MsgAddNetAssetValuesResponse defines the Msg/AddNetAssetValue response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgAddNetAssetValuesResponse {} +/// MsgSetAdministratorProposalRequest defines the Msg/SetAdministratorProposal request type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetAdministratorProposalRequest { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub access: ::prost::alloc::vec::Vec, + /// The signer of the message. Must have admin authority to marker or be governance module account address. + #[prost(string, tag = "3")] + pub authority: ::prost::alloc::string::String, +} +/// MsgSetAdministratorProposalResponse defines the Msg/SetAdministratorProposal response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgSetAdministratorProposalResponse {} +/// MsgRemoveAdministratorProposalRequest defines the Msg/RemoveAdministratorProposal request type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRemoveAdministratorProposalRequest { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "2")] + pub removed_address: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// The signer of the message. Must have admin authority to marker or be governance module account address. + #[prost(string, tag = "3")] + pub authority: ::prost::alloc::string::String, +} +/// MsgRemoveAdministratorProposalResponse defines the Msg/RemoveAdministratorProposal response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgRemoveAdministratorProposalResponse {} +/// MsgChangeStatusProposalRequest defines the Msg/ChangeStatusProposal request type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChangeStatusProposalRequest { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(enumeration = "MarkerStatus", tag = "2")] + pub new_status: i32, + /// The signer of the message. Must have admin authority to marker or be governance module account address. + #[prost(string, tag = "3")] + pub authority: ::prost::alloc::string::String, +} +/// MsgChangeStatusProposalResponse defines the Msg/ChangeStatusProposal response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgChangeStatusProposalResponse {} +/// MsgWithdrawEscrowProposalRequest defines the Msg/WithdrawEscrowProposal request type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgWithdrawEscrowProposalRequest { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub amount: ::prost::alloc::vec::Vec, + #[prost(string, tag = "3")] + pub target_address: ::prost::alloc::string::String, + /// The signer of the message. Must have admin authority to marker or be governance module account address. + #[prost(string, tag = "4")] + pub authority: ::prost::alloc::string::String, +} +/// MsgWithdrawEscrowProposalResponse defines the Msg/WithdrawEscrowProposal response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgWithdrawEscrowProposalResponse {} +/// MsgSetDenomMetadataProposalRequest defines the Msg/SetDenomMetadataProposal request type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetDenomMetadataProposalRequest { + #[prost(message, optional, tag = "1")] + pub metadata: ::core::option::Option, + /// The signer of the message. Must have admin authority to marker or be governance module account address. + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +/// MsgSetDenomMetadataProposalResponse defines the Msg/SetDenomMetadataProposal response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgSetDenomMetadataProposalResponse {} +/// MsgUpdateParamsRequest is a request message for the UpdateParams endpoint. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsRequest { + /// authority should be the governance module account address. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params are the new param values to set. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse is a response message for the UpdateParams endpoint. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] @@ -550,7 +919,7 @@ pub mod msg_client { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where - D: std::convert::TryInto, + D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; @@ -602,11 +971,28 @@ pub mod msg_client { self.inner = self.inner.accept_compressed(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } /// Finalize pub async fn finalize( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -615,13 +1001,17 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Msg/Finalize"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "Finalize")); + self.inner.unary(req, path, codec).await } /// Activate pub async fn activate( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -630,13 +1020,16 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Msg/Activate"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "Activate")); + self.inner.unary(req, path, codec).await } /// Cancel pub async fn cancel( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -645,13 +1038,16 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Msg/Cancel"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "Cancel")); + self.inner.unary(req, path, codec).await } /// Delete pub async fn delete( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -660,13 +1056,16 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Msg/Delete"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "Delete")); + self.inner.unary(req, path, codec).await } /// Mint pub async fn mint( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -675,13 +1074,16 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Msg/Mint"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "Mint")); + self.inner.unary(req, path, codec).await } /// Burn pub async fn burn( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -690,13 +1092,17 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Msg/Burn"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "Burn")); + self.inner.unary(req, path, codec).await } /// AddAccess pub async fn add_access( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -705,13 +1111,17 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Msg/AddAccess"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "AddAccess")); + self.inner.unary(req, path, codec).await } /// DeleteAccess pub async fn delete_access( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -721,13 +1131,17 @@ pub mod msg_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Msg/DeleteAccess"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "DeleteAccess")); + self.inner.unary(req, path, codec).await } /// Withdraw pub async fn withdraw( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -736,13 +1150,17 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Msg/Withdraw"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "Withdraw")); + self.inner.unary(req, path, codec).await } /// AddMarker pub async fn add_marker( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -751,13 +1169,17 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Msg/AddMarker"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "AddMarker")); + self.inner.unary(req, path, codec).await } /// Transfer marker denominated coin between accounts pub async fn transfer( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -766,14 +1188,18 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Msg/Transfer"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "Transfer")); + self.inner.unary(req, path, codec).await } /// Transfer over ibc any marker(including restricted markers) between ibc accounts. /// The relayer is still needed to accomplish ibc middleware relays. pub async fn ibc_transfer( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -783,13 +1209,17 @@ pub mod msg_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Msg/IbcTransfer"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "IbcTransfer")); + self.inner.unary(req, path, codec).await } /// Allows Denom Metadata (see bank module) to be set for the Marker's Denom pub async fn set_denom_metadata( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -799,14 +1229,20 @@ pub mod msg_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Msg/SetDenomMetadata"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "SetDenomMetadata", + )); + self.inner.unary(req, path, codec).await } /// GrantAllowance grants fee allowance to the grantee on the granter's /// account with the provided expiration time. pub async fn grant_allowance( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -816,110 +1252,554 @@ pub mod msg_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Msg/GrantAllowance"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "GrantAllowance", + )); + self.inner.unary(req, path, codec).await } - } -} -/// Generated server implementations. -#[cfg(feature = "grpc")] -#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod msg_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. - #[async_trait] - pub trait Msg: Send + Sync + 'static { - /// Finalize - async fn finalize( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// Activate - async fn activate( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// Cancel - async fn cancel( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// Delete - async fn delete( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// Mint - async fn mint( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// Burn - async fn burn( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// AddAccess - async fn add_access( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// DeleteAccess - async fn delete_access( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// Withdraw - async fn withdraw( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// AddMarker - async fn add_marker( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// Transfer marker denominated coin between accounts - async fn transfer( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// Transfer over ibc any marker(including restricted markers) between ibc accounts. - /// The relayer is still needed to accomplish ibc middleware relays. - async fn ibc_transfer( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// Allows Denom Metadata (see bank module) to be set for the Marker's Denom - async fn set_denom_metadata( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// GrantAllowance grants fee allowance to the grantee on the granter's - /// account with the provided expiration time. - async fn grant_allowance( + /// AddFinalizeActivateMarker + pub async fn add_finalize_activate_marker( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.marker.v1.Msg/AddFinalizeActivateMarker", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "AddFinalizeActivateMarker", + )); + self.inner.unary(req, path, codec).await + } + /// SupplyIncreaseProposal can only be called via gov proposal + pub async fn supply_increase_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.marker.v1.Msg/SupplyIncreaseProposal", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "SupplyIncreaseProposal", + )); + self.inner.unary(req, path, codec).await + } + /// SupplyDecreaseProposal can only be called via gov proposal + pub async fn supply_decrease_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.marker.v1.Msg/SupplyDecreaseProposal", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "SupplyDecreaseProposal", + )); + self.inner.unary(req, path, codec).await + } + /// UpdateRequiredAttributes will only succeed if signer has transfer authority + pub async fn update_required_attributes( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.marker.v1.Msg/UpdateRequiredAttributes", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "UpdateRequiredAttributes", + )); + self.inner.unary(req, path, codec).await + } + /// UpdateForcedTransfer updates the allow_forced_transfer field of a marker via governance proposal. + pub async fn update_forced_transfer( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.marker.v1.Msg/UpdateForcedTransfer", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "UpdateForcedTransfer", + )); + self.inner.unary(req, path, codec).await + } + /// SetAccountData sets the accountdata for a denom. Signer must have deposit authority. + pub async fn set_account_data( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/provenance.marker.v1.Msg/SetAccountData"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "SetAccountData", + )); + self.inner.unary(req, path, codec).await + } + /// UpdateSendDenyList will only succeed if signer has admin authority + pub async fn update_send_deny_list( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.marker.v1.Msg/UpdateSendDenyList", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "UpdateSendDenyList", + )); + self.inner.unary(req, path, codec).await + } + /// AddNetAssetValues set the net asset value for a marker + pub async fn add_net_asset_values( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/provenance.marker.v1.Msg/AddNetAssetValues"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "AddNetAssetValues", + )); + self.inner.unary(req, path, codec).await + } + /// SetAdministratorProposal sets administrators with specific access on the marker + pub async fn set_administrator_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.marker.v1.Msg/SetAdministratorProposal", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "SetAdministratorProposal", + )); + self.inner.unary(req, path, codec).await + } + /// RemoveAdministratorProposal removes administrators with specific access on the marker + pub async fn remove_administrator_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.marker.v1.Msg/RemoveAdministratorProposal", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "RemoveAdministratorProposal", + )); + self.inner.unary(req, path, codec).await + } + /// ChangeStatusProposal is a governance proposal change marker status + pub async fn change_status_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.marker.v1.Msg/ChangeStatusProposal", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "ChangeStatusProposal", + )); + self.inner.unary(req, path, codec).await + } + /// WithdrawEscrowProposal is a governance proposal to withdraw escrow coins from a marker + pub async fn withdraw_escrow_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.marker.v1.Msg/WithdrawEscrowProposal", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "WithdrawEscrowProposal", + )); + self.inner.unary(req, path, codec).await + } + /// SetDenomMetadataProposal is a governance proposal to set marker metadata + pub async fn set_denom_metadata_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.marker.v1.Msg/SetDenomMetadataProposal", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "SetDenomMetadataProposal", + )); + self.inner.unary(req, path, codec).await + } + /// UpdateParams is a governance proposal endpoint for updating the marker module's params. + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/provenance.marker.v1.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "UpdateParams")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + /// Finalize + async fn finalize( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// Activate + async fn activate( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// Cancel + async fn cancel( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// Delete + async fn delete( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// Mint + async fn mint( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// Burn + async fn burn( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// AddAccess + async fn add_access( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// DeleteAccess + async fn delete_access( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// Withdraw + async fn withdraw( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// AddMarker + async fn add_marker( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// Transfer marker denominated coin between accounts + async fn transfer( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// Transfer over ibc any marker(including restricted markers) between ibc accounts. + /// The relayer is still needed to accomplish ibc middleware relays. + async fn ibc_transfer( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// Allows Denom Metadata (see bank module) to be set for the Marker's Denom + async fn set_denom_metadata( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// GrantAllowance grants fee allowance to the grantee on the granter's + /// account with the provided expiration time. + async fn grant_allowance( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; + /// AddFinalizeActivateMarker + async fn add_finalize_activate_marker( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// SupplyIncreaseProposal can only be called via gov proposal + async fn supply_increase_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// SupplyDecreaseProposal can only be called via gov proposal + async fn supply_decrease_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateRequiredAttributes will only succeed if signer has transfer authority + async fn update_required_attributes( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateForcedTransfer updates the allow_forced_transfer field of a marker via governance proposal. + async fn update_forced_transfer( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// SetAccountData sets the accountdata for a denom. Signer must have deposit authority. + async fn set_account_data( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// UpdateSendDenyList will only succeed if signer has admin authority + async fn update_send_deny_list( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// AddNetAssetValues set the net asset value for a marker + async fn add_net_asset_values( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// SetAdministratorProposal sets administrators with specific access on the marker + async fn set_administrator_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// RemoveAdministratorProposal removes administrators with specific access on the marker + async fn remove_administrator_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// ChangeStatusProposal is a governance proposal change marker status + async fn change_status_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// WithdrawEscrowProposal is a governance proposal to withdraw escrow coins from a marker + async fn withdraw_escrow_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// SetDenomMetadataProposal is a governance proposal to set marker metadata + async fn set_denom_metadata_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateParams is a governance proposal endpoint for updating the marker module's params. + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } /// Msg defines the Marker Msg service. #[derive(Debug)] pub struct MsgServer { - inner: _Inner, + inner: Arc, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, } - struct _Inner(Arc); impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService @@ -940,6 +1820,22 @@ pub mod msg_server { self.send_compression_encodings.enable(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } } impl tonic::codegen::Service> for MsgServer where @@ -950,443 +1846,1110 @@ pub mod msg_server { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); match req.uri().path() { "/provenance.marker.v1.Msg/Finalize" => { #[allow(non_camel_case_types)] - struct FinalizeSvc(pub Arc); - impl tonic::server::UnaryService for FinalizeSvc { - type Response = super::MsgFinalizeResponse; + struct FinalizeSvc(pub Arc); + impl tonic::server::UnaryService for FinalizeSvc { + type Response = super::MsgFinalizeResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::finalize(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = FinalizeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/Activate" => { + #[allow(non_camel_case_types)] + struct ActivateSvc(pub Arc); + impl tonic::server::UnaryService for ActivateSvc { + type Response = super::MsgActivateResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::activate(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = ActivateSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/Cancel" => { + #[allow(non_camel_case_types)] + struct CancelSvc(pub Arc); + impl tonic::server::UnaryService for CancelSvc { + type Response = super::MsgCancelResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::cancel(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = CancelSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/Delete" => { + #[allow(non_camel_case_types)] + struct DeleteSvc(pub Arc); + impl tonic::server::UnaryService for DeleteSvc { + type Response = super::MsgDeleteResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::delete(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = DeleteSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/Mint" => { + #[allow(non_camel_case_types)] + struct MintSvc(pub Arc); + impl tonic::server::UnaryService for MintSvc { + type Response = super::MsgMintResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::mint(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = MintSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/Burn" => { + #[allow(non_camel_case_types)] + struct BurnSvc(pub Arc); + impl tonic::server::UnaryService for BurnSvc { + type Response = super::MsgBurnResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::burn(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = BurnSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/AddAccess" => { + #[allow(non_camel_case_types)] + struct AddAccessSvc(pub Arc); + impl tonic::server::UnaryService for AddAccessSvc { + type Response = super::MsgAddAccessResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::add_access(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = AddAccessSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/DeleteAccess" => { + #[allow(non_camel_case_types)] + struct DeleteAccessSvc(pub Arc); + impl tonic::server::UnaryService for DeleteAccessSvc { + type Response = super::MsgDeleteAccessResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::delete_access(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = DeleteAccessSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/Withdraw" => { + #[allow(non_camel_case_types)] + struct WithdrawSvc(pub Arc); + impl tonic::server::UnaryService for WithdrawSvc { + type Response = super::MsgWithdrawResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::withdraw(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = WithdrawSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/AddMarker" => { + #[allow(non_camel_case_types)] + struct AddMarkerSvc(pub Arc); + impl tonic::server::UnaryService for AddMarkerSvc { + type Response = super::MsgAddMarkerResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::add_marker(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = AddMarkerSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/Transfer" => { + #[allow(non_camel_case_types)] + struct TransferSvc(pub Arc); + impl tonic::server::UnaryService for TransferSvc { + type Response = super::MsgTransferResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::transfer(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = TransferSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/IbcTransfer" => { + #[allow(non_camel_case_types)] + struct IbcTransferSvc(pub Arc); + impl tonic::server::UnaryService for IbcTransferSvc { + type Response = super::MsgIbcTransferResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::ibc_transfer(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = IbcTransferSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/SetDenomMetadata" => { + #[allow(non_camel_case_types)] + struct SetDenomMetadataSvc(pub Arc); + impl tonic::server::UnaryService + for SetDenomMetadataSvc + { + type Response = super::MsgSetDenomMetadataResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::set_denom_metadata(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = SetDenomMetadataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/GrantAllowance" => { + #[allow(non_camel_case_types)] + struct GrantAllowanceSvc(pub Arc); + impl tonic::server::UnaryService for GrantAllowanceSvc { + type Response = super::MsgGrantAllowanceResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).finalize(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::grant_allowance(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = FinalizeSvc(inner); + let method = GrantAllowanceSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/provenance.marker.v1.Msg/Activate" => { + "/provenance.marker.v1.Msg/AddFinalizeActivateMarker" => { #[allow(non_camel_case_types)] - struct ActivateSvc(pub Arc); - impl tonic::server::UnaryService for ActivateSvc { - type Response = super::MsgActivateResponse; + struct AddFinalizeActivateMarkerSvc(pub Arc); + impl + tonic::server::UnaryService + for AddFinalizeActivateMarkerSvc + { + type Response = super::MsgAddFinalizeActivateMarkerResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).activate(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::add_finalize_activate_marker(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = ActivateSvc(inner); + let method = AddFinalizeActivateMarkerSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/provenance.marker.v1.Msg/Cancel" => { + "/provenance.marker.v1.Msg/SupplyIncreaseProposal" => { #[allow(non_camel_case_types)] - struct CancelSvc(pub Arc); - impl tonic::server::UnaryService for CancelSvc { - type Response = super::MsgCancelResponse; + struct SupplyIncreaseProposalSvc(pub Arc); + impl + tonic::server::UnaryService + for SupplyIncreaseProposalSvc + { + type Response = super::MsgSupplyIncreaseProposalResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).cancel(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::supply_increase_proposal(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = CancelSvc(inner); + let method = SupplyIncreaseProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/provenance.marker.v1.Msg/Delete" => { + "/provenance.marker.v1.Msg/SupplyDecreaseProposal" => { #[allow(non_camel_case_types)] - struct DeleteSvc(pub Arc); - impl tonic::server::UnaryService for DeleteSvc { - type Response = super::MsgDeleteResponse; + struct SupplyDecreaseProposalSvc(pub Arc); + impl + tonic::server::UnaryService + for SupplyDecreaseProposalSvc + { + type Response = super::MsgSupplyDecreaseProposalResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).delete(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::supply_decrease_proposal(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = DeleteSvc(inner); + let method = SupplyDecreaseProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/provenance.marker.v1.Msg/Mint" => { + "/provenance.marker.v1.Msg/UpdateRequiredAttributes" => { #[allow(non_camel_case_types)] - struct MintSvc(pub Arc); - impl tonic::server::UnaryService for MintSvc { - type Response = super::MsgMintResponse; + struct UpdateRequiredAttributesSvc(pub Arc); + impl + tonic::server::UnaryService + for UpdateRequiredAttributesSvc + { + type Response = super::MsgUpdateRequiredAttributesResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).mint(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_required_attributes(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = MintSvc(inner); + let method = UpdateRequiredAttributesSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/provenance.marker.v1.Msg/Burn" => { + "/provenance.marker.v1.Msg/UpdateForcedTransfer" => { #[allow(non_camel_case_types)] - struct BurnSvc(pub Arc); - impl tonic::server::UnaryService for BurnSvc { - type Response = super::MsgBurnResponse; + struct UpdateForcedTransferSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateForcedTransferSvc + { + type Response = super::MsgUpdateForcedTransferResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).burn(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_forced_transfer(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = BurnSvc(inner); + let method = UpdateForcedTransferSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/provenance.marker.v1.Msg/AddAccess" => { + "/provenance.marker.v1.Msg/SetAccountData" => { #[allow(non_camel_case_types)] - struct AddAccessSvc(pub Arc); - impl tonic::server::UnaryService for AddAccessSvc { - type Response = super::MsgAddAccessResponse; + struct SetAccountDataSvc(pub Arc); + impl tonic::server::UnaryService for SetAccountDataSvc { + type Response = super::MsgSetAccountDataResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).add_access(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::set_account_data(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = AddAccessSvc(inner); + let method = SetAccountDataSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/provenance.marker.v1.Msg/DeleteAccess" => { + "/provenance.marker.v1.Msg/UpdateSendDenyList" => { #[allow(non_camel_case_types)] - struct DeleteAccessSvc(pub Arc); - impl tonic::server::UnaryService for DeleteAccessSvc { - type Response = super::MsgDeleteAccessResponse; + struct UpdateSendDenyListSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateSendDenyListSvc + { + type Response = super::MsgUpdateSendDenyListResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).delete_access(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_send_deny_list(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = DeleteAccessSvc(inner); + let method = UpdateSendDenyListSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/provenance.marker.v1.Msg/Withdraw" => { + "/provenance.marker.v1.Msg/AddNetAssetValues" => { #[allow(non_camel_case_types)] - struct WithdrawSvc(pub Arc); - impl tonic::server::UnaryService for WithdrawSvc { - type Response = super::MsgWithdrawResponse; + struct AddNetAssetValuesSvc(pub Arc); + impl tonic::server::UnaryService + for AddNetAssetValuesSvc + { + type Response = super::MsgAddNetAssetValuesResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).withdraw(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::add_net_asset_values(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = WithdrawSvc(inner); + let method = AddNetAssetValuesSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/provenance.marker.v1.Msg/AddMarker" => { + "/provenance.marker.v1.Msg/SetAdministratorProposal" => { #[allow(non_camel_case_types)] - struct AddMarkerSvc(pub Arc); - impl tonic::server::UnaryService for AddMarkerSvc { - type Response = super::MsgAddMarkerResponse; + struct SetAdministratorProposalSvc(pub Arc); + impl + tonic::server::UnaryService + for SetAdministratorProposalSvc + { + type Response = super::MsgSetAdministratorProposalResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).add_marker(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::set_administrator_proposal(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = AddMarkerSvc(inner); + let method = SetAdministratorProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/provenance.marker.v1.Msg/Transfer" => { + "/provenance.marker.v1.Msg/RemoveAdministratorProposal" => { #[allow(non_camel_case_types)] - struct TransferSvc(pub Arc); - impl tonic::server::UnaryService for TransferSvc { - type Response = super::MsgTransferResponse; + struct RemoveAdministratorProposalSvc(pub Arc); + impl + tonic::server::UnaryService + for RemoveAdministratorProposalSvc + { + type Response = super::MsgRemoveAdministratorProposalResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).transfer(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::remove_administrator_proposal(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = TransferSvc(inner); + let method = RemoveAdministratorProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/provenance.marker.v1.Msg/IbcTransfer" => { + "/provenance.marker.v1.Msg/ChangeStatusProposal" => { #[allow(non_camel_case_types)] - struct IbcTransferSvc(pub Arc); - impl tonic::server::UnaryService for IbcTransferSvc { - type Response = super::MsgIbcTransferResponse; + struct ChangeStatusProposalSvc(pub Arc); + impl tonic::server::UnaryService + for ChangeStatusProposalSvc + { + type Response = super::MsgChangeStatusProposalResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).ibc_transfer(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::change_status_proposal(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = IbcTransferSvc(inner); + let method = ChangeStatusProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/provenance.marker.v1.Msg/SetDenomMetadata" => { + "/provenance.marker.v1.Msg/WithdrawEscrowProposal" => { #[allow(non_camel_case_types)] - struct SetDenomMetadataSvc(pub Arc); - impl tonic::server::UnaryService - for SetDenomMetadataSvc + struct WithdrawEscrowProposalSvc(pub Arc); + impl + tonic::server::UnaryService + for WithdrawEscrowProposalSvc { - type Response = super::MsgSetDenomMetadataResponse; + type Response = super::MsgWithdrawEscrowProposalResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).set_denom_metadata(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::withdraw_escrow_proposal(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = SetDenomMetadataSvc(inner); + let method = WithdrawEscrowProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/provenance.marker.v1.Msg/GrantAllowance" => { + "/provenance.marker.v1.Msg/SetDenomMetadataProposal" => { #[allow(non_camel_case_types)] - struct GrantAllowanceSvc(pub Arc); - impl tonic::server::UnaryService for GrantAllowanceSvc { - type Response = super::MsgGrantAllowanceResponse; + struct SetDenomMetadataProposalSvc(pub Arc); + impl + tonic::server::UnaryService + for SetDenomMetadataProposalSvc + { + type Response = super::MsgSetDenomMetadataProposalResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).grant_allowance(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::set_denom_metadata_proposal(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = GrantAllowanceSvc(inner); + let method = SetDenomMetadataProposalSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/UpdateParams" => { + #[allow(non_camel_case_types)] + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::update_params(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -1395,8 +2958,11 @@ pub mod msg_server { _ => Box::pin(async move { Ok(http::Response::builder() .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") + .header("grpc-status", tonic::Code::Unimplemented as i32) + .header( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ) .body(empty_body()) .unwrap()) }), @@ -1410,19 +2976,11 @@ pub mod msg_server { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, } } } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(self.0.clone()) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } impl tonic::server::NamedService for MsgServer { const NAME: &'static str = "provenance.marker.v1.Msg"; } @@ -1504,10 +3062,37 @@ impl SiPrefix { SiPrefix::Yocto => "SI_PREFIX_YOCTO", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SI_PREFIX_NONE" => Some(Self::None), + "SI_PREFIX_DEKA" => Some(Self::Deka), + "SI_PREFIX_HECTO" => Some(Self::Hecto), + "SI_PREFIX_KILO" => Some(Self::Kilo), + "SI_PREFIX_MEGA" => Some(Self::Mega), + "SI_PREFIX_GIGA" => Some(Self::Giga), + "SI_PREFIX_TERA" => Some(Self::Tera), + "SI_PREFIX_PETA" => Some(Self::Peta), + "SI_PREFIX_EXA" => Some(Self::Exa), + "SI_PREFIX_ZETTA" => Some(Self::Zetta), + "SI_PREFIX_YOTTA" => Some(Self::Yotta), + "SI_PREFIX_DECI" => Some(Self::Deci), + "SI_PREFIX_CENTI" => Some(Self::Centi), + "SI_PREFIX_MILLI" => Some(Self::Milli), + "SI_PREFIX_MICRO" => Some(Self::Micro), + "SI_PREFIX_NANO" => Some(Self::Nano), + "SI_PREFIX_PICO" => Some(Self::Pico), + "SI_PREFIX_FEMTO" => Some(Self::Femto), + "SI_PREFIX_ATTO" => Some(Self::Atto), + "SI_PREFIX_ZEPTO" => Some(Self::Zepto), + "SI_PREFIX_YOCTO" => Some(Self::Yocto), + _ => None, + } + } } /// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} /// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1638,6 +3223,22 @@ pub struct QueryDenomMetadataResponse { #[prost(message, optional, tag = "1")] pub metadata: ::core::option::Option, } +/// QueryAccountDataRequest is the request type for the Query/AccountData +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAccountDataRequest { + /// The denomination to look up. + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, +} +/// QueryAccountDataResponse is the response type for the Query/AccountData +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAccountDataResponse { + /// The accountdata for the requested denom. + #[prost(string, tag = "1")] + pub value: ::prost::alloc::string::String, +} /// Balance defines an account address and balance pair used in queries for accounts holding a marker #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1649,6 +3250,22 @@ pub struct Balance { #[prost(message, repeated, tag = "2")] pub coins: ::prost::alloc::vec::Vec, } +/// QueryNetAssetValuesRequest is the request type for the Query/NetAssetValues method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryNetAssetValuesRequest { + /// address or denom for the marker + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, +} +/// QueryNetAssetValuesRequest is the response type for the Query/NetAssetValues method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryNetAssetValuesResponse { + /// net asset values for marker denom + #[prost(message, repeated, tag = "1")] + pub net_asset_values: ::prost::alloc::vec::Vec, +} /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] @@ -1667,7 +3284,7 @@ pub mod query_client { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where - D: std::convert::TryInto, + D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; @@ -1722,11 +3339,28 @@ pub mod query_client { self.inner = self.inner.accept_compressed(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } /// Params queries the parameters of x/bank module. pub async fn params( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1735,13 +3369,17 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Query/Params"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Query", "Params")); + self.inner.unary(req, path, codec).await } /// Returns a list of all markers on the blockchain pub async fn all_markers( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1751,13 +3389,17 @@ pub mod query_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Query/AllMarkers"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Query", "AllMarkers")); + self.inner.unary(req, path, codec).await } /// query for a single marker by denom or address pub async fn marker( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1766,13 +3408,17 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Query/Marker"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Query", "Marker")); + self.inner.unary(req, path, codec).await } /// query for all accounts holding the given marker coins pub async fn holding( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1781,13 +3427,17 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Query/Holding"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Query", "Holding")); + self.inner.unary(req, path, codec).await } /// query for supply of coin on a marker account pub async fn supply( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1796,13 +3446,17 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Query/Supply"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Query", "Supply")); + self.inner.unary(req, path, codec).await } /// query for coins on a marker account pub async fn escrow( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1811,13 +3465,17 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Query/Escrow"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Query", "Escrow")); + self.inner.unary(req, path, codec).await } /// query for access records on an account pub async fn access( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1826,13 +3484,17 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Query/Access"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Query", "Access")); + self.inner.unary(req, path, codec).await } /// query for access records on an account pub async fn denom_metadata( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1842,7 +3504,54 @@ pub mod query_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.marker.v1.Query/DenomMetadata"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Query", + "DenomMetadata", + )); + self.inner.unary(req, path, codec).await + } + /// query for account data associated with a denom + pub async fn account_data( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/provenance.marker.v1.Query/AccountData"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Query", "AccountData")); + self.inner.unary(req, path, codec).await + } + /// NetAssetValues returns net asset values for marker + pub async fn net_asset_values( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/provenance.marker.v1.Query/NetAssetValues"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Query", + "NetAssetValues", + )); + self.inner.unary(req, path, codec).await } } } @@ -1859,61 +3568,73 @@ pub mod query_server { async fn params( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// Returns a list of all markers on the blockchain async fn all_markers( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// query for a single marker by denom or address async fn marker( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// query for all accounts holding the given marker coins async fn holding( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// query for supply of coin on a marker account async fn supply( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// query for coins on a marker account async fn escrow( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// query for access records on an account async fn access( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// query for access records on an account async fn denom_metadata( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; + /// query for account data associated with a denom + async fn account_data( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// NetAssetValues returns net asset values for marker + async fn net_asset_values( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } /// Query defines the gRPC querier service for marker module. #[derive(Debug)] pub struct QueryServer { - inner: _Inner, + inner: Arc, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, } - struct _Inner(Arc); impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService @@ -1934,6 +3655,22 @@ pub mod query_server { self.send_compression_encodings.enable(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } } impl tonic::codegen::Service> for QueryServer where @@ -1944,11 +3681,13 @@ pub mod query_server { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); match req.uri().path() { "/provenance.marker.v1.Query/Params" => { #[allow(non_camel_case_types)] @@ -1960,22 +3699,28 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).params(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::params(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -1991,22 +3736,29 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).all_markers(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::all_markers(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = AllMarkersSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -2022,22 +3774,28 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).marker(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::marker(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = MarkerSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -2053,22 +3811,28 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).holding(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::holding(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = HoldingSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -2084,22 +3848,28 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).supply(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::supply(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = SupplySvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -2115,22 +3885,28 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).escrow(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::escrow(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = EscrowSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -2146,22 +3922,28 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).access(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::access(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = AccessSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -2179,22 +3961,108 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).denom_metadata(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::denom_metadata(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = DenomMetadataSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Query/AccountData" => { + #[allow(non_camel_case_types)] + struct AccountDataSvc(pub Arc); + impl tonic::server::UnaryService for AccountDataSvc { + type Response = super::QueryAccountDataResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::account_data(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = AccountDataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Query/NetAssetValues" => { + #[allow(non_camel_case_types)] + struct NetAssetValuesSvc(pub Arc); + impl tonic::server::UnaryService + for NetAssetValuesSvc + { + type Response = super::QueryNetAssetValuesResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::net_asset_values(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = NetAssetValuesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -2203,8 +4071,11 @@ pub mod query_server { _ => Box::pin(async move { Ok(http::Response::builder() .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") + .header("grpc-status", tonic::Code::Unimplemented as i32) + .header( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ) .body(empty_body()) .unwrap()) }), @@ -2218,19 +4089,11 @@ pub mod query_server { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, } } } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(self.0.clone()) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } impl tonic::server::NamedService for QueryServer { const NAME: &'static str = "provenance.marker.v1.Query"; } @@ -2243,6 +4106,10 @@ pub struct MarkerTransferAuthorization { /// transfer_limit is the total amount the grantee can transfer #[prost(message, repeated, tag = "1")] pub transfer_limit: ::prost::alloc::vec::Vec, + /// allow_list specifies an optional list of addresses to whom the grantee can send restricted coins on behalf of the + /// granter. If omitted, any recipient is allowed. + #[prost(string, repeated, tag = "2")] + pub allow_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// GenesisState defines the account module's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] @@ -2254,8 +4121,39 @@ pub struct GenesisState { /// A collection of marker accounts to create on start #[prost(message, repeated, tag = "2")] pub markers: ::prost::alloc::vec::Vec, + /// list of marker net asset values + #[prost(message, repeated, tag = "3")] + pub net_asset_values: ::prost::alloc::vec::Vec, + /// list of denom based denied send addresses + #[prost(message, repeated, tag = "4")] + pub deny_send_addresses: ::prost::alloc::vec::Vec, +} +/// DenySendAddress defines addresses that are denied sends for marker denom +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DenySendAddress { + /// marker_address is the marker's address for denied address + #[prost(string, tag = "1")] + pub marker_address: ::prost::alloc::string::String, + /// deny_address defines all wallet addresses that are denied sends for the marker + #[prost(string, tag = "2")] + pub deny_address: ::prost::alloc::string::String, +} +/// MarkerNetAssetValues defines the net asset values for a marker +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MarkerNetAssetValues { + /// address defines the marker address + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// net_asset_values that are assigned to marker + #[prost(message, repeated, tag = "2")] + pub net_asset_values: ::prost::alloc::vec::Vec, } -/// AddMarkerProposal defines defines a governance proposal to create a new marker +/// AddMarkerProposal is deprecated and can no longer be used. +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgAddMarkerRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddMarkerProposal { @@ -2280,6 +4178,9 @@ pub struct AddMarkerProposal { } /// SupplyIncreaseProposal defines a governance proposal to administer a marker and increase total supply of the marker /// through minting coin and placing it within the marker or assigning it directly to an account +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgSupplyIncreaseProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SupplyIncreaseProposal { @@ -2295,6 +4196,9 @@ pub struct SupplyIncreaseProposal { } /// SupplyDecreaseProposal defines a governance proposal to administer a marker and decrease the total supply through /// burning coin held within the marker +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgSupplyDecreaseProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SupplyDecreaseProposal { @@ -2307,6 +4211,9 @@ pub struct SupplyDecreaseProposal { } /// SetAdministratorProposal defines a governance proposal to administer a marker and set administrators with specific /// access on the marker +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgSetAdministratorProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SetAdministratorProposal { @@ -2321,6 +4228,9 @@ pub struct SetAdministratorProposal { } /// RemoveAdministratorProposal defines a governance proposal to administer a marker and remove all permissions for a /// given address +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgRemoveAdministratorProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RemoveAdministratorProposal { @@ -2334,6 +4244,9 @@ pub struct RemoveAdministratorProposal { pub removed_address: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// ChangeStatusProposal defines a governance proposal to administer a marker to change its status +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgChangeStatusProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ChangeStatusProposal { @@ -2347,6 +4260,9 @@ pub struct ChangeStatusProposal { pub new_status: i32, } /// WithdrawEscrowProposal defines a governance proposal to withdraw escrow coins from a marker +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgWithdrawEscrowProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WithdrawEscrowProposal { @@ -2362,6 +4278,9 @@ pub struct WithdrawEscrowProposal { pub target_address: ::prost::alloc::string::String, } /// SetDenomMetadataProposal defines a governance proposal to set the metadata for a denom +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgSetDenomMetadataProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SetDenomMetadataProposal { diff --git a/provenance-sdk-proto/src/prost/provenance-sdk/provenance.metadata.v1.p8e.rs b/provenance-sdk-proto/src/prost/provenance-sdk/provenance.metadata.v1.p8e.rs index f476f0e..0af0440 100644 --- a/provenance-sdk-proto/src/prost/provenance-sdk/provenance.metadata.v1.p8e.rs +++ b/provenance-sdk-proto/src/prost/provenance-sdk/provenance.metadata.v1.p8e.rs @@ -1,19 +1,16 @@ +// This file is @generated by prost-build. +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Contract { #[prost(message, optional, tag = "1")] pub definition: ::core::option::Option, - /// Points to the proto for the contractSpec #[prost(message, optional, tag = "2")] pub spec: ::core::option::Option, - /// Invoker of this contract #[prost(message, optional, tag = "3")] pub invoker: ::core::option::Option, - /// Constructor arguments. - /// These are always the output of a previously recorded consideration. #[prost(message, repeated, tag = "4")] pub inputs: ::prost::alloc::vec::Vec, - /// conditions is a deprecated field that is not used at all anymore. #[deprecated] #[prost(message, repeated, tag = "5")] pub conditions: ::prost::alloc::vec::Vec, @@ -23,12 +20,12 @@ pub struct Contract { pub recitals: ::prost::alloc::vec::Vec, #[prost(int32, tag = "8")] pub times_executed: i32, - /// This is only set once when the contract is initially executed #[prost(message, optional, tag = "9")] pub start_time: ::core::option::Option, #[prost(bytes = "vec", tag = "10")] pub context: ::prost::alloc::vec::Vec, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DefinitionSpec { @@ -41,6 +38,7 @@ pub struct DefinitionSpec { #[prost(enumeration = "DefinitionSpecType", tag = "4")] pub r#type: i32, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Fact { @@ -49,6 +47,7 @@ pub struct Fact { #[prost(message, optional, tag = "2")] pub data_location: ::core::option::Option, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Condition { @@ -57,17 +56,18 @@ pub struct Condition { #[prost(message, optional, tag = "2")] pub result: ::core::option::Option, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Consideration { #[prost(string, tag = "1")] pub consideration_name: ::prost::alloc::string::String, - /// Data pushed to a consideration that will ultimately match the output_spec of the consideration #[prost(message, repeated, tag = "2")] pub inputs: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "3")] pub result: ::core::option::Option, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProposedFact { @@ -80,6 +80,7 @@ pub struct ProposedFact { #[prost(message, optional, tag = "4")] pub ancestor: ::core::option::Option, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExecutionResult { @@ -92,12 +93,14 @@ pub struct ExecutionResult { #[prost(string, tag = "4")] pub error_message: ::prost::alloc::string::String, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Recitals { #[prost(message, repeated, tag = "1")] pub parties: ::prost::alloc::vec::Vec, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Recital { @@ -108,6 +111,7 @@ pub struct Recital { #[prost(bytes = "vec", tag = "3")] pub address: ::prost::alloc::vec::Vec, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Location { @@ -116,46 +120,40 @@ pub struct Location { #[prost(string, tag = "2")] pub classname: ::prost::alloc::string::String, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProvenanceReference { - /// \[Req\] \[Scope.uuid\] - /// Scope ID #[prost(message, optional, tag = "1")] pub scope_uuid: ::core::option::Option, - /// \[Opt\] \[RecordGroup.group_uuid\] - /// require record to be within a specific group #[prost(message, optional, tag = "2")] pub group_uuid: ::core::option::Option, - /// \[Opt\] \[Record.result_hash\] - /// specify a specific record inside a scope (and group) by result-hash #[prost(string, tag = "3")] pub hash: ::prost::alloc::string::String, - /// \[Opt\] \[Record.result_name\] - /// specify a result-name of a record within a scope #[prost(string, tag = "4")] pub name: ::prost::alloc::string::String, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignatureSet { #[prost(message, repeated, tag = "1")] pub signatures: ::prost::alloc::vec::Vec, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Signature { - /// Signature Detail #[prost(string, tag = "1")] pub algo: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub provider: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub signature: ::prost::alloc::string::String, - /// Identity of signer #[prost(message, optional, tag = "4")] pub signer: ::core::option::Option, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SigningAndEncryptionPublicKeys { @@ -164,6 +162,7 @@ pub struct SigningAndEncryptionPublicKeys { #[prost(message, optional, tag = "2")] pub encryption_public_key: ::core::option::Option, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PublicKey { @@ -174,23 +173,23 @@ pub struct PublicKey { #[prost(enumeration = "PublicKeyCurve", tag = "3")] pub curve: i32, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Uuid { #[prost(string, tag = "1")] pub value: ::prost::alloc::string::String, } -/// A Timestamp represents a point in time using values relative to the epoch. +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Timestamp { - /// Represents seconds of UTC time since Unix epoch #[prost(int64, tag = "1")] pub seconds: i64, - /// Non-negative fractions of a second at nanosecond resolution. #[prost(int32, tag = "2")] pub nanos: i32, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ContractSpec { @@ -205,6 +204,7 @@ pub struct ContractSpec { #[prost(message, repeated, tag = "5")] pub consideration_specs: ::prost::alloc::vec::Vec, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConditionSpec { @@ -215,12 +215,12 @@ pub struct ConditionSpec { #[prost(message, optional, tag = "3")] pub output_spec: ::core::option::Option, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConsiderationSpec { #[prost(string, tag = "1")] pub func_name: ::prost::alloc::string::String, - /// Invoking party #[prost(enumeration = "PartyType", tag = "2")] pub responsible_party: i32, #[prost(message, repeated, tag = "3")] @@ -228,18 +228,24 @@ pub struct ConsiderationSpec { #[prost(message, optional, tag = "4")] pub output_spec: ::core::option::Option, } +/// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OutputSpec { #[prost(message, optional, tag = "1")] pub spec: ::core::option::Option, } +/// Deprecated: Do not use. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum DefinitionSpecType { + /// Deprecated: Do not use. Unknown = 0, + /// Deprecated: Do not use. Proposed = 1, + /// Deprecated: Do not use. Fact = 2, + /// Deprecated: Do not use. FactList = 3, } impl DefinitionSpecType { @@ -255,11 +261,24 @@ impl DefinitionSpecType { DefinitionSpecType::FactList => "DEFINITION_SPEC_TYPE_FACT_LIST", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DEFINITION_SPEC_TYPE_UNKNOWN" => Some(Self::Unknown), + "DEFINITION_SPEC_TYPE_PROPOSED" => Some(Self::Proposed), + "DEFINITION_SPEC_TYPE_FACT" => Some(Self::Fact), + "DEFINITION_SPEC_TYPE_FACT_LIST" => Some(Self::FactList), + _ => None, + } + } } +/// Deprecated: Do not use. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum PublicKeyCurve { + /// Deprecated: Do not use. Secp256k1 = 0, + /// Deprecated: Do not use. P256 = 1, } impl PublicKeyCurve { @@ -273,10 +292,20 @@ impl PublicKeyCurve { PublicKeyCurve::P256 => "P256", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SECP256K1" => Some(Self::Secp256k1), + "P256" => Some(Self::P256), + _ => None, + } + } } +/// Deprecated: Do not use. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum PublicKeyType { + /// Deprecated: Do not use. Elliptic = 0, } impl PublicKeyType { @@ -289,14 +318,25 @@ impl PublicKeyType { PublicKeyType::Elliptic => "ELLIPTIC", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ELLIPTIC" => Some(Self::Elliptic), + _ => None, + } + } } +/// Deprecated: Do not use. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum ExecutionResultType { + /// Deprecated: Do not use. ResultTypeUnknown = 0, + /// Deprecated: Do not use. ResultTypePass = 1, - /// Couldn't process the condition/consideration due to missing facts being generated by other considerations. + /// Deprecated: Do not use. ResultTypeSkip = 2, + /// Deprecated: Do not use. ResultTypeFail = 3, } impl ExecutionResultType { @@ -312,21 +352,44 @@ impl ExecutionResultType { ExecutionResultType::ResultTypeFail => "RESULT_TYPE_FAIL", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "RESULT_TYPE_UNKNOWN" => Some(Self::ResultTypeUnknown), + "RESULT_TYPE_PASS" => Some(Self::ResultTypePass), + "RESULT_TYPE_SKIP" => Some(Self::ResultTypeSkip), + "RESULT_TYPE_FAIL" => Some(Self::ResultTypeFail), + _ => None, + } + } } +/// Deprecated: Do not use. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum PartyType { + /// Deprecated: Do not use. Unknown = 0, + /// Deprecated: Do not use. Originator = 1, + /// Deprecated: Do not use. Servicer = 2, + /// Deprecated: Do not use. Investor = 3, + /// Deprecated: Do not use. Custodian = 4, + /// Deprecated: Do not use. Owner = 5, + /// Deprecated: Do not use. Affiliate = 6, + /// Deprecated: Do not use. Omnibus = 7, + /// Deprecated: Do not use. Provenance = 8, + /// Deprecated: Do not use. Marker = 9, + /// Deprecated: Do not use. Controller = 10, + /// Deprecated: Do not use. Validator = 11, } impl PartyType { @@ -350,4 +413,22 @@ impl PartyType { PartyType::Validator => "PARTY_TYPE_VALIDATOR", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PARTY_TYPE_UNKNOWN" => Some(Self::Unknown), + "PARTY_TYPE_ORIGINATOR" => Some(Self::Originator), + "PARTY_TYPE_SERVICER" => Some(Self::Servicer), + "PARTY_TYPE_INVESTOR" => Some(Self::Investor), + "PARTY_TYPE_CUSTODIAN" => Some(Self::Custodian), + "PARTY_TYPE_OWNER" => Some(Self::Owner), + "PARTY_TYPE_AFFILIATE" => Some(Self::Affiliate), + "PARTY_TYPE_OMNIBUS" => Some(Self::Omnibus), + "PARTY_TYPE_PROVENANCE" => Some(Self::Provenance), + "PARTY_TYPE_MARKER" => Some(Self::Marker), + "PARTY_TYPE_CONTROLLER" => Some(Self::Controller), + "PARTY_TYPE_VALIDATOR" => Some(Self::Validator), + _ => None, + } + } } diff --git a/provenance-sdk-proto/src/prost/provenance-sdk/provenance.metadata.v1.rs b/provenance-sdk-proto/src/prost/provenance-sdk/provenance.metadata.v1.rs index 8f72511..2f44f66 100644 --- a/provenance-sdk-proto/src/prost/provenance-sdk/provenance.metadata.v1.rs +++ b/provenance-sdk-proto/src/prost/provenance-sdk/provenance.metadata.v1.rs @@ -1,6 +1,7 @@ +// This file is @generated by prost-build. /// Params defines the set of params for the metadata module. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Params {} /// ScopeIdInfo contains various info regarding a scope id. #[allow(clippy::derive_partial_eq_without_eq)] @@ -151,7 +152,7 @@ pub struct ObjectStoreLocator { } /// Params defines the parameters for the metadata-locator module methods. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct OsLocatorParams { #[prost(uint32, tag = "1")] pub max_uri_length: u32, @@ -170,7 +171,7 @@ pub struct ScopeSpecification { #[prost(string, repeated, tag = "3")] pub owner_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// A list of parties that must be present on a scope (and their associated roles) - #[prost(enumeration = "PartyType", repeated, packed = "false", tag = "4")] + #[prost(enumeration = "PartyType", repeated, tag = "4")] pub parties_involved: ::prost::alloc::vec::Vec, /// A list of contract specification ids allowed for a scope based on this specification. #[prost(bytes = "vec", repeated, tag = "5")] @@ -190,7 +191,7 @@ pub struct ContractSpecification { #[prost(string, repeated, tag = "3")] pub owner_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// a list of party roles that must be fullfilled when signing a transaction for this contract specification - #[prost(enumeration = "PartyType", repeated, packed = "false", tag = "4")] + #[prost(enumeration = "PartyType", repeated, tag = "4")] pub parties_involved: ::prost::alloc::vec::Vec, /// name of the class/type of this contract executable #[prost(string, tag = "7")] @@ -235,7 +236,7 @@ pub struct RecordSpecification { #[prost(enumeration = "DefinitionType", tag = "5")] pub result_type: i32, /// Type of party responsible for this record - #[prost(enumeration = "PartyType", repeated, packed = "false", tag = "6")] + #[prost(enumeration = "PartyType", repeated, tag = "6")] pub responsible_parties: ::prost::alloc::vec::Vec, } /// InputSpecification defines a name, type_name, and source reference (either on or off chain) to define an input @@ -311,6 +312,16 @@ impl DefinitionType { DefinitionType::RecordList => "DEFINITION_TYPE_RECORD_LIST", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DEFINITION_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "DEFINITION_TYPE_PROPOSED" => Some(Self::Proposed), + "DEFINITION_TYPE_RECORD" => Some(Self::Record), + "DEFINITION_TYPE_RECORD_LIST" => Some(Self::RecordList), + _ => None, + } + } } /// PartyType are the different roles parties on a contract may use #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -359,6 +370,23 @@ impl PartyType { PartyType::Validator => "PARTY_TYPE_VALIDATOR", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PARTY_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "PARTY_TYPE_ORIGINATOR" => Some(Self::Originator), + "PARTY_TYPE_SERVICER" => Some(Self::Servicer), + "PARTY_TYPE_INVESTOR" => Some(Self::Investor), + "PARTY_TYPE_CUSTODIAN" => Some(Self::Custodian), + "PARTY_TYPE_OWNER" => Some(Self::Owner), + "PARTY_TYPE_AFFILIATE" => Some(Self::Affiliate), + "PARTY_TYPE_OMNIBUS" => Some(Self::Omnibus), + "PARTY_TYPE_PROVENANCE" => Some(Self::Provenance), + "PARTY_TYPE_CONTROLLER" => Some(Self::Controller), + "PARTY_TYPE_VALIDATOR" => Some(Self::Validator), + _ => None, + } + } } /// Scope defines a root reference for a collection of records owned by one or more parties. #[allow(clippy::derive_partial_eq_without_eq)] @@ -374,20 +402,22 @@ pub struct Scope { /// the data within the scope. These addresses are in union with parties listed on the sessions. #[prost(message, repeated, tag = "3")] pub owners: ::prost::alloc::vec::Vec, - /// Addessses in this list are authorized to recieve off-chain data associated with this scope. + /// Addresses in this list are authorized to receive off-chain data associated with this scope. #[prost(string, repeated, tag = "4")] pub data_access: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// An address that controls the value associated with this scope. Standard blockchain accounts and marker accounts /// are supported for this value. This attribute may only be changed by the entity indicated once it is set. #[prost(string, tag = "5")] pub value_owner_address: ::prost::alloc::string::String, + /// Whether all parties in this scope and its sessions must be present in this scope's owners field. + /// This also enables use of optional=true scope owners and session parties. + #[prost(bool, tag = "6")] + pub require_party_rollup: bool, } +/// Session defines an execution context against a specific specification instance. +/// The context will have a specification and set of parties involved. /// -/// A Session is created for an execution context against a specific specification instance -/// -/// The context will have a specification and set of parties involved. The Session may be updated several -/// times so long as the parties listed are signers on the transaction. NOTE: When there are no Records within a Scope -/// that reference a Session it is removed. +/// NOTE: When there are no more Records within a Scope that reference a Session, the Session is removed. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Session { @@ -512,6 +542,9 @@ pub struct Party { /// a role for this account within the context of the processes used #[prost(enumeration = "PartyType", tag = "2")] pub role: i32, + /// whether this party's signature is optional + #[prost(bool, tag = "3")] + pub optional: bool, } /// AuditFields capture information about the last account to make modifications and when they were made #[allow(clippy::derive_partial_eq_without_eq)] @@ -536,6 +569,17 @@ pub struct AuditFields { #[prost(string, tag = "6")] pub message: ::prost::alloc::string::String, } +/// NetAssetValue defines a scope's net asset value +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct NetAssetValue { + /// price is the complete value of the asset's volume + #[prost(message, optional, tag = "1")] + pub price: ::core::option::Option, + /// updated_block_height is the block height of last update + #[prost(uint64, tag = "2")] + pub updated_block_height: u64, +} /// A set of types for inputs on a record (of fact) #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -559,6 +603,15 @@ impl RecordInputStatus { RecordInputStatus::Record => "RECORD_INPUT_STATUS_RECORD", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "RECORD_INPUT_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "RECORD_INPUT_STATUS_PROPOSED" => Some(Self::Proposed), + "RECORD_INPUT_STATUS_RECORD" => Some(Self::Record), + _ => None, + } + } } /// ResultStatus indicates the various states of execution of a record #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -566,7 +619,7 @@ impl RecordInputStatus { pub enum ResultStatus { /// RESULT_STATUS_UNSPECIFIED indicates an unset condition Unspecified = 0, - /// RESULT_STATUS_PASS indicates the execution was successfult + /// RESULT_STATUS_PASS indicates the execution was successful Pass = 1, /// RESULT_STATUS_SKIP indicates condition/consideration was skipped due to missing inputs or delayed execution Skip = 2, @@ -586,6 +639,16 @@ impl ResultStatus { ResultStatus::Fail => "RESULT_STATUS_FAIL", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "RESULT_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "RESULT_STATUS_PASS" => Some(Self::Pass), + "RESULT_STATUS_SKIP" => Some(Self::Skip), + "RESULT_STATUS_FAIL" => Some(Self::Fail), + _ => None, + } + } } /// MsgWriteScopeRequest is the request type for the Msg/WriteScope RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -610,6 +673,9 @@ pub struct MsgWriteScopeRequest { /// returned. #[prost(string, tag = "4")] pub spec_uuid: ::prost::alloc::string::String, + /// usd_mills value of scope in usd mills (1234 = $1.234) used for net asset value + #[prost(uint64, tag = "5")] + pub usd_mills: u64, } /// MsgWriteScopeResponse is the response type for the Msg/WriteScope RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -631,7 +697,7 @@ pub struct MsgDeleteScopeRequest { } /// MsgDeleteScopeResponse is the response type for the Msg/DeleteScope RPC method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgDeleteScopeResponse {} /// MsgAddScopeDataAccessRequest is the request to add data access AccAddress to scope #[allow(clippy::derive_partial_eq_without_eq)] @@ -649,7 +715,7 @@ pub struct MsgAddScopeDataAccessRequest { } /// MsgAddScopeDataAccessResponse is the response for adding data access AccAddress to scope #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgAddScopeDataAccessResponse {} /// MsgDeleteScopeDataAccessRequest is the request to remove data access AccAddress to scope #[allow(clippy::derive_partial_eq_without_eq)] @@ -667,7 +733,7 @@ pub struct MsgDeleteScopeDataAccessRequest { } /// MsgDeleteScopeDataAccessResponse is the response from removing data access AccAddress to scope #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgDeleteScopeDataAccessResponse {} /// MsgAddScopeOwnerRequest is the request to add owner AccAddress to scope #[allow(clippy::derive_partial_eq_without_eq)] @@ -676,7 +742,7 @@ pub struct MsgAddScopeOwnerRequest { /// scope MetadataAddress for updating data access #[prost(bytes = "vec", tag = "1")] pub scope_id: ::prost::alloc::vec::Vec, - /// AccAddress owner addresses to be added to scope + /// owner parties to add to the scope #[prost(message, repeated, tag = "2")] pub owners: ::prost::alloc::vec::Vec, /// signers is the list of address of those signing this request. @@ -685,7 +751,7 @@ pub struct MsgAddScopeOwnerRequest { } /// MsgAddScopeOwnerResponse is the response for adding owner AccAddresses to scope #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgAddScopeOwnerResponse {} /// MsgDeleteScopeOwnerRequest is the request to remove owner AccAddresses to scope #[allow(clippy::derive_partial_eq_without_eq)] @@ -703,8 +769,44 @@ pub struct MsgDeleteScopeOwnerRequest { } /// MsgDeleteScopeOwnerResponse is the response from removing owner AccAddress to scope #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgDeleteScopeOwnerResponse {} +/// MsgUpdateValueOwnersRequest is the request to update the value owner addresses in one or more scopes. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateValueOwnersRequest { + /// scope_ids are the scope metadata addresses of all scopes to be updated. + #[prost(bytes = "vec", repeated, tag = "1")] + pub scope_ids: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, + /// value_owner_address is the address of the new value owner for the provided scopes. + #[prost(string, tag = "2")] + pub value_owner_address: ::prost::alloc::string::String, + /// signers is the list of addresses of those signing this request. + #[prost(string, repeated, tag = "3")] + pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// MsgUpdateValueOwnersResponse is the response from updating value owner addresses in one or more scopes. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgUpdateValueOwnersResponse {} +/// MsgMigrateValueOwnerRequest is the request to migrate all scopes with one value owner to another value owner. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMigrateValueOwnerRequest { + /// existing is the value owner address that is being migrated. + #[prost(string, tag = "1")] + pub existing: ::prost::alloc::string::String, + /// proposed is the new value owner address for all of existing's scopes. + #[prost(string, tag = "2")] + pub proposed: ::prost::alloc::string::String, + /// signers is the list of addresses of those signing this request. + #[prost(string, repeated, tag = "3")] + pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// MsgMigrateValueOwnerResponse is the response from migrating a value owner address. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgMigrateValueOwnerResponse {} /// MsgWriteSessionRequest is the request type for the Msg/WriteSession RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -791,6 +893,7 @@ pub struct MsgWriteRecordRequest { #[prost(string, tag = "4")] pub contract_spec_uuid: ::prost::alloc::string::String, /// parties is the list of parties involved with this record. + /// Deprecated: This field is ignored. The parties are identified in the session and as signers. #[prost(message, repeated, tag = "5")] pub parties: ::prost::alloc::vec::Vec, } @@ -813,7 +916,7 @@ pub struct MsgDeleteRecordRequest { } /// MsgDeleteRecordResponse is the response type for the Msg/DeleteRecord RPC method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgDeleteRecordResponse {} /// MsgWriteScopeSpecificationRequest is the request type for the Msg/WriteScopeSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -854,7 +957,7 @@ pub struct MsgDeleteScopeSpecificationRequest { } /// MsgDeleteScopeSpecificationResponse is the response type for the Msg/DeleteScopeSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgDeleteScopeSpecificationResponse {} /// MsgWriteContractSpecificationRequest is the request type for the Msg/WriteContractSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -899,7 +1002,7 @@ pub struct MsgAddContractSpecToScopeSpecRequest { } /// MsgAddContractSpecToScopeSpecResponse is the response type for the Msg/AddContractSpecToScopeSpec RPC method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgAddContractSpecToScopeSpecResponse {} /// MsgDeleteContractSpecFromScopeSpecRequest is the request type for the Msg/DeleteContractSpecFromScopeSpec RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -917,7 +1020,7 @@ pub struct MsgDeleteContractSpecFromScopeSpecRequest { /// MsgDeleteContractSpecFromScopeSpecResponse is the response type for the Msg/DeleteContractSpecFromScopeSpec RPC /// method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgDeleteContractSpecFromScopeSpecResponse {} /// MsgDeleteContractSpecificationRequest is the request type for the Msg/DeleteContractSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -931,7 +1034,7 @@ pub struct MsgDeleteContractSpecificationRequest { } /// MsgDeleteContractSpecificationResponse is the response type for the Msg/DeleteContractSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgDeleteContractSpecificationResponse {} /// MsgWriteRecordSpecificationRequest is the request type for the Msg/WriteRecordSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -973,116 +1076,139 @@ pub struct MsgDeleteRecordSpecificationRequest { } /// MsgDeleteRecordSpecificationResponse is the response type for the Msg/DeleteRecordSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgDeleteRecordSpecificationResponse {} -/// MsgWriteP8eContractSpecRequest is the request type for the Msg/WriteP8eContractSpec RPC method. +/// MsgBindOSLocatorRequest is the request type for the Msg/BindOSLocator RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgBindOsLocatorRequest { + /// The object locator to bind the address to bind to the URI. + #[prost(message, optional, tag = "1")] + pub locator: ::core::option::Option, +} +/// MsgBindOSLocatorResponse is the response type for the Msg/BindOSLocator RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgBindOsLocatorResponse { + #[prost(message, optional, tag = "1")] + pub locator: ::core::option::Option, +} +/// MsgDeleteOSLocatorRequest is the request type for the Msg/DeleteOSLocator RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgDeleteOsLocatorRequest { + /// The record being removed + #[prost(message, optional, tag = "1")] + pub locator: ::core::option::Option, +} +/// MsgDeleteOSLocatorResponse is the response type for the Msg/DeleteOSLocator RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgDeleteOsLocatorResponse { + #[prost(message, optional, tag = "1")] + pub locator: ::core::option::Option, +} +/// MsgModifyOSLocatorRequest is the request type for the Msg/ModifyOSLocator RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgModifyOsLocatorRequest { + /// The object locator to bind the address to bind to the URI. + #[prost(message, optional, tag = "1")] + pub locator: ::core::option::Option, +} +/// MsgModifyOSLocatorResponse is the response type for the Msg/ModifyOSLocator RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgModifyOsLocatorResponse { + #[prost(message, optional, tag = "1")] + pub locator: ::core::option::Option, +} +/// MsgSetAccountDataRequest is the request to set/update/delete a scope's account data. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetAccountDataRequest { + /// The identifier to associate the data with. + /// Currently, only scope ids are supported. + #[prost(bytes = "vec", tag = "1")] + pub metadata_addr: ::prost::alloc::vec::Vec, + /// The desired accountdata value. + #[prost(string, tag = "2")] + pub value: ::prost::alloc::string::String, + /// The signers of this message. Must fulfill owner requirements of the scope. + #[prost(string, repeated, tag = "3")] + pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// MsgSetAccountDataResponse is the response from setting/updating/deleting a scope's account data. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgSetAccountDataResponse {} +/// MsgWriteP8eContractSpecRequest has been deprecated and is no longer usable. +/// Deprecated: This message is no longer part of any endpoint and cannot be used for anything. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWriteP8eContractSpecRequest { - /// ContractSpec v39 p8e ContractSpect to be converted into a v40 #[prost(message, optional, tag = "1")] pub contractspec: ::core::option::Option, #[prost(string, repeated, tag = "2")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -/// MsgWriteP8eContractSpecResponse is the response type for the Msg/WriteP8eContractSpec RPC method. +/// MsgWriteP8eContractSpecResponse has been deprecated and is no longer usable. +/// Deprecated: This message is no longer part of any endpoint and cannot be used for anything. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWriteP8eContractSpecResponse { - /// contract_spec_id_info contains information about the id/address of the contract specification that was added or - /// updated. #[prost(message, optional, tag = "1")] pub contract_spec_id_info: ::core::option::Option, - /// record_spec_id_infos contains information about the ids/addresses of the record specifications that were added or - /// updated. #[prost(message, repeated, tag = "2")] pub record_spec_id_infos: ::prost::alloc::vec::Vec, } -/// MsgP8eMemorializeContractRequest is the request type for the Msg/P8eMemorializeContract RPC method. +/// MsgP8eMemorializeContractRequest has been deprecated and is no longer usable. +/// Deprecated: This message is no longer part of any endpoint and cannot be used for anything. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgP8eMemorializeContractRequest { - /// The scope id of the object being add or modified on blockchain. #[prost(string, tag = "1")] pub scope_id: ::prost::alloc::string::String, - /// The uuid of the contract execution. #[prost(string, tag = "2")] pub group_id: ::prost::alloc::string::String, - /// The scope specification id. #[prost(string, tag = "3")] pub scope_specification_id: ::prost::alloc::string::String, - /// The new recitals for the scope. Used in leu of Contract for direct ownership changes. #[prost(message, optional, tag = "4")] pub recitals: ::core::option::Option, - /// The executed contract. #[prost(message, optional, tag = "5")] pub contract: ::core::option::Option, - /// The contract signatures #[prost(message, optional, tag = "6")] pub signatures: ::core::option::Option, - /// The bech32 address of the notary (ie the broadcaster of this message). #[prost(string, tag = "7")] pub invoker: ::prost::alloc::string::String, } -/// MsgP8eMemorializeContractResponse is the response type for the Msg/P8eMemorializeContract RPC method. +/// MsgP8eMemorializeContractResponse has been deprecated and is no longer usable. +/// Deprecated: This message is no longer part of any endpoint and cannot be used for anything. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgP8eMemorializeContractResponse { - /// scope_id_info contains information about the id/address of the scope that was added or updated. #[prost(message, optional, tag = "1")] pub scope_id_info: ::core::option::Option, - /// session_id_info contains information about the id/address of the session that was added or updated. #[prost(message, optional, tag = "2")] pub session_id_info: ::core::option::Option, - /// record_id_infos contains information about the ids/addresses of the records that were added or updated. #[prost(message, repeated, tag = "3")] pub record_id_infos: ::prost::alloc::vec::Vec, } -/// MsgBindOSLocatorRequest is the request type for the Msg/BindOSLocator RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgBindOsLocatorRequest { - /// The object locator to bind the address to bind to the URI. - #[prost(message, optional, tag = "1")] - pub locator: ::core::option::Option, -} -/// MsgBindOSLocatorResponse is the response type for the Msg/BindOSLocator RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgBindOsLocatorResponse { - #[prost(message, optional, tag = "1")] - pub locator: ::core::option::Option, -} -/// MsgDeleteOSLocatorRequest is the request type for the Msg/DeleteOSLocator RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgDeleteOsLocatorRequest { - /// The record being removed - #[prost(message, optional, tag = "1")] - pub locator: ::core::option::Option, -} -/// MsgDeleteOSLocatorResponse is the response type for the Msg/DeleteOSLocator RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgDeleteOsLocatorResponse { - #[prost(message, optional, tag = "1")] - pub locator: ::core::option::Option, -} -/// MsgModifyOSLocatorRequest is the request type for the Msg/ModifyOSLocator RPC method. +/// MsgAddNetAssetValuesRequest defines the Msg/AddNetAssetValues request type #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgModifyOsLocatorRequest { - /// The object locator to bind the address to bind to the URI. - #[prost(message, optional, tag = "1")] - pub locator: ::core::option::Option, +pub struct MsgAddNetAssetValuesRequest { + #[prost(string, tag = "1")] + pub scope_id: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "2")] + pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "3")] + pub net_asset_values: ::prost::alloc::vec::Vec, } -/// MsgModifyOSLocatorResponse is the response type for the Msg/ModifyOSLocator RPC method. +/// MsgAddNetAssetValuesResponse defines the Msg/AddNetAssetValue response type #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgModifyOsLocatorResponse { - #[prost(message, optional, tag = "1")] - pub locator: ::core::option::Option, -} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgAddNetAssetValuesResponse {} /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] @@ -1101,7 +1227,7 @@ pub mod msg_client { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where - D: std::convert::TryInto, + D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; @@ -1153,11 +1279,28 @@ pub mod msg_client { self.inner = self.inner.accept_compressed(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } /// WriteScope adds or updates a scope. pub async fn write_scope( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1167,13 +1310,17 @@ pub mod msg_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Msg/WriteScope"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Msg", "WriteScope")); + self.inner.unary(req, path, codec).await } /// DeleteScope deletes a scope and all associated Records, Sessions. pub async fn delete_scope( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1183,13 +1330,17 @@ pub mod msg_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Msg/DeleteScope"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Msg", "DeleteScope")); + self.inner.unary(req, path, codec).await } /// AddScopeDataAccess adds data access AccAddress to scope pub async fn add_scope_data_access( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1200,14 +1351,21 @@ pub mod msg_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Msg/AddScopeDataAccess", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "AddScopeDataAccess", + )); + self.inner.unary(req, path, codec).await } /// DeleteScopeDataAccess removes data access AccAddress from scope pub async fn delete_scope_data_access( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1218,13 +1376,19 @@ pub mod msg_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Msg/DeleteScopeDataAccess", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "DeleteScopeDataAccess", + )); + self.inner.unary(req, path, codec).await } - /// AddScopeOwner adds new owner AccAddress to scope + /// AddScopeOwner adds new owner parties to a scope pub async fn add_scope_owner( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1234,13 +1398,19 @@ pub mod msg_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Msg/AddScopeOwner"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "AddScopeOwner", + )); + self.inner.unary(req, path, codec).await } - /// DeleteScopeOwner removes data access AccAddress from scope + /// DeleteScopeOwner removes owner parties (by addresses) from a scope pub async fn delete_scope_owner( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1251,13 +1421,65 @@ pub mod msg_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Msg/DeleteScopeOwner", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "DeleteScopeOwner", + )); + self.inner.unary(req, path, codec).await + } + /// UpdateValueOwners sets the value owner of one or more scopes. + pub async fn update_value_owners( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.metadata.v1.Msg/UpdateValueOwners", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "UpdateValueOwners", + )); + self.inner.unary(req, path, codec).await + } + /// MigrateValueOwner updates all scopes that have one value owner to have a another value owner. + pub async fn migrate_value_owner( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.metadata.v1.Msg/MigrateValueOwner", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "MigrateValueOwner", + )); + self.inner.unary(req, path, codec).await } /// WriteSession adds or updates a session context. pub async fn write_session( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1267,13 +1489,19 @@ pub mod msg_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Msg/WriteSession"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "WriteSession", + )); + self.inner.unary(req, path, codec).await } /// WriteRecord adds or updates a record. pub async fn write_record( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1283,13 +1511,17 @@ pub mod msg_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Msg/WriteRecord"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Msg", "WriteRecord")); + self.inner.unary(req, path, codec).await } /// DeleteRecord deletes a record. pub async fn delete_record( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1299,14 +1531,21 @@ pub mod msg_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Msg/DeleteRecord"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "DeleteRecord", + )); + self.inner.unary(req, path, codec).await } /// WriteScopeSpecification adds or updates a scope specification. pub async fn write_scope_specification( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1317,14 +1556,21 @@ pub mod msg_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Msg/WriteScopeSpecification", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "WriteScopeSpecification", + )); + self.inner.unary(req, path, codec).await } /// DeleteScopeSpecification deletes a scope specification. pub async fn delete_scope_specification( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1335,14 +1581,21 @@ pub mod msg_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Msg/DeleteScopeSpecification", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "DeleteScopeSpecification", + )); + self.inner.unary(req, path, codec).await } /// WriteContractSpecification adds or updates a contract specification. pub async fn write_contract_specification( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1353,14 +1606,21 @@ pub mod msg_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Msg/WriteContractSpecification", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "WriteContractSpecification", + )); + self.inner.unary(req, path, codec).await } /// DeleteContractSpecification deletes a contract specification. pub async fn delete_contract_specification( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1371,14 +1631,21 @@ pub mod msg_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Msg/DeleteContractSpecification", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "DeleteContractSpecification", + )); + self.inner.unary(req, path, codec).await } /// AddContractSpecToScopeSpec adds contract specification to a scope specification. pub async fn add_contract_spec_to_scope_spec( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1389,14 +1656,21 @@ pub mod msg_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Msg/AddContractSpecToScopeSpec", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "AddContractSpecToScopeSpec", + )); + self.inner.unary(req, path, codec).await } /// DeleteContractSpecFromScopeSpec deletes a contract specification from a scope specification. pub async fn delete_contract_spec_from_scope_spec( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1407,14 +1681,21 @@ pub mod msg_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Msg/DeleteContractSpecFromScopeSpec", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "DeleteContractSpecFromScopeSpec", + )); + self.inner.unary(req, path, codec).await } /// WriteRecordSpecification adds or updates a record specification. pub async fn write_record_specification( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1425,14 +1706,21 @@ pub mod msg_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Msg/WriteRecordSpecification", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "WriteRecordSpecification", + )); + self.inner.unary(req, path, codec).await } /// DeleteRecordSpecification deletes a record specification. pub async fn delete_record_specification( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1443,14 +1731,18 @@ pub mod msg_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Msg/DeleteRecordSpecification", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "DeleteRecordSpecification", + )); + self.inner.unary(req, path, codec).await } - /// WriteP8eContractSpec adds a P8e v39 contract spec as a v40 ContractSpecification - /// It only exists to help facilitate the transition. Users should transition to WriteContractSpecification. - pub async fn write_p8e_contract_spec( + /// BindOSLocator binds an owner address to a uri. + pub async fn bind_os_locator( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( @@ -1459,17 +1751,20 @@ pub mod msg_client { ) })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/provenance.metadata.v1.Msg/WriteP8eContractSpec", - ); - self.inner.unary(request.into_request(), path, codec).await + let path = + http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Msg/BindOSLocator"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "BindOSLocator", + )); + self.inner.unary(req, path, codec).await } - /// P8EMemorializeContract records the results of a P8e contract execution as a session and set of records in a scope - /// It only exists to help facilitate the transition. Users should transition to calling the individual Write methods. - pub async fn p8e_memorialize_contract( + /// DeleteOSLocator deletes an existing ObjectStoreLocator record. + pub async fn delete_os_locator( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( @@ -1478,16 +1773,21 @@ pub mod msg_client { ) })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/provenance.metadata.v1.Msg/P8eMemorializeContract", - ); - self.inner.unary(request.into_request(), path, codec).await + let path = + http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Msg/DeleteOSLocator"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "DeleteOSLocator", + )); + self.inner.unary(req, path, codec).await } - /// BindOSLocator binds an owner address to a uri. - pub async fn bind_os_locator( + /// ModifyOSLocator updates an ObjectStoreLocator record by the current owner. + pub async fn modify_os_locator( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1496,14 +1796,21 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = - http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Msg/BindOSLocator"); - self.inner.unary(request.into_request(), path, codec).await + http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Msg/ModifyOSLocator"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "ModifyOSLocator", + )); + self.inner.unary(req, path, codec).await } - /// DeleteOSLocator deletes an existing ObjectStoreLocator record. - pub async fn delete_os_locator( + /// SetAccountData associates some basic data with a metadata address. + /// Currently, only scope ids are supported. + pub async fn set_account_data( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1512,14 +1819,20 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = - http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Msg/DeleteOSLocator"); - self.inner.unary(request.into_request(), path, codec).await + http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Msg/SetAccountData"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "SetAccountData", + )); + self.inner.unary(req, path, codec).await } - /// ModifyOSLocator updates an ObjectStoreLocator record by the current owner. - pub async fn modify_os_locator( + /// AddNetAssetValues set the net asset value for a scope + pub async fn add_net_asset_values( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -1527,9 +1840,15 @@ pub mod msg_client { ) })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Msg/ModifyOSLocator"); - self.inner.unary(request.into_request(), path, codec).await + let path = http::uri::PathAndQuery::from_static( + "/provenance.metadata.v1.Msg/AddNetAssetValues", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "AddNetAssetValues", + )); + self.inner.unary(req, path, codec).await } } } @@ -1546,133 +1865,171 @@ pub mod msg_server { async fn write_scope( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// DeleteScope deletes a scope and all associated Records, Sessions. async fn delete_scope( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// AddScopeDataAccess adds data access AccAddress to scope async fn add_scope_data_access( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// DeleteScopeDataAccess removes data access AccAddress from scope async fn delete_scope_data_access( &self, request: tonic::Request, - ) -> Result, tonic::Status>; - /// AddScopeOwner adds new owner AccAddress to scope + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// AddScopeOwner adds new owner parties to a scope async fn add_scope_owner( &self, request: tonic::Request, - ) -> Result, tonic::Status>; - /// DeleteScopeOwner removes data access AccAddress from scope + ) -> std::result::Result, tonic::Status>; + /// DeleteScopeOwner removes owner parties (by addresses) from a scope async fn delete_scope_owner( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; + /// UpdateValueOwners sets the value owner of one or more scopes. + async fn update_value_owners( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// MigrateValueOwner updates all scopes that have one value owner to have a another value owner. + async fn migrate_value_owner( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; /// WriteSession adds or updates a session context. async fn write_session( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// WriteRecord adds or updates a record. async fn write_record( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// DeleteRecord deletes a record. async fn delete_record( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// WriteScopeSpecification adds or updates a scope specification. async fn write_scope_specification( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// DeleteScopeSpecification deletes a scope specification. async fn delete_scope_specification( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// WriteContractSpecification adds or updates a contract specification. async fn write_contract_specification( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// DeleteContractSpecification deletes a contract specification. async fn delete_contract_specification( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// AddContractSpecToScopeSpec adds contract specification to a scope specification. async fn add_contract_spec_to_scope_spec( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// DeleteContractSpecFromScopeSpec deletes a contract specification from a scope specification. async fn delete_contract_spec_from_scope_spec( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// WriteRecordSpecification adds or updates a record specification. async fn write_record_specification( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// DeleteRecordSpecification deletes a record specification. async fn delete_record_specification( &self, request: tonic::Request, - ) -> Result, tonic::Status>; - /// WriteP8eContractSpec adds a P8e v39 contract spec as a v40 ContractSpecification - /// It only exists to help facilitate the transition. Users should transition to WriteContractSpecification. - async fn write_p8e_contract_spec( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// P8EMemorializeContract records the results of a P8e contract execution as a session and set of records in a scope - /// It only exists to help facilitate the transition. Users should transition to calling the individual Write methods. - async fn p8e_memorialize_contract( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// BindOSLocator binds an owner address to a uri. async fn bind_os_locator( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// DeleteOSLocator deletes an existing ObjectStoreLocator record. async fn delete_os_locator( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// ModifyOSLocator updates an ObjectStoreLocator record by the current owner. async fn modify_os_locator( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; + /// SetAccountData associates some basic data with a metadata address. + /// Currently, only scope ids are supported. + async fn set_account_data( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// AddNetAssetValues set the net asset value for a scope + async fn add_net_asset_values( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } /// Msg defines the Metadata Msg service. #[derive(Debug)] pub struct MsgServer { - inner: _Inner, + inner: Arc, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, } - struct _Inner(Arc); impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService @@ -1693,6 +2050,22 @@ pub mod msg_server { self.send_compression_encodings.enable(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } } impl tonic::codegen::Service> for MsgServer where @@ -1703,11 +2076,13 @@ pub mod msg_server { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); match req.uri().path() { "/provenance.metadata.v1.Msg/WriteScope" => { #[allow(non_camel_case_types)] @@ -1719,22 +2094,28 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).write_scope(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::write_scope(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = WriteScopeSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -1750,22 +2131,29 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).delete_scope(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::delete_scope(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = DeleteScopeSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -1783,22 +2171,30 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).add_scope_data_access(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::add_scope_data_access(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = AddScopeDataAccessSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -1816,23 +2212,30 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = - async move { (*inner).delete_scope_data_access(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_scope_data_access(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = DeleteScopeDataAccessSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -1848,22 +2251,29 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).add_scope_owner(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::add_scope_owner(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = AddScopeOwnerSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -1881,22 +2291,112 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).delete_scope_owner(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_scope_owner(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = DeleteScopeOwnerSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/UpdateValueOwners" => { + #[allow(non_camel_case_types)] + struct UpdateValueOwnersSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateValueOwnersSvc + { + type Response = super::MsgUpdateValueOwnersResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_value_owners(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = UpdateValueOwnersSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/MigrateValueOwner" => { + #[allow(non_camel_case_types)] + struct MigrateValueOwnerSvc(pub Arc); + impl tonic::server::UnaryService + for MigrateValueOwnerSvc + { + type Response = super::MsgMigrateValueOwnerResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::migrate_value_owner(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = MigrateValueOwnerSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -1912,22 +2412,29 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).write_session(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::write_session(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = WriteSessionSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -1943,22 +2450,29 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).write_record(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::write_record(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = WriteRecordSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -1974,22 +2488,29 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).delete_record(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::delete_record(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = DeleteRecordSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -2008,23 +2529,30 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = - async move { (*inner).write_scope_specification(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::write_scope_specification(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = WriteScopeSpecificationSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -2043,23 +2571,30 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = - async move { (*inner).delete_scope_specification(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_scope_specification(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = DeleteScopeSpecificationSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -2078,23 +2613,30 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = - async move { (*inner).write_contract_specification(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::write_contract_specification(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = WriteContractSpecificationSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -2113,24 +2655,30 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner).delete_contract_specification(request).await + ::delete_contract_specification(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = DeleteContractSpecificationSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -2149,24 +2697,30 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner).add_contract_spec_to_scope_spec(request).await + ::add_contract_spec_to_scope_spec(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = AddContractSpecToScopeSpecSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -2188,24 +2742,31 @@ pub mod msg_server { super::MsgDeleteContractSpecFromScopeSpecRequest, >, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner).delete_contract_spec_from_scope_spec(request).await + ::delete_contract_spec_from_scope_spec(&inner, request) + .await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = DeleteContractSpecFromScopeSpecSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -2224,23 +2785,30 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = - async move { (*inner).write_record_specification(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::write_record_specification(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = WriteRecordSpecificationSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -2259,189 +2827,227 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = - async move { (*inner).delete_record_specification(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_record_specification(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = DeleteRecordSpecificationSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/provenance.metadata.v1.Msg/WriteP8eContractSpec" => { + "/provenance.metadata.v1.Msg/BindOSLocator" => { #[allow(non_camel_case_types)] - struct WriteP8eContractSpecSvc(pub Arc); - impl tonic::server::UnaryService - for WriteP8eContractSpecSvc - { - type Response = super::MsgWriteP8eContractSpecResponse; + struct BindOSLocatorSvc(pub Arc); + impl tonic::server::UnaryService for BindOSLocatorSvc { + type Response = super::MsgBindOsLocatorResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = - async move { (*inner).write_p8e_contract_spec(request).await }; + async move { ::bind_os_locator(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = WriteP8eContractSpecSvc(inner); + let method = BindOSLocatorSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/provenance.metadata.v1.Msg/P8eMemorializeContract" => { + "/provenance.metadata.v1.Msg/DeleteOSLocator" => { #[allow(non_camel_case_types)] - struct P8eMemorializeContractSvc(pub Arc); - impl - tonic::server::UnaryService - for P8eMemorializeContractSvc + struct DeleteOSLocatorSvc(pub Arc); + impl tonic::server::UnaryService + for DeleteOSLocatorSvc { - type Response = super::MsgP8eMemorializeContractResponse; + type Response = super::MsgDeleteOsLocatorResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = - async move { (*inner).p8e_memorialize_contract(request).await }; + async move { ::delete_os_locator(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = P8eMemorializeContractSvc(inner); + let method = DeleteOSLocatorSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/provenance.metadata.v1.Msg/BindOSLocator" => { + "/provenance.metadata.v1.Msg/ModifyOSLocator" => { #[allow(non_camel_case_types)] - struct BindOSLocatorSvc(pub Arc); - impl tonic::server::UnaryService for BindOSLocatorSvc { - type Response = super::MsgBindOsLocatorResponse; + struct ModifyOSLocatorSvc(pub Arc); + impl tonic::server::UnaryService + for ModifyOSLocatorSvc + { + type Response = super::MsgModifyOsLocatorResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).bind_os_locator(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::modify_os_locator(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = BindOSLocatorSvc(inner); + let method = ModifyOSLocatorSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/provenance.metadata.v1.Msg/DeleteOSLocator" => { + "/provenance.metadata.v1.Msg/SetAccountData" => { #[allow(non_camel_case_types)] - struct DeleteOSLocatorSvc(pub Arc); - impl tonic::server::UnaryService - for DeleteOSLocatorSvc - { - type Response = super::MsgDeleteOsLocatorResponse; + struct SetAccountDataSvc(pub Arc); + impl tonic::server::UnaryService for SetAccountDataSvc { + type Response = super::MsgSetAccountDataResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).delete_os_locator(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::set_account_data(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = DeleteOSLocatorSvc(inner); + let method = SetAccountDataSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/provenance.metadata.v1.Msg/ModifyOSLocator" => { + "/provenance.metadata.v1.Msg/AddNetAssetValues" => { #[allow(non_camel_case_types)] - struct ModifyOSLocatorSvc(pub Arc); - impl tonic::server::UnaryService - for ModifyOSLocatorSvc + struct AddNetAssetValuesSvc(pub Arc); + impl tonic::server::UnaryService + for AddNetAssetValuesSvc { - type Response = super::MsgModifyOsLocatorResponse; + type Response = super::MsgAddNetAssetValuesResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).modify_os_locator(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::add_net_asset_values(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; - let method = ModifyOSLocatorSvc(inner); + let method = AddNetAssetValuesSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -2450,8 +3056,11 @@ pub mod msg_server { _ => Box::pin(async move { Ok(http::Response::builder() .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") + .header("grpc-status", tonic::Code::Unimplemented as i32) + .header( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ) .body(empty_body()) .unwrap()) }), @@ -2465,19 +3074,11 @@ pub mod msg_server { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, } } } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(self.0.clone()) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } impl tonic::server::NamedService for MsgServer { const NAME: &'static str = "provenance.metadata.v1.Msg"; } @@ -2709,13 +3310,28 @@ pub struct EventOsLocatorDeleted { #[prost(string, tag = "1")] pub owner: ::prost::alloc::string::String, } -/// QueryParamsRequest is the request type for the Query/Params RPC method. +/// EventSetNetAssetValue event emitted when Net Asset Value for a scope is update or added #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsRequest {} +pub struct EventSetNetAssetValue { + #[prost(string, tag = "1")] + pub scope_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub price: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub source: ::prost::alloc::string::String, +} +/// QueryParamsRequest is the request type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest { + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, +} /// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { /// params defines the parameters of the module. #[prost(message, optional, tag = "1")] @@ -2739,12 +3355,18 @@ pub struct ScopeRequest { /// record_addr is a bech32 record address, e.g. record1q2ge0zaztu65tx5x5llv5xc9ztsw42dq2jdvmdazuwzcaddhh8gmu3mcze3. #[prost(string, tag = "3")] pub record_addr: ::prost::alloc::string::String, - /// include_sessions is a flag for whether or not the sessions in the scope should be included. + /// include_sessions is a flag for whether to include the sessions of the scope in the response. #[prost(bool, tag = "10")] pub include_sessions: bool, - /// include_records is a flag for whether or not the records in the scope should be included. + /// include_records is a flag for whether to include the records of the scope in the response. #[prost(bool, tag = "11")] pub include_records: bool, + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, } /// ScopeResponse is the response type for the Query/Scope RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -2781,6 +3403,12 @@ pub struct ScopeWrapper { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ScopesAllRequest { + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, /// pagination defines optional pagination parameters for the request. #[prost(message, optional, tag = "99")] pub pagination: @@ -2820,12 +3448,18 @@ pub struct SessionsRequest { /// record_name is the name of the record to find the session for in the provided scope. #[prost(string, tag = "4")] pub record_name: ::prost::alloc::string::String, - /// include_scope is a flag for whether or not the scope containing these sessions should be included. + /// include_scope is a flag for whether to include the scope containing these sessions in the response. #[prost(bool, tag = "10")] pub include_scope: bool, - /// include_records is a flag for whether or not the records in these sessions should be included. + /// include_records is a flag for whether to include the records of these sessions in the response. #[prost(bool, tag = "11")] pub include_records: bool, + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, } /// SessionsResponse is the response type for the Query/Sessions RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -2862,6 +3496,12 @@ pub struct SessionWrapper { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SessionsAllRequest { + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, /// pagination defines optional pagination parameters for the request. #[prost(message, optional, tag = "99")] pub pagination: @@ -2901,12 +3541,18 @@ pub struct RecordsRequest { /// name is the name of the record to look for #[prost(string, tag = "4")] pub name: ::prost::alloc::string::String, - /// include_scope is a flag for whether or not the scope containing these records should be included. + /// include_scope is a flag for whether to include the the scope containing these records in the response. #[prost(bool, tag = "10")] pub include_scope: bool, - /// include_sessions is a flag for whether or not the sessions containing these records should be included. + /// include_sessions is a flag for whether to include the sessions containing these records in the response. #[prost(bool, tag = "11")] pub include_sessions: bool, + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, } /// RecordsResponse is the response type for the Query/Records RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -2943,6 +3589,12 @@ pub struct RecordWrapper { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RecordsAllRequest { + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, /// pagination defines optional pagination parameters for the request. #[prost(message, optional, tag = "99")] pub pagination: @@ -2969,6 +3621,9 @@ pub struct RecordsAllResponse { pub struct OwnershipRequest { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, /// pagination defines optional pagination parameters for the request. #[prost(message, optional, tag = "99")] pub pagination: @@ -2995,6 +3650,9 @@ pub struct OwnershipResponse { pub struct ValueOwnershipRequest { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, /// pagination defines optional pagination parameters for the request. #[prost(message, optional, tag = "99")] pub pagination: @@ -3023,6 +3681,20 @@ pub struct ScopeSpecificationRequest { /// address, e.g. scopespec1qnwg86nsatx5pl56muw0v9ytlz3qu3jx6m. #[prost(string, tag = "1")] pub specification_id: ::prost::alloc::string::String, + /// include_contract_specs is a flag for whether to include the contract specifications of the scope specification in + /// the response. + #[prost(bool, tag = "10")] + pub include_contract_specs: bool, + /// include_record_specs is a flag for whether to include the record specifications of the scope specification in the + /// response. + #[prost(bool, tag = "11")] + pub include_record_specs: bool, + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, } /// ScopeSpecificationResponse is the response type for the Query/ScopeSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -3031,6 +3703,12 @@ pub struct ScopeSpecificationResponse { /// scope_specification is the wrapped scope specification. #[prost(message, optional, tag = "1")] pub scope_specification: ::core::option::Option, + /// contract_specs is any number of wrapped contract specifications in this scope specification (if requested). + #[prost(message, repeated, tag = "2")] + pub contract_specs: ::prost::alloc::vec::Vec, + /// record_specs is any number of wrapped record specifications in this scope specification (if requested). + #[prost(message, repeated, tag = "3")] + pub record_specs: ::prost::alloc::vec::Vec, /// request is a copy of the request that generated these results. #[prost(message, optional, tag = "98")] pub request: ::core::option::Option, @@ -3050,6 +3728,12 @@ pub struct ScopeSpecificationWrapper { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ScopeSpecificationsAllRequest { + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, /// pagination defines optional pagination parameters for the request. #[prost(message, optional, tag = "99")] pub pagination: @@ -3080,10 +3764,16 @@ pub struct ContractSpecificationRequest { /// recspec1qh00d0q2e8w5say53afqdesxp2zw42dq2jdvmdazuwzcaddhh8gmuqhez44. #[prost(string, tag = "1")] pub specification_id: ::prost::alloc::string::String, - /// include_record_specs is a flag for whether or not the record specifications in this contract specification should - /// be included in the result. + /// include_record_specs is a flag for whether to include the the record specifications of this contract specification + /// in the response. #[prost(bool, tag = "10")] pub include_record_specs: bool, + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, } /// ContractSpecificationResponse is the response type for the Query/ContractSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -3115,6 +3805,12 @@ pub struct ContractSpecificationWrapper { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ContractSpecificationsAllRequest { + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, /// pagination defines optional pagination parameters for the request. #[prost(message, optional, tag = "99")] pub pagination: @@ -3146,6 +3842,12 @@ pub struct RecordSpecificationsForContractSpecificationRequest { /// recspec1qh00d0q2e8w5say53afqdesxp2zw42dq2jdvmdazuwzcaddhh8gmuqhez44. #[prost(string, tag = "1")] pub specification_id: ::prost::alloc::string::String, + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, } /// RecordSpecificationsForContractSpecificationResponse is the response type for the /// Query/RecordSpecificationsForContractSpecification RPC method. @@ -3180,6 +3882,12 @@ pub struct RecordSpecificationRequest { /// It is ignored if the specification_id is a record specification address. #[prost(string, tag = "2")] pub name: ::prost::alloc::string::String, + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, } /// RecordSpecificationResponse is the response type for the Query/RecordSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -3207,6 +3915,12 @@ pub struct RecordSpecificationWrapper { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RecordSpecificationsAllRequest { + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, /// pagination defines optional pagination parameters for the request. #[prost(message, optional, tag = "99")] pub pagination: @@ -3227,13 +3941,51 @@ pub struct RecordSpecificationsAllResponse { pub pagination: ::core::option::Option, } -/// OSLocatorParamsRequest is the request type for the Query/OSLocatorParams RPC method. +/// GetByAddrRequest is the request type for the Query/GetByAddr RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct OsLocatorParamsRequest {} -/// OSLocatorParamsResponse is the response type for the Query/OSLocatorParams RPC method. +pub struct GetByAddrRequest { + /// ids are the metadata addresses of the things to look up. + #[prost(string, repeated, tag = "1")] + pub addrs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// GetByAddrResponse is the response type for the Query/GetByAddr RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetByAddrResponse { + /// scopes contains any scopes that were requested and found. + #[prost(message, repeated, tag = "1")] + pub scopes: ::prost::alloc::vec::Vec, + /// sessions contains any sessions that were requested and found. + #[prost(message, repeated, tag = "2")] + pub sessions: ::prost::alloc::vec::Vec, + /// records contains any records that were requested and found. + #[prost(message, repeated, tag = "3")] + pub records: ::prost::alloc::vec::Vec, + /// scope_specs contains any scope specifications that were requested and found. + #[prost(message, repeated, tag = "4")] + pub scope_specs: ::prost::alloc::vec::Vec, + /// contract_specs contains any contract specifications that were requested and found. + #[prost(message, repeated, tag = "5")] + pub contract_specs: ::prost::alloc::vec::Vec, + /// record_specs contains any record specifications that were requested and found. + #[prost(message, repeated, tag = "6")] + pub record_specs: ::prost::alloc::vec::Vec, + /// not_found contains any addrs requested but not found. + #[prost(string, repeated, tag = "7")] + pub not_found: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// OSLocatorParamsRequest is the request type for the Query/OSLocatorParams RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct OsLocatorParamsRequest { + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, +} +/// OSLocatorParamsResponse is the response type for the Query/OSLocatorParams RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct OsLocatorParamsResponse { /// params defines the parameters of the module. #[prost(message, optional, tag = "1")] @@ -3248,6 +4000,9 @@ pub struct OsLocatorParamsResponse { pub struct OsLocatorRequest { #[prost(string, tag = "1")] pub owner: ::prost::alloc::string::String, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, } /// OSLocatorResponse is the response type for the Query/OSLocator RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -3265,6 +4020,9 @@ pub struct OsLocatorResponse { pub struct OsLocatorsByUriRequest { #[prost(string, tag = "1")] pub uri: ::prost::alloc::string::String, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, /// pagination defines optional pagination parameters for the request. #[prost(message, optional, tag = "99")] pub pagination: @@ -3290,6 +4048,9 @@ pub struct OsLocatorsByUriResponse { pub struct OsLocatorsByScopeRequest { #[prost(string, tag = "1")] pub scope_id: ::prost::alloc::string::String, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, } /// OSLocatorsByScopeResponse is the response type for the Query/OSLocatorsByScope RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -3305,6 +4066,9 @@ pub struct OsLocatorsByScopeResponse { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OsAllLocatorsRequest { + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, /// pagination defines optional pagination parameters for the request. #[prost(message, optional, tag = "99")] pub pagination: @@ -3324,6 +4088,39 @@ pub struct OsAllLocatorsResponse { pub pagination: ::core::option::Option, } +/// AccountDataRequest is the request type for the Query/AccountData RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AccountDataRequest { + /// The metadata address to look up. + /// Currently, only scope ids are supported. + #[prost(bytes = "vec", tag = "1")] + pub metadata_addr: ::prost::alloc::vec::Vec, +} +/// AccountDataResponse is the response type for the Query/AccountData RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AccountDataResponse { + /// The accountdata for the requested metadata address. + #[prost(string, tag = "1")] + pub value: ::prost::alloc::string::String, +} +/// QueryNetAssetValuesRequest is the request type for the Query/NetAssetValues method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryScopeNetAssetValuesRequest { + /// scopeid metadata address + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, +} +/// QueryNetAssetValuesRequest is the response type for the Query/NetAssetValues method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryScopeNetAssetValuesResponse { + /// net asset values for scope + #[prost(message, repeated, tag = "1")] + pub net_asset_values: ::prost::alloc::vec::Vec, +} /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] @@ -3342,7 +4139,7 @@ pub mod query_client { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where - D: std::convert::TryInto, + D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; @@ -3397,11 +4194,28 @@ pub mod query_client { self.inner = self.inner.accept_compressed(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } /// Params queries the parameters of x/metadata module. pub async fn params( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3410,7 +4224,10 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Query/Params"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Query", "Params")); + self.inner.unary(req, path, codec).await } /// Scope searches for a scope. /// @@ -3433,7 +4250,7 @@ pub mod query_client { pub async fn scope( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3442,13 +4259,16 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Query/Scope"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Query", "Scope")); + self.inner.unary(req, path, codec).await } /// ScopesAll retrieves all scopes. pub async fn scopes_all( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3458,7 +4278,10 @@ pub mod query_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Query/ScopesAll"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Query", "ScopesAll")); + self.inner.unary(req, path, codec).await } /// Sessions searches for sessions. /// @@ -3490,7 +4313,7 @@ pub mod query_client { pub async fn sessions( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3500,13 +4323,17 @@ pub mod query_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Query/Sessions"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Query", "Sessions")); + self.inner.unary(req, path, codec).await } /// SessionsAll retrieves all sessions. pub async fn sessions_all( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3516,7 +4343,12 @@ pub mod query_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Query/SessionsAll"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "SessionsAll", + )); + self.inner.unary(req, path, codec).await } /// Records searches for records. /// @@ -3543,7 +4375,7 @@ pub mod query_client { pub async fn records( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3553,13 +4385,17 @@ pub mod query_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Query/Records"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Query", "Records")); + self.inner.unary(req, path, codec).await } /// RecordsAll retrieves all records. pub async fn records_all( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3569,13 +4405,18 @@ pub mod query_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Query/RecordsAll"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "RecordsAll", + )); + self.inner.unary(req, path, codec).await } /// Ownership returns the scope identifiers that list the given address as either a data or value owner. pub async fn ownership( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3585,13 +4426,17 @@ pub mod query_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Query/Ownership"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Query", "Ownership")); + self.inner.unary(req, path, codec).await } /// ValueOwnership returns the scope identifiers that list the given address as the value owner. pub async fn value_ownership( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3602,16 +4447,25 @@ pub mod query_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Query/ValueOwnership", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "ValueOwnership", + )); + self.inner.unary(req, path, codec).await } /// ScopeSpecification returns a scope specification for the given specification id. /// /// The specification_id can either be a uuid, e.g. dc83ea70-eacd-40fe-9adf-1cf6148bf8a2 or a bech32 scope /// specification address, e.g. scopespec1qnwg86nsatx5pl56muw0v9ytlz3qu3jx6m. + /// + /// By default, the contract and record specifications are not included. + /// Set include_contract_specs and/or include_record_specs to true to include contract and/or record specifications. pub async fn scope_specification( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3622,13 +4476,21 @@ pub mod query_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Query/ScopeSpecification", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "ScopeSpecification", + )); + self.inner.unary(req, path, codec).await } /// ScopeSpecificationsAll retrieves all scope specifications. pub async fn scope_specifications_all( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3639,7 +4501,12 @@ pub mod query_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Query/ScopeSpecificationsAll", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "ScopeSpecificationsAll", + )); + self.inner.unary(req, path, codec).await } /// ContractSpecification returns a contract specification for the given specification id. /// @@ -3653,7 +4520,8 @@ pub mod query_client { pub async fn contract_specification( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3664,14 +4532,21 @@ pub mod query_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Query/ContractSpecification", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "ContractSpecification", + )); + self.inner.unary(req, path, codec).await } /// ContractSpecificationsAll retrieves all contract specifications. pub async fn contract_specifications_all( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3682,7 +4557,12 @@ pub mod query_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Query/ContractSpecificationsAll", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "ContractSpecificationsAll", + )); + self.inner.unary(req, path, codec).await } /// RecordSpecificationsForContractSpecification returns the record specifications for the given input. /// @@ -3693,7 +4573,7 @@ pub mod query_client { pub async fn record_specifications_for_contract_specification( &mut self, request: impl tonic::IntoRequest, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -3707,13 +4587,19 @@ pub mod query_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Query/RecordSpecificationsForContractSpecification", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "RecordSpecificationsForContractSpecification", + )); + self.inner.unary(req, path, codec).await } /// RecordSpecification returns a record specification for the given input. pub async fn record_specification( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3724,14 +4610,21 @@ pub mod query_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Query/RecordSpecification", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "RecordSpecification", + )); + self.inner.unary(req, path, codec).await } /// RecordSpecificationsAll retrieves all record specifications. pub async fn record_specifications_all( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3742,13 +4635,38 @@ pub mod query_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Query/RecordSpecificationsAll", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "RecordSpecificationsAll", + )); + self.inner.unary(req, path, codec).await + } + /// GetByAddr retrieves metadata given any address(es). + pub async fn get_by_addr( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Query/GetByAddr"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Query", "GetByAddr")); + self.inner.unary(req, path, codec).await } /// OSLocatorParams returns all parameters for the object store locator sub module. pub async fn os_locator_params( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3759,13 +4677,18 @@ pub mod query_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Query/OSLocatorParams", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "OSLocatorParams", + )); + self.inner.unary(req, path, codec).await } /// OSLocator returns an ObjectStoreLocator by its owner's address. pub async fn os_locator( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3775,13 +4698,17 @@ pub mod query_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Query/OSLocator"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Query", "OSLocator")); + self.inner.unary(req, path, codec).await } /// OSLocatorsByURI returns all ObjectStoreLocator entries for a locator uri. pub async fn os_locators_by_uri( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3792,13 +4719,19 @@ pub mod query_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Query/OSLocatorsByURI", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "OSLocatorsByURI", + )); + self.inner.unary(req, path, codec).await } /// OSLocatorsByScope returns all ObjectStoreLocator entries for a for all signer's present in the specified scope. pub async fn os_locators_by_scope( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3809,13 +4742,19 @@ pub mod query_client { let path = http::uri::PathAndQuery::from_static( "/provenance.metadata.v1.Query/OSLocatorsByScope", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "OSLocatorsByScope", + )); + self.inner.unary(req, path, codec).await } /// OSAllLocators returns all ObjectStoreLocator entries. pub async fn os_all_locators( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -3825,7 +4764,60 @@ pub mod query_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Query/OSAllLocators"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "OSAllLocators", + )); + self.inner.unary(req, path, codec).await + } + /// AccountData gets the account data associated with a metadata address. + /// Currently, only scope ids are supported. + pub async fn account_data( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/provenance.metadata.v1.Query/AccountData"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "AccountData", + )); + self.inner.unary(req, path, codec).await + } + /// ScopeNetAssetValues returns net asset values for scope + pub async fn scope_net_asset_values( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.metadata.v1.Query/ScopeNetAssetValues", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "ScopeNetAssetValues", + )); + self.inner.unary(req, path, codec).await } } } @@ -3842,7 +4834,7 @@ pub mod query_server { async fn params( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// Scope searches for a scope. /// /// The scope id, if provided, must either be scope uuid, e.g. 91978ba2-5f35-459a-86a7-feca1b0512e0 or a scope address, @@ -3864,12 +4856,12 @@ pub mod query_server { async fn scope( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// ScopesAll retrieves all scopes. async fn scopes_all( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// Sessions searches for sessions. /// /// The scope_id can either be scope uuid, e.g. 91978ba2-5f35-459a-86a7-feca1b0512e0 or a scope address, e.g. @@ -3900,12 +4892,12 @@ pub mod query_server { async fn sessions( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// SessionsAll retrieves all sessions. async fn sessions_all( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// Records searches for records. /// /// The record_addr, if provided, must be a bech32 record address, e.g. @@ -3931,35 +4923,41 @@ pub mod query_server { async fn records( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// RecordsAll retrieves all records. async fn records_all( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// Ownership returns the scope identifiers that list the given address as either a data or value owner. async fn ownership( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// ValueOwnership returns the scope identifiers that list the given address as the value owner. async fn value_ownership( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// ScopeSpecification returns a scope specification for the given specification id. /// /// The specification_id can either be a uuid, e.g. dc83ea70-eacd-40fe-9adf-1cf6148bf8a2 or a bech32 scope /// specification address, e.g. scopespec1qnwg86nsatx5pl56muw0v9ytlz3qu3jx6m. + /// + /// By default, the contract and record specifications are not included. + /// Set include_contract_specs and/or include_record_specs to true to include contract and/or record specifications. async fn scope_specification( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// ScopeSpecificationsAll retrieves all scope specifications. async fn scope_specifications_all( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// ContractSpecification returns a contract specification for the given specification id. /// /// The specification_id can either be a uuid, e.g. def6bc0a-c9dd-4874-948f-5206e6060a84, a bech32 contract @@ -3972,12 +4970,15 @@ pub mod query_server { async fn contract_specification( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// ContractSpecificationsAll retrieves all contract specifications. async fn contract_specifications_all( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// RecordSpecificationsForContractSpecification returns the record specifications for the given input. /// /// The specification_id can either be a uuid, e.g. def6bc0a-c9dd-4874-948f-5206e6060a84, a bech32 contract @@ -3987,7 +4988,7 @@ pub mod query_server { async fn record_specifications_for_contract_specification( &self, request: tonic::Request, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -3995,56 +4996,80 @@ pub mod query_server { async fn record_specification( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// RecordSpecificationsAll retrieves all record specifications. async fn record_specifications_all( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetByAddr retrieves metadata given any address(es). + async fn get_by_addr( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; /// OSLocatorParams returns all parameters for the object store locator sub module. async fn os_locator_params( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// OSLocator returns an ObjectStoreLocator by its owner's address. async fn os_locator( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// OSLocatorsByURI returns all ObjectStoreLocator entries for a locator uri. async fn os_locators_by_uri( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// OSLocatorsByScope returns all ObjectStoreLocator entries for a for all signer's present in the specified scope. async fn os_locators_by_scope( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// OSAllLocators returns all ObjectStoreLocator entries. async fn os_all_locators( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; + /// AccountData gets the account data associated with a metadata address. + /// Currently, only scope ids are supported. + async fn account_data( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// ScopeNetAssetValues returns net asset values for scope + async fn scope_net_asset_values( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } /// Query defines the Metadata Query service. #[derive(Debug)] pub struct QueryServer { - inner: _Inner, + inner: Arc, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, } - struct _Inner(Arc); impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService @@ -4065,6 +5090,22 @@ pub mod query_server { self.send_compression_encodings.enable(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } } impl tonic::codegen::Service> for QueryServer where @@ -4075,11 +5116,13 @@ pub mod query_server { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); match req.uri().path() { "/provenance.metadata.v1.Query/Params" => { #[allow(non_camel_case_types)] @@ -4091,22 +5134,28 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).params(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::params(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4122,22 +5171,28 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).scope(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::scope(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = ScopeSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4153,22 +5208,29 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).scopes_all(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::scopes_all(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = ScopesAllSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4184,22 +5246,28 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).sessions(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::sessions(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = SessionsSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4215,22 +5283,29 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).sessions_all(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::sessions_all(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = SessionsAllSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4246,22 +5321,28 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).records(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::records(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = RecordsSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4277,22 +5358,29 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).records_all(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::records_all(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = RecordsAllSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4308,22 +5396,28 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).ownership(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::ownership(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = OwnershipSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4339,22 +5433,29 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).value_ownership(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::value_ownership(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = ValueOwnershipSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4372,22 +5473,30 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).scope_specification(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::scope_specification(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = ScopeSpecificationSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4405,23 +5514,30 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = - async move { (*inner).scope_specifications_all(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::scope_specifications_all(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = ScopeSpecificationsAllSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4439,22 +5555,30 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).contract_specification(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::contract_specification(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = ContractSpecificationSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4473,23 +5597,30 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = - async move { (*inner).contract_specifications_all(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::contract_specifications_all(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = ContractSpecificationsAllSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4511,26 +5642,33 @@ pub mod query_server { super::RecordSpecificationsForContractSpecificationRequest, >, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner) - .record_specifications_for_contract_specification(request) - .await + ::record_specifications_for_contract_specification( + &inner, request, + ) + .await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = RecordSpecificationsForContractSpecificationSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4548,22 +5686,30 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).record_specification(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::record_specification(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = RecordSpecificationSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4582,23 +5728,68 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = - async move { (*inner).record_specifications_all(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::record_specifications_all(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = RecordSpecificationsAllSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/GetByAddr" => { + #[allow(non_camel_case_types)] + struct GetByAddrSvc(pub Arc); + impl tonic::server::UnaryService for GetByAddrSvc { + type Response = super::GetByAddrResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::get_by_addr(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = GetByAddrSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4616,22 +5807,30 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).os_locator_params(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::os_locator_params(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = OSLocatorParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4647,22 +5846,29 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).os_locator(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::os_locator(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = OSLocatorSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4680,22 +5886,30 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).os_locators_by_uri(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::os_locators_by_uri(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = OSLocatorsByURISvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4713,22 +5927,30 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).os_locators_by_scope(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::os_locators_by_scope(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = OSLocatorsByScopeSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4744,22 +5966,109 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).os_all_locators(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::os_all_locators(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = OSAllLocatorsSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/AccountData" => { + #[allow(non_camel_case_types)] + struct AccountDataSvc(pub Arc); + impl tonic::server::UnaryService for AccountDataSvc { + type Response = super::AccountDataResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::account_data(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = AccountDataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/ScopeNetAssetValues" => { + #[allow(non_camel_case_types)] + struct ScopeNetAssetValuesSvc(pub Arc); + impl + tonic::server::UnaryService + for ScopeNetAssetValuesSvc + { + type Response = super::QueryScopeNetAssetValuesResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::scope_net_asset_values(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = ScopeNetAssetValuesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -4768,8 +6077,11 @@ pub mod query_server { _ => Box::pin(async move { Ok(http::Response::builder() .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") + .header("grpc-status", tonic::Code::Unimplemented as i32) + .header( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ) .body(empty_body()) .unwrap()) }), @@ -4783,19 +6095,11 @@ pub mod query_server { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, } } } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(self.0.clone()) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } impl tonic::server::NamedService for QueryServer { const NAME: &'static str = "provenance.metadata.v1.Query"; } @@ -4824,4 +6128,18 @@ pub struct GenesisState { pub o_s_locator_params: ::core::option::Option, #[prost(message, repeated, tag = "9")] pub object_store_locators: ::prost::alloc::vec::Vec, + /// Net asset values assigned to scopes + #[prost(message, repeated, tag = "10")] + pub net_asset_values: ::prost::alloc::vec::Vec, +} +/// MarkerNetAssetValues defines the net asset values for a scope +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MarkerNetAssetValues { + /// address defines the scope address + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// net_asset_values that are assigned to scope + #[prost(message, repeated, tag = "2")] + pub net_asset_values: ::prost::alloc::vec::Vec, } diff --git a/provenance-sdk-proto/src/prost/provenance-sdk/provenance.msgfees.v1.rs b/provenance-sdk-proto/src/prost/provenance-sdk/provenance.msgfees.v1.rs index cba63f2..cc71bbc 100644 --- a/provenance-sdk-proto/src/prost/provenance-sdk/provenance.msgfees.v1.rs +++ b/provenance-sdk-proto/src/prost/provenance-sdk/provenance.msgfees.v1.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// MsgAssessCustomMsgFeeRequest defines an sdk.Msg type #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -8,19 +9,119 @@ pub struct MsgAssessCustomMsgFeeRequest { /// amount of additional fee that must be paid #[prost(message, optional, tag = "2")] pub amount: ::core::option::Option, - /// optional recipient address, the amount is split 50/50 between recipient and fee module. If + /// optional recipient address, the basis points amount is sent to the recipient #[prost(string, tag = "3")] pub recipient: ::prost::alloc::string::String, - /// empty, whole amount goes to fee module - /// /// the signer of the msg #[prost(string, tag = "4")] pub from: ::prost::alloc::string::String, + /// optional basis points 0 - 10,000 for recipient defaults to 10,000 + #[prost(string, tag = "5")] + pub recipient_basis_points: ::prost::alloc::string::String, } /// MsgAssessCustomMsgFeeResponse defines the Msg/AssessCustomMsgFeee response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgAssessCustomMsgFeeResponse {} +/// AddMsgFeeProposal defines a governance proposal to add additional msg based fee +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgAddMsgFeeProposalRequest { + /// type url of msg to add fee + #[prost(string, tag = "1")] + pub msg_type_url: ::prost::alloc::string::String, + /// additional fee for msg type + #[prost(message, optional, tag = "2")] + pub additional_fee: ::core::option::Option, + /// optional recipient to receive basis points + #[prost(string, tag = "3")] + pub recipient: ::prost::alloc::string::String, + /// basis points to use when recipient is present (1 - 10,000) + #[prost(string, tag = "4")] + pub recipient_basis_points: ::prost::alloc::string::String, + /// the signing authority for the proposal + #[prost(string, tag = "5")] + pub authority: ::prost::alloc::string::String, +} +/// MsgAddMsgFeeProposalResponse defines the Msg/AddMsgFeeProposal response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgAddMsgFeeProposalResponse {} +/// UpdateMsgFeeProposal defines a governance proposal to update a current msg based fee +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateMsgFeeProposalRequest { + /// type url of msg to update fee + #[prost(string, tag = "1")] + pub msg_type_url: ::prost::alloc::string::String, + /// additional fee for msg type + #[prost(message, optional, tag = "2")] + pub additional_fee: ::core::option::Option, + /// optional recipient to receive basis points + #[prost(string, tag = "3")] + pub recipient: ::prost::alloc::string::String, + /// basis points to use when recipient is present (1 - 10,000) + #[prost(string, tag = "4")] + pub recipient_basis_points: ::prost::alloc::string::String, + /// the signing authority for the proposal + #[prost(string, tag = "5")] + pub authority: ::prost::alloc::string::String, +} +/// MsgUpdateMsgFeeProposalResponse defines the Msg/RemoveMsgFeeProposal response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgUpdateMsgFeeProposalResponse {} +/// RemoveMsgFeeProposal defines a governance proposal to delete a current msg based fee +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRemoveMsgFeeProposalRequest { + /// type url of msg fee to remove + #[prost(string, tag = "1")] + pub msg_type_url: ::prost::alloc::string::String, + /// the signing authority for the proposal + /// + /// + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +/// MsgRemoveMsgFeeProposalResponse defines the Msg/RemoveMsgFeeProposal response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgRemoveMsgFeeProposalResponse {} +/// UpdateNhashPerUsdMilProposal defines a governance proposal to update the nhash per usd mil param +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateNhashPerUsdMilProposalRequest { + /// nhash_per_usd_mil is number of nhash per usd mil + #[prost(uint64, tag = "1")] + pub nhash_per_usd_mil: u64, + /// the signing authority for the proposal + /// + /// + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +/// MsgUpdateNhashPerUsdMilProposalResponse defines the Msg/UpdateNhashPerUsdMilProposal response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgUpdateNhashPerUsdMilProposalResponse {} +/// UpdateConversionFeeDenomProposal defines a governance proposal to update the msg fee conversion denom +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateConversionFeeDenomProposalRequest { + /// conversion_fee_denom is the denom that usd will be converted to + #[prost(string, tag = "1")] + pub conversion_fee_denom: ::prost::alloc::string::String, + /// the signing authority for the proposal + /// + /// + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +/// MsgUpdateConversionFeeDenomProposalResponse defines the Msg/UpdateConversionFeeDenomProposal response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgUpdateConversionFeeDenomProposalResponse {} /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] @@ -39,7 +140,7 @@ pub mod msg_client { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where - D: std::convert::TryInto, + D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; @@ -91,6 +192,22 @@ pub mod msg_client { self.inner = self.inner.accept_compressed(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } /// AssessCustomMsgFee endpoint executes the additional fee charges. /// This will only emit the event and not persist it to the keeper. Fees are handled with the custom msg fee handlers /// Use Case: smart contracts will be able to charge additional fees and direct partial funds to specified recipient @@ -98,7 +215,8 @@ pub mod msg_client { pub async fn assess_custom_msg_fee( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -109,7 +227,135 @@ pub mod msg_client { let path = http::uri::PathAndQuery::from_static( "/provenance.msgfees.v1.Msg/AssessCustomMsgFee", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.msgfees.v1.Msg", + "AssessCustomMsgFee", + )); + self.inner.unary(req, path, codec).await + } + /// AddMsgFeeProposal defines a governance proposal to add additional msg based fee + pub async fn add_msg_fee_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.msgfees.v1.Msg/AddMsgFeeProposal", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.msgfees.v1.Msg", + "AddMsgFeeProposal", + )); + self.inner.unary(req, path, codec).await + } + /// UpdateMsgFeeProposal defines a governance proposal to update a current msg based fee + pub async fn update_msg_fee_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.msgfees.v1.Msg/UpdateMsgFeeProposal", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.msgfees.v1.Msg", + "UpdateMsgFeeProposal", + )); + self.inner.unary(req, path, codec).await + } + /// RemoveMsgFeeProposal defines a governance proposal to delete a current msg based fee + pub async fn remove_msg_fee_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.msgfees.v1.Msg/RemoveMsgFeeProposal", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.msgfees.v1.Msg", + "RemoveMsgFeeProposal", + )); + self.inner.unary(req, path, codec).await + } + /// UpdateNhashPerUsdMilProposal defines a governance proposal to update the nhash per usd mil param + pub async fn update_nhash_per_usd_mil_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.msgfees.v1.Msg/UpdateNhashPerUsdMilProposal", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.msgfees.v1.Msg", + "UpdateNhashPerUsdMilProposal", + )); + self.inner.unary(req, path, codec).await + } + /// UpdateConversionFeeDenomProposal defines a governance proposal to update the msg fee conversion denom + pub async fn update_conversion_fee_denom_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/provenance.msgfees.v1.Msg/UpdateConversionFeeDenomProposal", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.msgfees.v1.Msg", + "UpdateConversionFeeDenomProposal", + )); + self.inner.unary(req, path, codec).await } } } @@ -129,26 +375,65 @@ pub mod msg_server { async fn assess_custom_msg_fee( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; + /// AddMsgFeeProposal defines a governance proposal to add additional msg based fee + async fn add_msg_fee_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// UpdateMsgFeeProposal defines a governance proposal to update a current msg based fee + async fn update_msg_fee_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// RemoveMsgFeeProposal defines a governance proposal to delete a current msg based fee + async fn remove_msg_fee_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateNhashPerUsdMilProposal defines a governance proposal to update the nhash per usd mil param + async fn update_nhash_per_usd_mil_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateConversionFeeDenomProposal defines a governance proposal to update the msg fee conversion denom + async fn update_conversion_fee_denom_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } /// Msg defines the msgfees Msg service. #[derive(Debug)] pub struct MsgServer { - inner: _Inner, + inner: Arc, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, } - struct _Inner(Arc); impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService @@ -169,6 +454,22 @@ pub mod msg_server { self.send_compression_encodings.enable(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } } impl tonic::codegen::Service> for MsgServer where @@ -179,11 +480,13 @@ pub mod msg_server { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); match req.uri().path() { "/provenance.msgfees.v1.Msg/AssessCustomMsgFee" => { #[allow(non_camel_case_types)] @@ -197,22 +500,241 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).assess_custom_msg_fee(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::assess_custom_msg_fee(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = AssessCustomMsgFeeSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.msgfees.v1.Msg/AddMsgFeeProposal" => { + #[allow(non_camel_case_types)] + struct AddMsgFeeProposalSvc(pub Arc); + impl tonic::server::UnaryService + for AddMsgFeeProposalSvc + { + type Response = super::MsgAddMsgFeeProposalResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::add_msg_fee_proposal(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = AddMsgFeeProposalSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.msgfees.v1.Msg/UpdateMsgFeeProposal" => { + #[allow(non_camel_case_types)] + struct UpdateMsgFeeProposalSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateMsgFeeProposalSvc + { + type Response = super::MsgUpdateMsgFeeProposalResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_msg_fee_proposal(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = UpdateMsgFeeProposalSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.msgfees.v1.Msg/RemoveMsgFeeProposal" => { + #[allow(non_camel_case_types)] + struct RemoveMsgFeeProposalSvc(pub Arc); + impl tonic::server::UnaryService + for RemoveMsgFeeProposalSvc + { + type Response = super::MsgRemoveMsgFeeProposalResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::remove_msg_fee_proposal(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = RemoveMsgFeeProposalSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.msgfees.v1.Msg/UpdateNhashPerUsdMilProposal" => { + #[allow(non_camel_case_types)] + struct UpdateNhashPerUsdMilProposalSvc(pub Arc); + impl + tonic::server::UnaryService + for UpdateNhashPerUsdMilProposalSvc + { + type Response = super::MsgUpdateNhashPerUsdMilProposalResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_nhash_per_usd_mil_proposal(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = UpdateNhashPerUsdMilProposalSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.msgfees.v1.Msg/UpdateConversionFeeDenomProposal" => { + #[allow(non_camel_case_types)] + struct UpdateConversionFeeDenomProposalSvc(pub Arc); + impl + tonic::server::UnaryService< + super::MsgUpdateConversionFeeDenomProposalRequest, + > for UpdateConversionFeeDenomProposalSvc + { + type Response = super::MsgUpdateConversionFeeDenomProposalResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request< + super::MsgUpdateConversionFeeDenomProposalRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_conversion_fee_denom_proposal(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = UpdateConversionFeeDenomProposalSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -221,8 +743,11 @@ pub mod msg_server { _ => Box::pin(async move { Ok(http::Response::builder() .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") + .header("grpc-status", tonic::Code::Unimplemented as i32) + .header( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ) .body(empty_body()) .unwrap()) }), @@ -236,19 +761,11 @@ pub mod msg_server { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, } } } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(self.0.clone()) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } impl tonic::server::NamedService for MsgServer { const NAME: &'static str = "provenance.msgfees.v1.Msg"; } @@ -257,34 +774,45 @@ pub mod msg_server { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { - /// constant used to calculate fees when gas fees shares denom with msg fee + /// floor_gas_price is the constant used to calculate fees when gas fees shares denom with msg fee. + /// + /// Conversions: + /// - x nhash/usd-mil = 1,000,000/x usd/hash + /// - y usd/hash = 1,000,000/y nhash/usd-mil + /// + /// Examples: + /// - 40,000,000 nhash/usd-mil = 1,000,000/40,000,000 usd/hash = $0.025/hash, + /// - $0.040/hash = 1,000,000/0.040 nhash/usd-mil = 25,000,000 nhash/usd-mil #[prost(message, optional, tag = "2")] pub floor_gas_price: ::core::option::Option, - /// total nhash per usd mil for converting usd to nhash + /// nhash_per_usd_mil is the total nhash per usd mil for converting usd to nhash. #[prost(uint64, tag = "3")] pub nhash_per_usd_mil: u64, - /// conversion fee denom is the denom usd is converted to + /// conversion_fee_denom is the denom usd is converted to. #[prost(string, tag = "4")] pub conversion_fee_denom: ::prost::alloc::string::String, } -/// MsgFee is the core of what gets stored on the blockchain -/// it consists of four parts -/// 1. the msg type url, i.e. /cosmos.bank.v1beta1.MsgSend -/// 2. minimum additional fees(can be of any denom) -/// 3. optional recipient of fee based on `recipient_basis_points` -/// 4. if recipient is declared they will recieve the basis points of the fee (0-10,000) +/// MsgFee is the core of what gets stored on the blockchain to define a msg-based fee. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgFee { + /// msg_type_url is the type-url of the message with the added fee, e.g. "/cosmos.bank.v1beta1.MsgSend". #[prost(string, tag = "1")] pub msg_type_url: ::prost::alloc::string::String, - /// additional_fee can pay in any Coin( basically a Denom and Amount, Amount can be zero) + /// additional_fee is the extra fee that is required for the given message type (can be in any denom). #[prost(message, optional, tag = "2")] pub additional_fee: ::core::option::Option, - /// optional recipient address, the amount is split between recipient and fee module + /// recipient is an option address that will receive a portion of the additional fee. + /// There can only be a recipient if the recipient_basis_points is not zero. #[prost(string, tag = "3")] pub recipient: ::prost::alloc::string::String, - /// optional split of funds between the recipient and fee module defaults to 50:50, + /// recipient_basis_points is an optional portion of the additional fee to be sent to the recipient. + /// Must be between 0 and 10,000 (inclusive). + /// + /// If there is a recipient, this must not be zero. If there is not a recipient, this must be zero. + /// + /// The recipient will receive additional_fee * recipient_basis_points / 10,000. + /// The fee collector will receive the rest, i.e. additional_fee * (10,000 - recipient_basis_points) / 10,000. #[prost(uint32, tag = "4")] pub recipient_basis_points: u32, } @@ -310,7 +838,7 @@ pub struct EventMsgFees { } /// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} /// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -388,7 +916,7 @@ pub mod query_client { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where - D: std::convert::TryInto, + D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; @@ -443,11 +971,28 @@ pub mod query_client { self.inner = self.inner.accept_compressed(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } /// Params queries the parameters for x/msgfees pub async fn params( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -456,13 +1001,17 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.msgfees.v1.Query/Params"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.msgfees.v1.Query", "Params")); + self.inner.unary(req, path, codec).await } /// Query all Msgs which have fees associated with them. pub async fn query_all_msg_fees( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -473,13 +1022,19 @@ pub mod query_client { let path = http::uri::PathAndQuery::from_static( "/provenance.msgfees.v1.Query/QueryAllMsgFees", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.msgfees.v1.Query", + "QueryAllMsgFees", + )); + self.inner.unary(req, path, codec).await } /// CalculateTxFees simulates executing a transaction for estimating gas usage and additional fees. pub async fn calculate_tx_fees( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -490,7 +1045,12 @@ pub mod query_client { let path = http::uri::PathAndQuery::from_static( "/provenance.msgfees.v1.Query/CalculateTxFees", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.msgfees.v1.Query", + "CalculateTxFees", + )); + self.inner.unary(req, path, codec).await } } } @@ -507,36 +1067,38 @@ pub mod query_server { async fn params( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// Query all Msgs which have fees associated with them. async fn query_all_msg_fees( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// CalculateTxFees simulates executing a transaction for estimating gas usage and additional fees. async fn calculate_tx_fees( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; } /// Query defines the gRPC querier service for marker module. #[derive(Debug)] pub struct QueryServer { - inner: _Inner, + inner: Arc, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, } - struct _Inner(Arc); impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService @@ -557,6 +1119,22 @@ pub mod query_server { self.send_compression_encodings.enable(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } } impl tonic::codegen::Service> for QueryServer where @@ -567,11 +1145,13 @@ pub mod query_server { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); match req.uri().path() { "/provenance.msgfees.v1.Query/Params" => { #[allow(non_camel_case_types)] @@ -583,22 +1163,28 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).params(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::params(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -616,22 +1202,30 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).query_all_msg_fees(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::query_all_msg_fees(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = QueryAllMsgFeesSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -649,22 +1243,30 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).calculate_tx_fees(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::calculate_tx_fees(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = CalculateTxFeesSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -673,8 +1275,11 @@ pub mod query_server { _ => Box::pin(async move { Ok(http::Response::builder() .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") + .header("grpc-status", tonic::Code::Unimplemented as i32) + .header( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ) .body(empty_body()) .unwrap()) }), @@ -688,19 +1293,11 @@ pub mod query_server { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, } } } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(self.0.clone()) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } impl tonic::server::NamedService for QueryServer { const NAME: &'static str = "provenance.msgfees.v1.Query"; } @@ -717,6 +1314,9 @@ pub struct GenesisState { pub msg_fees: ::prost::alloc::vec::Vec, } /// AddMsgFeeProposal defines a governance proposal to add additional msg based fee +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgAddMsgFeeProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddMsgFeeProposal { @@ -740,6 +1340,9 @@ pub struct AddMsgFeeProposal { pub recipient_basis_points: ::prost::alloc::string::String, } /// UpdateMsgFeeProposal defines a governance proposal to update a current msg based fee +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgUpdateMsgFeeProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateMsgFeeProposal { @@ -763,6 +1366,9 @@ pub struct UpdateMsgFeeProposal { pub recipient_basis_points: ::prost::alloc::string::String, } /// RemoveMsgFeeProposal defines a governance proposal to delete a current msg based fee +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgRemoveMsgFeeProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RemoveMsgFeeProposal { @@ -777,6 +1383,9 @@ pub struct RemoveMsgFeeProposal { pub msg_type_url: ::prost::alloc::string::String, } /// UpdateNhashPerUsdMilProposal defines a governance proposal to update the nhash per usd mil param +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgUpdateNhashPerUsdMilProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateNhashPerUsdMilProposal { @@ -791,6 +1400,9 @@ pub struct UpdateNhashPerUsdMilProposal { pub nhash_per_usd_mil: u64, } /// UpdateConversionFeeDenomProposal defines a governance proposal to update the msg fee conversion denom +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgUpdateConversionFeeDenomProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateConversionFeeDenomProposal { diff --git a/provenance-sdk-proto/src/prost/provenance-sdk/provenance.name.v1.rs b/provenance-sdk-proto/src/prost/provenance-sdk/provenance.name.v1.rs index 30ea14f..ea7348a 100644 --- a/provenance-sdk-proto/src/prost/provenance-sdk/provenance.name.v1.rs +++ b/provenance-sdk-proto/src/prost/provenance-sdk/provenance.name.v1.rs @@ -1,6 +1,7 @@ +// This file is @generated by prost-build. /// Params defines the set of params for the name module. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Params { /// maximum length of name segment to allow #[prost(uint32, tag = "1")] @@ -19,30 +20,37 @@ pub struct Params { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct NameRecord { - /// The bound name + /// the bound name #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, - /// The address the name resolved to. + /// the address the name resolved to #[prost(string, tag = "2")] pub address: ::prost::alloc::string::String, - /// Whether owner signature is required to add sub-names. + /// whether owner signature is required to add sub-names #[prost(bool, tag = "3")] pub restricted: bool, } /// CreateRootNameProposal details a proposal to create a new root name /// that is controlled by a given owner and optionally restricted to the owner /// for the sole creation of sub names. +/// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +/// proposals, see MsgCreateRootNameRequest. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CreateRootNameProposal { + /// proposal title #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// proposal description #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, + /// the bound name #[prost(string, tag = "3")] pub name: ::prost::alloc::string::String, + /// the address the name will resolve to #[prost(string, tag = "4")] pub owner: ::prost::alloc::string::String, + /// a flag that indicates if an owner signature is required to add sub-names #[prost(bool, tag = "5")] pub restricted: bool, } @@ -68,6 +76,30 @@ pub struct EventNameUnbound { #[prost(bool, tag = "3")] pub restricted: bool, } +/// Event emitted when name is updated. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventNameUpdate { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, + #[prost(bool, tag = "3")] + pub restricted: bool, +} +/// EventNameParamsUpdated event emitted when name params are updated. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventNameParamsUpdated { + #[prost(string, tag = "1")] + pub allow_unrestricted_names: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub max_name_levels: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub min_segment_length: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub max_segment_length: ::prost::alloc::string::String, +} /// MsgBindNameRequest defines an sdk.Msg type that is used to add an address/name binding under an optional parent name. /// The record may optionally be restricted to prevent additional names from being added under this one without the /// owner signing the request. @@ -83,10 +115,11 @@ pub struct MsgBindNameRequest { } /// MsgBindNameResponse defines the Msg/BindName response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgBindNameResponse {} /// MsgDeleteNameRequest defines an sdk.Msg type that is used to remove an existing address/name binding. The binding -/// may not have any child names currently bound for this request to be successful. +/// may not have any child names currently bound for this request to be successful. All associated attributes on account +/// addresses will be deleted. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDeleteNameRequest { @@ -96,8 +129,55 @@ pub struct MsgDeleteNameRequest { } /// MsgDeleteNameResponse defines the Msg/DeleteName response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgDeleteNameResponse {} +/// MsgCreateRootNameRequest defines an sdk.Msg type to create a new root name +/// that is controlled by a given owner and optionally restricted to the owner +/// for the sole creation of sub names. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateRootNameRequest { + /// The signing authority for the request + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// NameRecord is a structure used to bind ownership of a name hierarchy to a collection of addresses + #[prost(message, optional, tag = "2")] + pub record: ::core::option::Option, +} +/// MsgCreateRootNameResponse defines Msg/CreateRootName response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgCreateRootNameResponse {} +/// MsgModifyNameRequest defines a governance method that is used to update an existing address/name binding. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgModifyNameRequest { + /// The address signing the message + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// The record being updated + #[prost(message, optional, tag = "2")] + pub record: ::core::option::Option, +} +/// MsgModifyNameResponse defines the Msg/ModifyName response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgModifyNameResponse {} +/// MsgUpdateParamsRequest is a request message for the UpdateParams endpoint. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsRequest { + /// authority should be the governance module account address. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params are the new param values to set. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse is a response message for the UpdateParams endpoint. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] @@ -116,7 +196,7 @@ pub mod msg_client { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where - D: std::convert::TryInto, + D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; @@ -168,11 +248,28 @@ pub mod msg_client { self.inner = self.inner.accept_compressed(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } /// BindName binds a name to an address under a root name. pub async fn bind_name( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -181,13 +278,17 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.name.v1.Msg/BindName"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.name.v1.Msg", "BindName")); + self.inner.unary(req, path, codec).await } /// DeleteName defines a method to verify a particular invariance. pub async fn delete_name( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -196,7 +297,68 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.name.v1.Msg/DeleteName"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.name.v1.Msg", "DeleteName")); + self.inner.unary(req, path, codec).await + } + /// ModifyName defines a method to modify the attributes of an existing name. + pub async fn modify_name( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/provenance.name.v1.Msg/ModifyName"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.name.v1.Msg", "ModifyName")); + self.inner.unary(req, path, codec).await + } + /// CreateRootName defines a governance method for creating a root name. + pub async fn create_root_name( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/provenance.name.v1.Msg/CreateRootName"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.name.v1.Msg", "CreateRootName")); + self.inner.unary(req, path, codec).await + } + /// UpdateParams is a governance proposal endpoint for updating the name module's params. + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/provenance.name.v1.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.name.v1.Msg", "UpdateParams")); + self.inner.unary(req, path, codec).await } } } @@ -213,31 +375,48 @@ pub mod msg_server { async fn bind_name( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// DeleteName defines a method to verify a particular invariance. async fn delete_name( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; + /// ModifyName defines a method to modify the attributes of an existing name. + async fn modify_name( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// CreateRootName defines a governance method for creating a root name. + async fn create_root_name( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// UpdateParams is a governance proposal endpoint for updating the name module's params. + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } /// Msg defines the bank Msg service. #[derive(Debug)] pub struct MsgServer { - inner: _Inner, + inner: Arc, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, } - struct _Inner(Arc); impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService @@ -258,6 +437,22 @@ pub mod msg_server { self.send_compression_encodings.enable(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } } impl tonic::codegen::Service> for MsgServer where @@ -268,11 +463,13 @@ pub mod msg_server { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); match req.uri().path() { "/provenance.name.v1.Msg/BindName" => { #[allow(non_camel_case_types)] @@ -284,22 +481,28 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).bind_name(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::bind_name(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = BindNameSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -315,22 +518,141 @@ pub mod msg_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).delete_name(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::delete_name(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = DeleteNameSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.name.v1.Msg/ModifyName" => { + #[allow(non_camel_case_types)] + struct ModifyNameSvc(pub Arc); + impl tonic::server::UnaryService for ModifyNameSvc { + type Response = super::MsgModifyNameResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::modify_name(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = ModifyNameSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.name.v1.Msg/CreateRootName" => { + #[allow(non_camel_case_types)] + struct CreateRootNameSvc(pub Arc); + impl tonic::server::UnaryService for CreateRootNameSvc { + type Response = super::MsgCreateRootNameResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::create_root_name(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = CreateRootNameSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.name.v1.Msg/UpdateParams" => { + #[allow(non_camel_case_types)] + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::update_params(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = UpdateParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -339,8 +661,11 @@ pub mod msg_server { _ => Box::pin(async move { Ok(http::Response::builder() .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") + .header("grpc-status", tonic::Code::Unimplemented as i32) + .header( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ) .body(empty_body()) .unwrap()) }), @@ -354,30 +679,22 @@ pub mod msg_server { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, } } } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(self.0.clone()) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } impl tonic::server::NamedService for MsgServer { const NAME: &'static str = "provenance.name.v1.Msg"; } } /// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} /// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { /// params defines the parameters of the module. #[prost(message, optional, tag = "1")] @@ -444,7 +761,7 @@ pub mod query_client { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where - D: std::convert::TryInto, + D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; @@ -499,11 +816,28 @@ pub mod query_client { self.inner = self.inner.accept_compressed(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } /// Params queries params of the name module. pub async fn params( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -512,13 +846,17 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.name.v1.Query/Params"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.name.v1.Query", "Params")); + self.inner.unary(req, path, codec).await } /// Resolve queries for the address associated with a given name pub async fn resolve( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -527,13 +865,17 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.name.v1.Query/Resolve"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.name.v1.Query", "Resolve")); + self.inner.unary(req, path, codec).await } /// ReverseLookup queries for all names bound against a given address pub async fn reverse_lookup( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, @@ -543,7 +885,10 @@ pub mod query_client { let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/provenance.name.v1.Query/ReverseLookup"); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.name.v1.Query", "ReverseLookup")); + self.inner.unary(req, path, codec).await } } } @@ -560,36 +905,38 @@ pub mod query_server { async fn params( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// Resolve queries for the address associated with a given name async fn resolve( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// ReverseLookup queries for all names bound against a given address async fn reverse_lookup( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; } /// Query defines the gRPC querier service for distribution module. #[derive(Debug)] pub struct QueryServer { - inner: _Inner, + inner: Arc, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, } - struct _Inner(Arc); impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService @@ -610,6 +957,22 @@ pub mod query_server { self.send_compression_encodings.enable(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } } impl tonic::codegen::Service> for QueryServer where @@ -620,11 +983,13 @@ pub mod query_server { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); match req.uri().path() { "/provenance.name.v1.Query/Params" => { #[allow(non_camel_case_types)] @@ -636,22 +1001,28 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).params(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::params(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -667,22 +1038,28 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).resolve(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { ::resolve(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = ResolveSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -700,22 +1077,29 @@ pub mod query_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).reverse_lookup(request).await }; + let inner = Arc::clone(&self.0); + let fut = + async move { ::reverse_lookup(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = ReverseLookupSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -724,8 +1108,11 @@ pub mod query_server { _ => Box::pin(async move { Ok(http::Response::builder() .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") + .header("grpc-status", tonic::Code::Unimplemented as i32) + .header( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ) .body(empty_body()) .unwrap()) }), @@ -739,19 +1126,11 @@ pub mod query_server { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, } } } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(self.0.clone()) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } impl tonic::server::NamedService for QueryServer { const NAME: &'static str = "provenance.name.v1.Query"; } diff --git a/provenance-sdk-proto/src/prost/provenance-sdk/provenance.reward.v1.rs b/provenance-sdk-proto/src/prost/provenance-sdk/provenance.reward.v1.rs deleted file mode 100644 index 6d57afd..0000000 --- a/provenance-sdk-proto/src/prost/provenance-sdk/provenance.reward.v1.rs +++ /dev/null @@ -1,1463 +0,0 @@ -/// RewardProgram -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RewardProgram { - /// An integer to uniquely identify the reward program. - #[prost(uint64, tag = "1")] - pub id: u64, - /// Name to help identify the Reward Program.(MaxTitleLength=140) - #[prost(string, tag = "2")] - pub title: ::prost::alloc::string::String, - /// Short summary describing the Reward Program.(MaxDescriptionLength=10000) - #[prost(string, tag = "3")] - pub description: ::prost::alloc::string::String, - /// address that provides funds for the total reward pool. - #[prost(string, tag = "4")] - pub distribute_from_address: ::prost::alloc::string::String, - /// The total amount of funding given to the RewardProgram. - #[prost(message, optional, tag = "5")] - pub total_reward_pool: ::core::option::Option, - /// The remaining funds available to distribute after n claim periods have passed. - #[prost(message, optional, tag = "6")] - pub remaining_pool_balance: - ::core::option::Option, - /// The total amount of all funds claimed by participants for all past claim periods. - #[prost(message, optional, tag = "7")] - pub claimed_amount: ::core::option::Option, - /// Maximum reward per claim period per address. - #[prost(message, optional, tag = "8")] - pub max_reward_by_address: - ::core::option::Option, - /// Minimum amount of coins for a program to rollover. - #[prost(message, optional, tag = "9")] - pub minimum_rollover_amount: - ::core::option::Option, - /// Number of seconds that a claim period lasts. - #[prost(uint64, tag = "10")] - pub claim_period_seconds: u64, - /// Time that a RewardProgram should start and switch to STARTED state. - #[prost(message, optional, tag = "11")] - pub program_start_time: ::core::option::Option<::prost_types::Timestamp>, - /// Time that a RewardProgram is expected to end, based on data when it was setup. - #[prost(message, optional, tag = "12")] - pub expected_program_end_time: ::core::option::Option<::prost_types::Timestamp>, - /// Time that a RewardProgram MUST end. - #[prost(message, optional, tag = "13")] - pub program_end_time_max: ::core::option::Option<::prost_types::Timestamp>, - /// Used internally to calculate and track the current claim period's ending time. - #[prost(message, optional, tag = "14")] - pub claim_period_end_time: ::core::option::Option<::prost_types::Timestamp>, - /// Time the RewardProgram switched to FINISHED state. Initially set as empty. - #[prost(message, optional, tag = "15")] - pub actual_program_end_time: ::core::option::Option<::prost_types::Timestamp>, - /// Number of claim periods this program will run for. - #[prost(uint64, tag = "16")] - pub claim_periods: u64, - /// Current claim period of the RewardProgram. Uses 1-based indexing. - #[prost(uint64, tag = "17")] - pub current_claim_period: u64, - /// maximum number of claim periods a reward program can rollover. - #[prost(uint64, tag = "18")] - pub max_rollover_claim_periods: u64, - /// Current state of the RewardProgram. - #[prost(enumeration = "reward_program::State", tag = "19")] - pub state: i32, - /// Grace period after a RewardProgram FINISHED. It is the number of seconds until a RewardProgram enters the EXPIRED - /// state. - #[prost(uint64, tag = "20")] - pub expiration_offset: u64, - /// Actions that count towards the reward. - #[prost(message, repeated, tag = "21")] - pub qualifying_actions: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `RewardProgram`. -pub mod reward_program { - /// State is the state of the reward program - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum State { - /// undefined program state - Unspecified = 0, - /// pending state of reward program - Pending = 1, - /// started state of reward program - Started = 2, - /// finished state of reward program - Finished = 3, - /// expired state of reward program - Expired = 4, - } - impl State { - /// 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 { - State::Unspecified => "STATE_UNSPECIFIED", - State::Pending => "STATE_PENDING", - State::Started => "STATE_STARTED", - State::Finished => "STATE_FINISHED", - State::Expired => "STATE_EXPIRED", - } - } - } -} -/// ClaimPeriodRewardDistribution, this is updated at the end of every claim period. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClaimPeriodRewardDistribution { - /// The claim period id. - #[prost(uint64, tag = "1")] - pub claim_period_id: u64, - /// The id of the reward program that this reward belongs to. - #[prost(uint64, tag = "2")] - pub reward_program_id: u64, - /// The sum of all the granted rewards for this claim period. - #[prost(message, optional, tag = "3")] - pub total_rewards_pool_for_claim_period: - ::core::option::Option, - /// The final allocated rewards for this claim period. - #[prost(message, optional, tag = "4")] - pub rewards_pool: ::core::option::Option, - /// The total number of granted shares for this claim period. - #[prost(int64, tag = "5")] - pub total_shares: i64, - /// A flag representing if the claim period for this reward has ended. - #[prost(bool, tag = "6")] - pub claim_period_ended: bool, -} -/// RewardAccountState contains state at the claim period level for a specific address. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RewardAccountState { - /// The id of the reward program that this share belongs to. - #[prost(uint64, tag = "1")] - pub reward_program_id: u64, - /// The id of the claim period that the share belongs to. - #[prost(uint64, tag = "2")] - pub claim_period_id: u64, - /// Owner of the reward account state. - #[prost(string, tag = "3")] - pub address: ::prost::alloc::string::String, - /// The number of actions performed by this account, mapped by action type. - #[prost(message, repeated, tag = "4")] - pub action_counter: ::prost::alloc::vec::Vec, - /// The amount of granted shares for the address in the reward program's claim period. - #[prost(uint64, tag = "5")] - pub shares_earned: u64, - /// The status of the claim. - #[prost(enumeration = "reward_account_state::ClaimStatus", tag = "6")] - pub claim_status: i32, -} -/// Nested message and enum types in `RewardAccountState`. -pub mod reward_account_state { - /// ClaimStatus is the state a claim is in - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum ClaimStatus { - /// undefined state - Unspecified = 0, - /// unclaimable status - Unclaimable = 1, - /// unclaimable claimable - Claimable = 2, - /// unclaimable claimed - Claimed = 3, - /// unclaimable expired - Expired = 4, - } - impl ClaimStatus { - /// 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 { - ClaimStatus::Unspecified => "CLAIM_STATUS_UNSPECIFIED", - ClaimStatus::Unclaimable => "CLAIM_STATUS_UNCLAIMABLE", - ClaimStatus::Claimable => "CLAIM_STATUS_CLAIMABLE", - ClaimStatus::Claimed => "CLAIM_STATUS_CLAIMED", - ClaimStatus::Expired => "CLAIM_STATUS_EXPIRED", - } - } - } -} -/// QualifyingAction can be one of many action types. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QualifyingAction { - /// type of action to process - #[prost(oneof = "qualifying_action::Type", tags = "1, 2, 3")] - pub r#type: ::core::option::Option, -} -/// Nested message and enum types in `QualifyingAction`. -pub mod qualifying_action { - /// type of action to process - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Type { - #[prost(message, tag = "1")] - Delegate(super::ActionDelegate), - #[prost(message, tag = "2")] - Transfer(super::ActionTransfer), - #[prost(message, tag = "3")] - Vote(super::ActionVote), - } -} -/// QualifyingActions contains a list of QualifyingActions. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QualifyingActions { - /// The actions that count towards the reward. - #[prost(message, repeated, tag = "1")] - pub qualifying_actions: ::prost::alloc::vec::Vec, -} -/// ActionDelegate represents the delegate action and its required eligibility criteria. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ActionDelegate { - /// Minimum number of successful delegates. - #[prost(uint64, tag = "1")] - pub minimum_actions: u64, - /// Maximum number of successful delegates. - #[prost(uint64, tag = "2")] - pub maximum_actions: u64, - /// Minimum amount that the user must have currently delegated on the validator. - #[prost(message, optional, tag = "3")] - pub minimum_delegation_amount: - ::core::option::Option, - /// Maximum amount that the user must have currently delegated on the validator. - #[prost(message, optional, tag = "4")] - pub maximum_delegation_amount: - ::core::option::Option, - /// Minimum percentile that can be below the validator's power ranking. - #[prost(string, tag = "5")] - pub minimum_active_stake_percentile: ::prost::alloc::string::String, - /// Maximum percentile that can be below the validator's power ranking. - #[prost(string, tag = "6")] - pub maximum_active_stake_percentile: ::prost::alloc::string::String, -} -/// ActionTransfer represents the transfer action and its required eligibility criteria. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ActionTransfer { - /// Minimum number of successful transfers. - #[prost(uint64, tag = "1")] - pub minimum_actions: u64, - /// Maximum number of successful transfers. - #[prost(uint64, tag = "2")] - pub maximum_actions: u64, - /// Minimum delegation amount the account must have across all validators, for the transfer action to be counted. - #[prost(message, optional, tag = "3")] - pub minimum_delegation_amount: - ::core::option::Option, -} -/// ActionVote represents the voting action and its required eligibility criteria. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ActionVote { - /// Minimum number of successful votes. - #[prost(uint64, tag = "1")] - pub minimum_actions: u64, - /// Maximum number of successful votes. - #[prost(uint64, tag = "2")] - pub maximum_actions: u64, - /// Minimum delegation amount the account must have across all validators, for the vote action to be counted. - #[prost(message, optional, tag = "3")] - pub minimum_delegation_amount: - ::core::option::Option, - /// Positive multiplier that is applied to the shares awarded by the vote action when conditions - /// are met(for now the only condition is the current vote is a validator vote). A value of zero will behave the same as one - #[prost(uint64, tag = "4")] - pub validator_multiplier: u64, -} -/// ActionCounter is a key-value pair that maps action type to the number of times it was performed. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ActionCounter { - /// The type of action performed. - #[prost(string, tag = "1")] - pub action_type: ::prost::alloc::string::String, - /// The number of times this action has been performed - #[prost(uint64, tag = "2")] - pub number_of_actions: u64, -} -/// MsgCreateRewardProgramRequest is the request type for creating a reward program RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCreateRewardProgramRequest { - /// title for the reward program. - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// description for the reward program. - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// provider address for the reward program funds and signer of message. - #[prost(string, tag = "3")] - pub distribute_from_address: ::prost::alloc::string::String, - /// total reward pool for the reward program. - #[prost(message, optional, tag = "4")] - pub total_reward_pool: ::core::option::Option, - /// maximum amount of funds an address can be rewarded per claim period. - #[prost(message, optional, tag = "5")] - pub max_reward_per_claim_address: - ::core::option::Option, - /// start time of the reward program. - #[prost(message, optional, tag = "6")] - pub program_start_time: ::core::option::Option<::prost_types::Timestamp>, - /// number of claim periods the reward program runs for. - #[prost(uint64, tag = "7")] - pub claim_periods: u64, - /// number of days a claim period will exist. - #[prost(uint64, tag = "8")] - pub claim_period_days: u64, - /// maximum number of claim periods a reward program can rollover. - #[prost(uint64, tag = "9")] - pub max_rollover_claim_periods: u64, - /// number of days before a reward program will expire after it has ended. - #[prost(uint64, tag = "10")] - pub expire_days: u64, - /// actions that count towards the reward. - #[prost(message, repeated, tag = "11")] - pub qualifying_actions: ::prost::alloc::vec::Vec, -} -/// MsgCreateRewardProgramResponse is the response type for creating a reward program RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCreateRewardProgramResponse { - /// reward program id that is generated on creation. - #[prost(uint64, tag = "1")] - pub id: u64, -} -/// MsgEndRewardProgramRequest is the request type for ending a reward program RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgEndRewardProgramRequest { - /// reward program id to end. - #[prost(uint64, tag = "1")] - pub reward_program_id: u64, - /// owner of the reward program that funds were distributed from. - #[prost(string, tag = "2")] - pub program_owner_address: ::prost::alloc::string::String, -} -/// MsgEndRewardProgramResponse is the response type for ending a reward program RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgEndRewardProgramResponse {} -/// MsgClaimRewardsRequest is the request type for claiming reward from reward program RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgClaimRewardsRequest { - /// reward program id to claim rewards. - #[prost(uint64, tag = "1")] - pub reward_program_id: u64, - /// reward address and signer of msg to send claimed rewards to. - #[prost(string, tag = "2")] - pub reward_address: ::prost::alloc::string::String, -} -/// MsgClaimRewardsResponse is the response type for claiming reward from reward program RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgClaimRewardsResponse { - /// details about acquired rewards from reward program. - #[prost(message, optional, tag = "1")] - pub claim_details: ::core::option::Option, -} -/// MsgClaimRewardsResponse is the request type for claiming rewards from all reward programs RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgClaimAllRewardsRequest { - /// reward address and signer of msg to send claimed rewards to. - #[prost(string, tag = "1")] - pub reward_address: ::prost::alloc::string::String, -} -/// MsgClaimRewardsResponse is the response type for claiming rewards from all reward programs RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgClaimAllRewardsResponse { - /// total rewards claimed for all eligible claim periods in all programs. - #[prost(message, repeated, tag = "1")] - pub total_reward_claim: ::prost::alloc::vec::Vec, - /// details about acquired rewards from a reward program. - #[prost(message, repeated, tag = "2")] - pub claim_details: ::prost::alloc::vec::Vec, -} -/// ClaimedRewardPeriodDetail is information regarding an addresses' shares and reward for a claim period. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClaimedRewardPeriodDetail { - /// claim period id - #[prost(uint64, tag = "1")] - pub claim_period_id: u64, - /// total shares accumulated for claim period - #[prost(uint64, tag = "2")] - pub total_shares: u64, - /// total rewards for claim period - #[prost(message, optional, tag = "3")] - pub claim_period_reward: ::core::option::Option, -} -/// RewardProgramClaimDetail is the response object regarding an address's shares and reward for a reward program. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RewardProgramClaimDetail { - /// reward program id. - #[prost(uint64, tag = "1")] - pub reward_program_id: u64, - /// total rewards claimed for all eligible claim periods in program. - #[prost(message, optional, tag = "2")] - pub total_reward_claim: ::core::option::Option, - /// claim period details. - #[prost(message, repeated, tag = "3")] - pub claimed_reward_period_details: ::prost::alloc::vec::Vec, -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - /// Msg - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: std::convert::TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// CreateRewardProgram is the RPC endpoint for creating a rewards program - pub async fn create_reward_program( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/provenance.reward.v1.Msg/CreateRewardProgram", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// EndRewardProgram is the RPC endpoint for ending a rewards program - pub async fn end_reward_program( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/provenance.reward.v1.Msg/EndRewardProgram"); - self.inner.unary(request.into_request(), path, codec).await - } - /// ClaimRewards is the RPC endpoint for claiming rewards belonging to completed claim periods of a reward program - pub async fn claim_rewards( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/provenance.reward.v1.Msg/ClaimRewards"); - self.inner.unary(request.into_request(), path, codec).await - } - /// ClaimAllRewards is the RPC endpoint for claiming rewards for completed claim periods of every reward program for - /// the signer of the tx. - pub async fn claim_all_rewards( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/provenance.reward.v1.Msg/ClaimAllRewards"); - self.inner.unary(request.into_request(), path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "grpc")] -#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod msg_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. - #[async_trait] - pub trait Msg: Send + Sync + 'static { - /// CreateRewardProgram is the RPC endpoint for creating a rewards program - async fn create_reward_program( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// EndRewardProgram is the RPC endpoint for ending a rewards program - async fn end_reward_program( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// ClaimRewards is the RPC endpoint for claiming rewards belonging to completed claim periods of a reward program - async fn claim_rewards( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// ClaimAllRewards is the RPC endpoint for claiming rewards for completed claim periods of every reward program for - /// the signer of the tx. - async fn claim_all_rewards( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - } - /// Msg - #[derive(Debug)] - pub struct MsgServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - } - struct _Inner(Arc); - impl MsgServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - } - } - pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - } - impl tonic::codegen::Service> for MsgServer - where - T: Msg, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/provenance.reward.v1.Msg/CreateRewardProgram" => { - #[allow(non_camel_case_types)] - struct CreateRewardProgramSvc(pub Arc); - impl tonic::server::UnaryService - for CreateRewardProgramSvc - { - type Response = super::MsgCreateRewardProgramResponse; - type Future = BoxFuture, tonic::Status>; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).create_reward_program(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = CreateRewardProgramSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/provenance.reward.v1.Msg/EndRewardProgram" => { - #[allow(non_camel_case_types)] - struct EndRewardProgramSvc(pub Arc); - impl tonic::server::UnaryService - for EndRewardProgramSvc - { - type Response = super::MsgEndRewardProgramResponse; - type Future = BoxFuture, tonic::Status>; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).end_reward_program(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = EndRewardProgramSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/provenance.reward.v1.Msg/ClaimRewards" => { - #[allow(non_camel_case_types)] - struct ClaimRewardsSvc(pub Arc); - impl tonic::server::UnaryService for ClaimRewardsSvc { - type Response = super::MsgClaimRewardsResponse; - type Future = BoxFuture, tonic::Status>; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).claim_rewards(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = ClaimRewardsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/provenance.reward.v1.Msg/ClaimAllRewards" => { - #[allow(non_camel_case_types)] - struct ClaimAllRewardsSvc(pub Arc); - impl tonic::server::UnaryService - for ClaimAllRewardsSvc - { - type Response = super::MsgClaimAllRewardsResponse; - type Future = BoxFuture, tonic::Status>; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).claim_all_rewards(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = ClaimAllRewardsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => Box::pin(async move { - Ok(http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap()) - }), - } - } - } - impl Clone for MsgServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(self.0.clone()) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = "provenance.reward.v1.Msg"; - } -} -/// QueryRewardProgramByIDRequest queries for the Reward Program with an identifier of id -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryRewardProgramByIdRequest { - /// The id of the reward program to query. - #[prost(uint64, tag = "1")] - pub id: u64, -} -/// QueryRewardProgramByIDResponse contains the requested RewardProgram -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryRewardProgramByIdResponse { - /// The reward program object that was queried for. - #[prost(message, optional, tag = "1")] - pub reward_program: ::core::option::Option, -} -/// QueryRewardProgramsRequest queries for all reward programs matching the query_type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryRewardProgramsRequest { - /// A filter on the types of reward programs. - #[prost(enumeration = "query_reward_programs_request::QueryType", tag = "1")] - pub query_type: i32, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "99")] - pub pagination: - ::core::option::Option, -} -/// Nested message and enum types in `QueryRewardProgramsRequest`. -pub mod query_reward_programs_request { - /// QueryType is the state of reward program to query - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum QueryType { - /// unspecified type - Unspecified = 0, - /// all reward programs states - All = 1, - /// pending reward program state= - Pending = 2, - /// active reward program state - Active = 3, - /// pending and active reward program states - Outstanding = 4, - /// finished reward program state - Finished = 5, - } - impl QueryType { - /// 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 { - QueryType::Unspecified => "QUERY_TYPE_UNSPECIFIED", - QueryType::All => "QUERY_TYPE_ALL", - QueryType::Pending => "QUERY_TYPE_PENDING", - QueryType::Active => "QUERY_TYPE_ACTIVE", - QueryType::Outstanding => "QUERY_TYPE_OUTSTANDING", - QueryType::Finished => "QUERY_TYPE_FINISHED", - } - } - } -} -/// QueryRewardProgramsResponse contains the list of RewardPrograms matching the query -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryRewardProgramsResponse { - /// List of RewardProgram objects matching the query_type. - #[prost(message, repeated, tag = "1")] - pub reward_programs: ::prost::alloc::vec::Vec, - /// pagination defines an optional pagination for the response. - #[prost(message, optional, tag = "99")] - pub pagination: - ::core::option::Option, -} -/// QueryClaimPeriodRewardDistributionsRequest queries for all the ClaimPeriodRewardDistributions with pagination. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClaimPeriodRewardDistributionsRequest { - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "99")] - pub pagination: - ::core::option::Option, -} -/// QueryClaimPeriodRewardDistributionsResponse returns the list of paginated ClaimPeriodRewardDistributions -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClaimPeriodRewardDistributionsResponse { - /// List of all ClaimPeriodRewardDistribution objects queried for. - #[prost(message, repeated, tag = "1")] - pub claim_period_reward_distributions: ::prost::alloc::vec::Vec, - /// pagination defines an optional pagination for the response. - #[prost(message, optional, tag = "99")] - pub pagination: - ::core::option::Option, -} -/// QueryClaimPeriodRewardDistributionsByIDRequest queries for a single ClaimPeriodRewardDistribution -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClaimPeriodRewardDistributionsByIdRequest { - /// The reward program that the claim period reward distribution belongs to. - #[prost(uint64, tag = "1")] - pub reward_id: u64, - /// The claim period that the claim period reward distribution was created for. - #[prost(uint64, tag = "2")] - pub claim_period_id: u64, -} -/// QueryClaimPeriodRewardDistributionsByIDResponse returns the requested ClaimPeriodRewardDistribution -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClaimPeriodRewardDistributionsByIdResponse { - /// The ClaimPeriodRewardDistribution object that was queried for. - #[prost(message, optional, tag = "1")] - pub claim_period_reward_distribution: ::core::option::Option, -} -/// QueryRewardDistributionsByAddressRequest queries for reward claims by address that match the claim_status. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryRewardDistributionsByAddressRequest { - /// The address that the claim belongs to. - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// The status that the reward account must have. - #[prost(enumeration = "reward_account_state::ClaimStatus", tag = "2")] - pub claim_status: i32, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "99")] - pub pagination: - ::core::option::Option, -} -/// QueryRewardDistributionsByAddressResponse returns the reward claims for an address that match the claim_status. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryRewardDistributionsByAddressResponse { - /// The address that the reward account belongs to. - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// List of RewardAccounts queried for. - #[prost(message, repeated, tag = "2")] - pub reward_account_state: ::prost::alloc::vec::Vec, - /// pagination defines an optional pagination for the response. - #[prost(message, optional, tag = "99")] - pub pagination: - ::core::option::Option, -} -/// RewardAccountResponse is an address' reward claim for a reward program's claim period. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RewardAccountResponse { - /// The id of the reward program that this claim belongs to. - #[prost(uint64, tag = "1")] - pub reward_program_id: u64, - /// total rewards claimed for all eligible claim periods in program. - #[prost(message, optional, tag = "2")] - pub total_reward_claim: ::core::option::Option, - /// The status of the claim. - #[prost(enumeration = "reward_account_state::ClaimStatus", tag = "3")] - pub claim_status: i32, - /// The claim period that the claim belongs to. - #[prost(uint64, tag = "4")] - pub claim_id: u64, -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - /// Query defines the gRPC querier service for reward module. - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: std::convert::TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - QueryClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// RewardProgramByID returns a reward program matching the ID. - pub async fn reward_program_by_id( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/provenance.reward.v1.Query/RewardProgramByID", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// RewardPrograms returns a list of reward programs matching the query type. - pub async fn reward_programs( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/provenance.reward.v1.Query/RewardPrograms"); - self.inner.unary(request.into_request(), path, codec).await - } - /// ClaimPeriodRewardDistributions returns a list of claim period reward distributions matching the claim_status. - pub async fn claim_period_reward_distributions( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/provenance.reward.v1.Query/ClaimPeriodRewardDistributions", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// ClaimPeriodRewardDistributionsByID returns a claim period reward distribution matching the ID. - pub async fn claim_period_reward_distributions_by_id( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/provenance.reward.v1.Query/ClaimPeriodRewardDistributionsByID", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// RewardDistributionsByAddress returns a list of reward claims belonging to the account and matching the claim - /// status. - pub async fn reward_distributions_by_address( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/provenance.reward.v1.Query/RewardDistributionsByAddress", - ); - self.inner.unary(request.into_request(), path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "grpc")] -#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod query_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. - #[async_trait] - pub trait Query: Send + Sync + 'static { - /// RewardProgramByID returns a reward program matching the ID. - async fn reward_program_by_id( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// RewardPrograms returns a list of reward programs matching the query type. - async fn reward_programs( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// ClaimPeriodRewardDistributions returns a list of claim period reward distributions matching the claim_status. - async fn claim_period_reward_distributions( - &self, - request: tonic::Request, - ) -> Result< - tonic::Response, - tonic::Status, - >; - /// ClaimPeriodRewardDistributionsByID returns a claim period reward distribution matching the ID. - async fn claim_period_reward_distributions_by_id( - &self, - request: tonic::Request, - ) -> Result< - tonic::Response, - tonic::Status, - >; - /// RewardDistributionsByAddress returns a list of reward claims belonging to the account and matching the claim - /// status. - async fn reward_distributions_by_address( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - } - /// Query defines the gRPC querier service for reward module. - #[derive(Debug)] - pub struct QueryServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - } - struct _Inner(Arc); - impl QueryServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - } - } - pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - } - impl tonic::codegen::Service> for QueryServer - where - T: Query, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/provenance.reward.v1.Query/RewardProgramByID" => { - #[allow(non_camel_case_types)] - struct RewardProgramByIDSvc(pub Arc); - impl tonic::server::UnaryService - for RewardProgramByIDSvc - { - type Response = super::QueryRewardProgramByIdResponse; - type Future = BoxFuture, tonic::Status>; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).reward_program_by_id(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = RewardProgramByIDSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/provenance.reward.v1.Query/RewardPrograms" => { - #[allow(non_camel_case_types)] - struct RewardProgramsSvc(pub Arc); - impl tonic::server::UnaryService - for RewardProgramsSvc - { - type Response = super::QueryRewardProgramsResponse; - type Future = BoxFuture, tonic::Status>; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).reward_programs(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = RewardProgramsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/provenance.reward.v1.Query/ClaimPeriodRewardDistributions" => { - #[allow(non_camel_case_types)] - struct ClaimPeriodRewardDistributionsSvc(pub Arc); - impl - tonic::server::UnaryService< - super::QueryClaimPeriodRewardDistributionsRequest, - > for ClaimPeriodRewardDistributionsSvc - { - type Response = super::QueryClaimPeriodRewardDistributionsResponse; - type Future = BoxFuture, tonic::Status>; - fn call( - &mut self, - request: tonic::Request< - super::QueryClaimPeriodRewardDistributionsRequest, - >, - ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { - (*inner).claim_period_reward_distributions(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = ClaimPeriodRewardDistributionsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/provenance.reward.v1.Query/ClaimPeriodRewardDistributionsByID" => { - #[allow(non_camel_case_types)] - struct ClaimPeriodRewardDistributionsByIDSvc(pub Arc); - impl - tonic::server::UnaryService< - super::QueryClaimPeriodRewardDistributionsByIdRequest, - > for ClaimPeriodRewardDistributionsByIDSvc - { - type Response = super::QueryClaimPeriodRewardDistributionsByIdResponse; - type Future = BoxFuture, tonic::Status>; - fn call( - &mut self, - request: tonic::Request< - super::QueryClaimPeriodRewardDistributionsByIdRequest, - >, - ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { - (*inner) - .claim_period_reward_distributions_by_id(request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = ClaimPeriodRewardDistributionsByIDSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/provenance.reward.v1.Query/RewardDistributionsByAddress" => { - #[allow(non_camel_case_types)] - struct RewardDistributionsByAddressSvc(pub Arc); - impl - tonic::server::UnaryService - for RewardDistributionsByAddressSvc - { - type Response = super::QueryRewardDistributionsByAddressResponse; - type Future = BoxFuture, tonic::Status>; - fn call( - &mut self, - request: tonic::Request< - super::QueryRewardDistributionsByAddressRequest, - >, - ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { - (*inner).reward_distributions_by_address(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = RewardDistributionsByAddressSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => Box::pin(async move { - Ok(http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap()) - }), - } - } - } - impl Clone for QueryServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(self.0.clone()) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = "provenance.reward.v1.Query"; - } -} -/// GenesisState defines the reward module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - /// Reward program id is the next auto incremented id to be assigned to the next created reward program - #[prost(uint64, tag = "1")] - pub reward_program_id: u64, - /// Reward programs to initially start with. - #[prost(message, repeated, tag = "2")] - pub reward_programs: ::prost::alloc::vec::Vec, - /// Claim period reward distributions to initially start with. - #[prost(message, repeated, tag = "3")] - pub claim_period_reward_distributions: ::prost::alloc::vec::Vec, - /// Reward account states to initially start with. - #[prost(message, repeated, tag = "4")] - pub reward_account_states: ::prost::alloc::vec::Vec, -}