1#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct SerializedBlock {
5 #[prost(message, optional, tag = "1")]
7 pub header: ::core::option::Option<super::common::BlockHeader>,
8 #[prost(message, optional, tag = "2")]
10 pub dag: ::core::option::Option<super::common::Dag>,
11 #[prost(string, repeated, tag = "3")]
13 pub tx_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
14 #[prost(message, optional, tag = "4")]
16 pub additional_data: ::core::option::Option<super::common::AdditionalData>,
17}
18#[allow(clippy::derive_partial_eq_without_eq)]
20#[derive(Clone, PartialEq, ::prost::Message)]
21pub struct BlockWithRwSet {
22 #[prost(message, optional, tag = "1")]
24 pub block: ::core::option::Option<super::common::Block>,
25 #[prost(message, repeated, tag = "2")]
27 pub tx_rw_sets: ::prost::alloc::vec::Vec<super::common::TxRwSet>,
28 #[prost(message, repeated, tag = "3")]
30 pub contract_events: ::prost::alloc::vec::Vec<super::common::ContractEvent>,
31}
32#[allow(clippy::derive_partial_eq_without_eq)]
34#[derive(Clone, PartialEq, ::prost::Message)]
35pub struct TransactionStoreInfo {
36 #[prost(message, optional, tag = "1")]
38 pub transaction: ::core::option::Option<super::common::Transaction>,
39 #[prost(uint64, tag = "2")]
41 pub block_height: u64,
42 #[prost(bytes = "vec", tag = "3")]
44 pub block_hash: ::prost::alloc::vec::Vec<u8>,
45 #[prost(uint32, tag = "4")]
47 pub tx_index: u32,
48 #[prost(int64, tag = "5")]
50 pub block_timestamp: i64,
51 #[prost(message, optional, tag = "6")]
53 pub transaction_store_info: ::core::option::Option<StoreInfo>,
54}
55#[allow(clippy::derive_partial_eq_without_eq)]
57#[derive(Clone, PartialEq, ::prost::Message)]
58pub struct StoreInfo {
59 #[prost(enumeration = "DataStoreType", tag = "1")]
61 pub store_type: i32,
62 #[prost(string, tag = "2")]
64 pub file_name: ::prost::alloc::string::String,
65 #[prost(uint64, tag = "3")]
67 pub offset: u64,
68 #[prost(uint64, tag = "4")]
70 pub byte_len: u64,
71}
72#[allow(clippy::derive_partial_eq_without_eq)]
74#[derive(Clone, PartialEq, ::prost::Message)]
75pub struct FileRange {
76 #[prost(string, tag = "1")]
78 pub file_name: ::prost::alloc::string::String,
79 #[prost(uint64, tag = "2")]
81 pub start: u64,
82 #[prost(uint64, tag = "3")]
84 pub end: u64,
85}
86#[allow(clippy::derive_partial_eq_without_eq)]
88#[derive(Clone, PartialEq, ::prost::Message)]
89pub struct ArchiveStatus {
90 #[prost(enumeration = "StoreType", tag = "1")]
92 pub r#type: i32,
93 #[prost(message, repeated, tag = "2")]
95 pub file_ranges: ::prost::alloc::vec::Vec<FileRange>,
96 #[prost(uint64, tag = "3")]
98 pub archive_pivot: u64,
99 #[prost(uint64, tag = "4")]
101 pub max_allow_archive_height: u64,
102 #[prost(enumeration = "ArchiveProcess", tag = "5")]
104 pub process: i32,
105}
106#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
107#[repr(i32)]
108pub enum DbType {
109 InvalidDb = 0,
110 BlockDb = 1,
111 BlockIndexDb = 2,
112 TxDb = 3,
113 TxIndexDb = 4,
114 SoftDb = 5,
115 StateDb = 6,
116 ReadWriteDb = 7,
117}
118impl DbType {
119 pub fn as_str_name(&self) -> &'static str {
124 match self {
125 DbType::InvalidDb => "INVALID_DB",
126 DbType::BlockDb => "BLOCK_DB",
127 DbType::BlockIndexDb => "BLOCK_INDEX_DB",
128 DbType::TxDb => "TX_DB",
129 DbType::TxIndexDb => "TX_INDEX_DB",
130 DbType::SoftDb => "SOFT_DB",
131 DbType::StateDb => "STATE_DB",
132 DbType::ReadWriteDb => "READ_WRITE_DB",
133 }
134 }
135 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
137 match value {
138 "INVALID_DB" => Some(Self::InvalidDb),
139 "BLOCK_DB" => Some(Self::BlockDb),
140 "BLOCK_INDEX_DB" => Some(Self::BlockIndexDb),
141 "TX_DB" => Some(Self::TxDb),
142 "TX_INDEX_DB" => Some(Self::TxIndexDb),
143 "SOFT_DB" => Some(Self::SoftDb),
144 "STATE_DB" => Some(Self::StateDb),
145 "READ_WRITE_DB" => Some(Self::ReadWriteDb),
146 _ => None,
147 }
148 }
149}
150#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
151#[repr(i32)]
152pub enum DataStoreType {
153 FileStore = 0,
155 SqlStore = 1,
157 Cos = 2,
159}
160impl DataStoreType {
161 pub fn as_str_name(&self) -> &'static str {
166 match self {
167 DataStoreType::FileStore => "FILE_STORE",
168 DataStoreType::SqlStore => "SQL_STORE",
169 DataStoreType::Cos => "COS",
170 }
171 }
172 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
174 match value {
175 "FILE_STORE" => Some(Self::FileStore),
176 "SQL_STORE" => Some(Self::SqlStore),
177 "COS" => Some(Self::Cos),
178 _ => None,
179 }
180 }
181}
182#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
184#[repr(i32)]
185pub enum StoreType {
186 RawDb = 0,
187 Bfdb = 1,
188}
189impl StoreType {
190 pub fn as_str_name(&self) -> &'static str {
195 match self {
196 StoreType::RawDb => "RawDB",
197 StoreType::Bfdb => "BFDB",
198 }
199 }
200 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
202 match value {
203 "RawDB" => Some(Self::RawDb),
204 "BFDB" => Some(Self::Bfdb),
205 _ => None,
206 }
207 }
208}
209#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
211#[repr(i32)]
212pub enum ArchiveProcess {
213 Normal = 0,
215 Archiving = 1,
217 Restoring = 2,
219}
220impl ArchiveProcess {
221 pub fn as_str_name(&self) -> &'static str {
226 match self {
227 ArchiveProcess::Normal => "Normal",
228 ArchiveProcess::Archiving => "Archiving",
229 ArchiveProcess::Restoring => "Restoring",
230 }
231 }
232 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
234 match value {
235 "Normal" => Some(Self::Normal),
236 "Archiving" => Some(Self::Archiving),
237 "Restoring" => Some(Self::Restoring),
238 _ => None,
239 }
240 }
241}
242#[allow(clippy::derive_partial_eq_without_eq)]
245#[derive(Clone, PartialEq, ::prost::Message)]
246pub struct KeyModification {
247 #[prost(string, tag = "1")]
248 pub tx_id: ::prost::alloc::string::String,
249 #[prost(bytes = "vec", tag = "2")]
250 pub value: ::prost::alloc::vec::Vec<u8>,
251 #[prost(int64, tag = "3")]
252 pub timestamp: i64,
253 #[prost(bool, tag = "4")]
254 pub is_delete: bool,
255 #[prost(uint64, tag = "5")]
256 pub block_height: u64,
257}
258#[allow(clippy::derive_partial_eq_without_eq)]
259#[derive(Clone, PartialEq, ::prost::Message)]
260pub struct TxHistory {
261 #[prost(string, tag = "1")]
262 pub tx_id: ::prost::alloc::string::String,
263 #[prost(uint64, tag = "2")]
264 pub block_height: u64,
265 #[prost(bytes = "vec", tag = "3")]
266 pub block_hash: ::prost::alloc::vec::Vec<u8>,
267 #[prost(int64, tag = "4")]
268 pub timestamp: i64,
269}
270#[allow(clippy::derive_partial_eq_without_eq)]
271#[derive(Clone, PartialEq, ::prost::Message)]
272pub struct Kv {
273 #[prost(string, tag = "1")]
274 pub contract_name: ::prost::alloc::string::String,
275 #[prost(bytes = "vec", tag = "2")]
276 pub key: ::prost::alloc::vec::Vec<u8>,
277 #[prost(bytes = "vec", tag = "3")]
278 pub value: ::prost::alloc::vec::Vec<u8>,
279}