#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthenticatedRequest {
#[prost(oneof = "authenticated_request::Payload", tags = "1, 2")]
pub payload: ::core::option::Option<authenticated_request::Payload>,
}
pub mod authenticated_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "1")]
DisperseRequest(super::DisperseBlobRequest),
#[prost(message, tag = "2")]
AuthenticationData(super::AuthenticationData),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthenticatedReply {
#[prost(oneof = "authenticated_reply::Payload", tags = "1, 2")]
pub payload: ::core::option::Option<authenticated_reply::Payload>,
}
pub mod authenticated_reply {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "1")]
BlobAuthHeader(super::BlobAuthHeader),
#[prost(message, tag = "2")]
DisperseReply(super::DisperseBlobReply),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlobAuthHeader {
#[prost(uint32, tag = "1")]
pub challenge_parameter: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthenticationData {
#[prost(bytes = "vec", tag = "1")]
pub authentication_data: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DisperseBlobRequest {
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
#[prost(uint32, repeated, tag = "2")]
pub custom_quorum_numbers: ::prost::alloc::vec::Vec<u32>,
#[prost(string, tag = "3")]
pub account_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DisperseBlobReply {
#[prost(enumeration = "BlobStatus", tag = "1")]
pub result: i32,
#[prost(bytes = "vec", tag = "2")]
pub request_id: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlobStatusRequest {
#[prost(bytes = "vec", tag = "1")]
pub request_id: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlobStatusReply {
#[prost(enumeration = "BlobStatus", tag = "1")]
pub status: i32,
#[prost(message, optional, tag = "2")]
pub info: ::core::option::Option<BlobInfo>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RetrieveBlobRequest {
#[prost(bytes = "vec", tag = "1")]
pub batch_header_hash: ::prost::alloc::vec::Vec<u8>,
#[prost(uint32, tag = "2")]
pub blob_index: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RetrieveBlobReply {
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlobInfo {
#[prost(message, optional, tag = "1")]
pub blob_header: ::core::option::Option<BlobHeader>,
#[prost(message, optional, tag = "2")]
pub blob_verification_proof: ::core::option::Option<BlobVerificationProof>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlobHeader {
#[prost(message, optional, tag = "1")]
pub commitment: ::core::option::Option<super::common::G1Commitment>,
#[prost(uint32, tag = "2")]
pub data_length: u32,
#[prost(message, repeated, tag = "3")]
pub blob_quorum_params: ::prost::alloc::vec::Vec<BlobQuorumParam>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlobQuorumParam {
#[prost(uint32, tag = "1")]
pub quorum_number: u32,
#[prost(uint32, tag = "2")]
pub adversary_threshold_percentage: u32,
#[prost(uint32, tag = "3")]
pub confirmation_threshold_percentage: u32,
#[prost(uint32, tag = "4")]
pub chunk_length: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlobVerificationProof {
#[prost(uint32, tag = "1")]
pub batch_id: u32,
#[prost(uint32, tag = "2")]
pub blob_index: u32,
#[prost(message, optional, tag = "3")]
pub batch_metadata: ::core::option::Option<BatchMetadata>,
#[prost(bytes = "vec", tag = "4")]
pub inclusion_proof: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "5")]
pub quorum_indexes: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchMetadata {
#[prost(message, optional, tag = "1")]
pub batch_header: ::core::option::Option<BatchHeader>,
#[prost(bytes = "vec", tag = "2")]
pub signatory_record_hash: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "3")]
pub fee: ::prost::alloc::vec::Vec<u8>,
#[prost(uint32, tag = "4")]
pub confirmation_block_number: u32,
#[prost(bytes = "vec", tag = "5")]
pub batch_header_hash: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchHeader {
#[prost(bytes = "vec", tag = "1")]
pub batch_root: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub quorum_numbers: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "3")]
pub quorum_signed_percentages: ::prost::alloc::vec::Vec<u8>,
#[prost(uint32, tag = "4")]
pub reference_block_number: u32,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BlobStatus {
Unknown = 0,
Processing = 1,
Confirmed = 2,
Failed = 3,
Finalized = 4,
InsufficientSignatures = 5,
Dispersing = 6,
}
impl BlobStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
BlobStatus::Unknown => "UNKNOWN",
BlobStatus::Processing => "PROCESSING",
BlobStatus::Confirmed => "CONFIRMED",
BlobStatus::Failed => "FAILED",
BlobStatus::Finalized => "FINALIZED",
BlobStatus::InsufficientSignatures => "INSUFFICIENT_SIGNATURES",
BlobStatus::Dispersing => "DISPERSING",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"PROCESSING" => Some(Self::Processing),
"CONFIRMED" => Some(Self::Confirmed),
"FAILED" => Some(Self::Failed),
"FINALIZED" => Some(Self::Finalized),
"INSUFFICIENT_SIGNATURES" => Some(Self::InsufficientSignatures),
"DISPERSING" => Some(Self::Dispersing),
_ => None,
}
}
}
pub mod disperser_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct DisperserClient<T> {
inner: tonic::client::Grpc<T>,
}
impl DisperserClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> DisperserClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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<F>(
inner: T,
interceptor: F,
) -> DisperserClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
DisperserClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn disperse_blob(
&mut self,
request: impl tonic::IntoRequest<super::DisperseBlobRequest>,
) -> std::result::Result<
tonic::Response<super::DisperseBlobReply>,
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(
"/disperser.Disperser/DisperseBlob",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("disperser.Disperser", "DisperseBlob"));
self.inner.unary(req, path, codec).await
}
pub async fn disperse_blob_authenticated(
&mut self,
request: impl tonic::IntoStreamingRequest<
Message = super::AuthenticatedRequest,
>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::AuthenticatedReply>>,
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(
"/disperser.Disperser/DisperseBlobAuthenticated",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(
GrpcMethod::new("disperser.Disperser", "DisperseBlobAuthenticated"),
);
self.inner.streaming(req, path, codec).await
}
pub async fn get_blob_status(
&mut self,
request: impl tonic::IntoRequest<super::BlobStatusRequest>,
) -> std::result::Result<
tonic::Response<super::BlobStatusReply>,
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(
"/disperser.Disperser/GetBlobStatus",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("disperser.Disperser", "GetBlobStatus"));
self.inner.unary(req, path, codec).await
}
pub async fn retrieve_blob(
&mut self,
request: impl tonic::IntoRequest<super::RetrieveBlobRequest>,
) -> std::result::Result<
tonic::Response<super::RetrieveBlobReply>,
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(
"/disperser.Disperser/RetrieveBlob",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("disperser.Disperser", "RetrieveBlob"));
self.inner.unary(req, path, codec).await
}
}
}