Skip to main content

cmpb/
common.rs

1/// Bird's Nest
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct BirdsNest {
5    /// Bird's Nest config
6    #[prost(message, optional, tag = "1")]
7    pub config: ::core::option::Option<BirdsNestConfig>,
8    /// The final height
9    #[prost(uint64, tag = "2")]
10    pub height: u64,
11    /// current index
12    #[prost(uint32, tag = "3")]
13    pub current_index: u32,
14    /// A group of cuckoos filter
15    #[prost(message, repeated, tag = "4")]
16    pub filters: ::prost::alloc::vec::Vec<CuckooFilter>,
17}
18/// Sharding Bird's Nest
19#[allow(clippy::derive_partial_eq_without_eq)]
20#[derive(Clone, PartialEq, ::prost::Message)]
21pub struct ShardingBirdsNest {
22    #[prost(uint32, tag = "1")]
23    pub length: u32,
24    /// The final height
25    #[prost(uint64, tag = "2")]
26    pub height: u64,
27    /// Bird's Nest config
28    #[prost(message, optional, tag = "3")]
29    pub config: ::core::option::Option<ShardingBirdsNestConfig>,
30}
31/// Chain table structure
32#[allow(clippy::derive_partial_eq_without_eq)]
33#[derive(Clone, PartialEq, ::prost::Message)]
34pub struct CuckooFilter {
35    /// The field "cuckoo" is used to hold the serialized data of the cuckoo
36    /// Pb limit: The size of bytes cannot be larger than 4 GB
37    #[prost(bytes = "vec", tag = "1")]
38    pub cuckoo: ::prost::alloc::vec::Vec<u8>,
39    /// Carries the ID of the time
40    #[prost(bytes = "vec", tag = "2")]
41    pub extension: ::prost::alloc::vec::Vec<u8>,
42    /// cuckoo configuration
43    #[prost(bytes = "vec", tag = "3")]
44    pub config: ::prost::alloc::vec::Vec<u8>,
45}
46/// Sharding bird's Nest configuration
47#[allow(clippy::derive_partial_eq_without_eq)]
48#[derive(Clone, PartialEq, ::prost::Message)]
49pub struct ShardingBirdsNestConfig {
50    #[prost(string, tag = "1")]
51    pub chain_id: ::prost::alloc::string::String,
52    #[prost(uint32, tag = "2")]
53    pub length: u32,
54    /// sharding task timeout
55    #[prost(int64, tag = "3")]
56    pub timeout: i64,
57    /// Bird's Nest configuration
58    #[prost(message, optional, tag = "4")]
59    pub birdsnest: ::core::option::Option<BirdsNestConfig>,
60    /// Snapshot config
61    #[prost(message, optional, tag = "5")]
62    pub snapshot: ::core::option::Option<SnapshotSerializerConfig>,
63}
64#[allow(clippy::derive_partial_eq_without_eq)]
65#[derive(Clone, PartialEq, ::prost::Message)]
66pub struct BirdsNestConfig {
67    #[prost(string, tag = "1")]
68    pub chain_id: ::prost::alloc::string::String,
69    #[prost(uint32, tag = "2")]
70    pub length: u32,
71    /// rules config
72    #[prost(message, optional, tag = "3")]
73    pub rules: ::core::option::Option<RulesConfig>,
74    /// Cuckoo config
75    #[prost(message, optional, tag = "4")]
76    pub cuckoo: ::core::option::Option<CuckooConfig>,
77    /// Snapshot config
78    #[prost(message, optional, tag = "5")]
79    pub snapshot: ::core::option::Option<SnapshotSerializerConfig>,
80}
81#[allow(clippy::derive_partial_eq_without_eq)]
82#[derive(Clone, PartialEq, ::prost::Message)]
83pub struct RulesConfig {
84    /// absolute expire time second
85    #[prost(int64, tag = "1")]
86    pub absolute_expire_time: i64,
87}
88/// Cuckoo config
89#[allow(clippy::derive_partial_eq_without_eq)]
90#[derive(Clone, PartialEq, ::prost::Message)]
91pub struct CuckooConfig {
92    #[prost(enumeration = "KeyType", tag = "1")]
93    pub key_type: i32,
94    /// num of tags for each bucket, which is b in paper. tag is fingerprint, which is f in paper.
95    #[prost(uint32, tag = "2")]
96    pub tags_per_bucket: u32,
97    /// num of bits for each item, which is length of tag(fingerprint)
98    #[prost(uint32, tag = "3")]
99    pub bits_per_item: u32,
100    /// num of keys that filter will store. this value should close to and lower
101    /// 					 nextPow2(maxNumKeys/tagsPerBucket) * maxLoadFactor. cause table.NumBuckets is always a power of two
102    #[prost(uint32, tag = "4")]
103    pub max_num_keys: u32,
104    /// has two constant parameters to choose from:
105    /// TableTypeSingle normal single table
106    /// TableTypePacked packed table, use semi-sort to save 1 bit per item
107    #[prost(uint32, tag = "5")]
108    pub table_type: u32,
109}
110/// Snapshot serializer config
111#[allow(clippy::derive_partial_eq_without_eq)]
112#[derive(Clone, PartialEq, ::prost::Message)]
113pub struct SnapshotSerializerConfig {
114    /// serialization type
115    #[prost(enumeration = "SerializeIntervalType", tag = "1")]
116    pub r#type: i32,
117    #[prost(message, optional, tag = "2")]
118    pub timed: ::core::option::Option<TimedSerializeIntervalConfig>,
119    #[prost(message, optional, tag = "3")]
120    pub block_height: ::core::option::Option<BlockHeightSerializeIntervalConfig>,
121    /// filepath
122    #[prost(string, tag = "4")]
123    pub path: ::prost::alloc::string::String,
124}
125/// Timed serialization interval
126#[allow(clippy::derive_partial_eq_without_eq)]
127#[derive(Clone, PartialEq, ::prost::Message)]
128pub struct TimedSerializeIntervalConfig {
129    #[prost(int64, tag = "1")]
130    pub interval: i64,
131}
132/// Block height serialization interval
133#[allow(clippy::derive_partial_eq_without_eq)]
134#[derive(Clone, PartialEq, ::prost::Message)]
135pub struct BlockHeightSerializeIntervalConfig {
136    #[prost(uint64, tag = "1")]
137    pub interval: u64,
138}
139#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
140#[repr(i32)]
141pub enum KeyType {
142    KtDefault = 0,
143    KtTimestampKey = 1,
144}
145impl KeyType {
146    /// String value of the enum field names used in the ProtoBuf definition.
147    ///
148    /// The values are not transformed in any way and thus are considered stable
149    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
150    pub fn as_str_name(&self) -> &'static str {
151        match self {
152            KeyType::KtDefault => "KTDefault",
153            KeyType::KtTimestampKey => "KTTimestampKey",
154        }
155    }
156    /// Creates an enum from field names used in the ProtoBuf definition.
157    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
158        match value {
159            "KTDefault" => Some(Self::KtDefault),
160            "KTTimestampKey" => Some(Self::KtTimestampKey),
161            _ => None,
162        }
163    }
164}
165#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
166#[repr(i32)]
167pub enum FilterExtensionType {
168    FetDefault = 0,
169    FetTimestamp = 1,
170}
171impl FilterExtensionType {
172    /// String value of the enum field names used in the ProtoBuf definition.
173    ///
174    /// The values are not transformed in any way and thus are considered stable
175    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
176    pub fn as_str_name(&self) -> &'static str {
177        match self {
178            FilterExtensionType::FetDefault => "FETDefault",
179            FilterExtensionType::FetTimestamp => "FETTimestamp",
180        }
181    }
182    /// Creates an enum from field names used in the ProtoBuf definition.
183    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
184        match value {
185            "FETDefault" => Some(Self::FetDefault),
186            "FETTimestamp" => Some(Self::FetTimestamp),
187            _ => None,
188        }
189    }
190}
191#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
192#[repr(i32)]
193pub enum RuleType {
194    AbsoluteExpireTime = 0,
195}
196impl RuleType {
197    /// String value of the enum field names used in the ProtoBuf definition.
198    ///
199    /// The values are not transformed in any way and thus are considered stable
200    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
201    pub fn as_str_name(&self) -> &'static str {
202        match self {
203            RuleType::AbsoluteExpireTime => "AbsoluteExpireTime",
204        }
205    }
206    /// Creates an enum from field names used in the ProtoBuf definition.
207    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
208        match value {
209            "AbsoluteExpireTime" => Some(Self::AbsoluteExpireTime),
210            _ => None,
211        }
212    }
213}
214#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
215#[repr(i32)]
216pub enum SerializeIntervalType {
217    /// Timed serialize type
218    Height = 0,
219    /// Timed serialize type
220    Timed = 1,
221    /// Exit serialize type
222    Exit = 2,
223}
224impl SerializeIntervalType {
225    /// String value of the enum field names used in the ProtoBuf definition.
226    ///
227    /// The values are not transformed in any way and thus are considered stable
228    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
229    pub fn as_str_name(&self) -> &'static str {
230        match self {
231            SerializeIntervalType::Height => "Height",
232            SerializeIntervalType::Timed => "Timed",
233            SerializeIntervalType::Exit => "Exit",
234        }
235    }
236    /// Creates an enum from field names used in the ProtoBuf definition.
237    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
238        match value {
239            "Height" => Some(Self::Height),
240            "Timed" => Some(Self::Timed),
241            "Exit" => Some(Self::Exit),
242            _ => None,
243        }
244    }
245}
246/// transaction request proposed by user
247#[allow(clippy::derive_partial_eq_without_eq)]
248#[derive(Clone, PartialEq, ::prost::Message)]
249pub struct TxRequest {
250    /// payload
251    #[prost(message, optional, tag = "1")]
252    pub payload: ::core::option::Option<Payload>,
253    /// sender account and sender's signature
254    #[prost(message, optional, tag = "2")]
255    pub sender: ::core::option::Option<EndorsementEntry>,
256    /// endorsers account and signatures
257    #[prost(message, repeated, tag = "3")]
258    pub endorsers: ::prost::alloc::vec::Vec<EndorsementEntry>,
259    /// payer account and signature
260    #[prost(message, optional, tag = "4")]
261    pub payer: ::core::option::Option<EndorsementEntry>,
262}
263#[allow(clippy::derive_partial_eq_without_eq)]
264#[derive(Clone, PartialEq, ::prost::Message)]
265pub struct RawTxRequest {
266    #[prost(bytes = "vec", tag = "1")]
267    pub raw_tx: ::prost::alloc::vec::Vec<u8>,
268}
269/// transaction payload
270#[allow(clippy::derive_partial_eq_without_eq)]
271#[derive(Clone, PartialEq, ::prost::Message)]
272pub struct Payload {
273    /// blockchain identifier
274    #[prost(string, tag = "1")]
275    pub chain_id: ::prost::alloc::string::String,
276    /// transaction type
277    #[prost(enumeration = "TxType", tag = "2")]
278    pub tx_type: i32,
279    /// transaction id set by sender, should be unique
280    #[prost(string, tag = "3")]
281    pub tx_id: ::prost::alloc::string::String,
282    /// transaction timestamp, in unix timestamp format, seconds
283    #[prost(int64, tag = "4")]
284    pub timestamp: i64,
285    /// expiration timestamp in unix timestamp format
286    /// after that the transaction is invalid if it is not included in block yet
287    #[prost(int64, tag = "5")]
288    pub expiration_time: i64,
289    /// smart contract name
290    #[prost(string, tag = "6")]
291    pub contract_name: ::prost::alloc::string::String,
292    /// invoke method
293    #[prost(string, tag = "7")]
294    pub method: ::prost::alloc::string::String,
295    /// invoke parameters in k-v format
296    #[prost(message, repeated, tag = "8")]
297    pub parameters: ::prost::alloc::vec::Vec<KeyValuePair>,
298    /// sequence number, default is 0
299    #[prost(uint64, tag = "9")]
300    pub sequence: u64,
301    /// transaction limitation
302    #[prost(message, optional, tag = "10")]
303    pub limit: ::core::option::Option<Limit>,
304}
305/// endorsement info, including a signer and his signature
306#[allow(clippy::derive_partial_eq_without_eq)]
307#[derive(Clone, PartialEq, ::prost::Message)]
308pub struct EndorsementEntry {
309    /// signer
310    #[prost(message, optional, tag = "1")]
311    pub signer: ::core::option::Option<super::accesscontrol::Member>,
312    /// signature
313    #[prost(bytes = "vec", tag = "2")]
314    pub signature: ::prost::alloc::vec::Vec<u8>,
315}
316/// a k-v pair
317#[allow(clippy::derive_partial_eq_without_eq)]
318#[derive(Clone, PartialEq, ::prost::Message)]
319pub struct KeyValuePair {
320    #[prost(string, tag = "1")]
321    pub key: ::prost::alloc::string::String,
322    #[prost(bytes = "vec", tag = "2")]
323    pub value: ::prost::alloc::vec::Vec<u8>,
324}
325/// Limit defines transaction limitation, Limit as a message for easy expansion
326#[allow(clippy::derive_partial_eq_without_eq)]
327#[derive(Clone, PartialEq, ::prost::Message)]
328pub struct Limit {
329    /// gas limit
330    #[prost(uint64, tag = "1")]
331    pub gas_limit: u64,
332}
333/// transaction type definition
334#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
335#[repr(i32)]
336pub enum TxType {
337    /// call a pre created contract, tx included in block
338    InvokeContract = 0,
339    /// query a pre-created  contract, tx not included in block
340    QueryContract = 1,
341    /// subscribe block info,tx info and contract info. tx not included in block
342    Subscribe = 2,
343    /// archive/restore block, tx not included in block
344    Archive = 3,
345}
346impl TxType {
347    /// String value of the enum field names used in the ProtoBuf definition.
348    ///
349    /// The values are not transformed in any way and thus are considered stable
350    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
351    pub fn as_str_name(&self) -> &'static str {
352        match self {
353            TxType::InvokeContract => "INVOKE_CONTRACT",
354            TxType::QueryContract => "QUERY_CONTRACT",
355            TxType::Subscribe => "SUBSCRIBE",
356            TxType::Archive => "ARCHIVE",
357        }
358    }
359    /// Creates an enum from field names used in the ProtoBuf definition.
360    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
361        match value {
362            "INVOKE_CONTRACT" => Some(Self::InvokeContract),
363            "QUERY_CONTRACT" => Some(Self::QueryContract),
364            "SUBSCRIBE" => Some(Self::Subscribe),
365            "ARCHIVE" => Some(Self::Archive),
366            _ => None,
367        }
368    }
369}
370/// tx request - tx response, only for RPC response
371#[allow(clippy::derive_partial_eq_without_eq)]
372#[derive(Clone, PartialEq, ::prost::Message)]
373pub struct TxResponse {
374    /// response code
375    #[prost(enumeration = "TxStatusCode", tag = "1")]
376    pub code: i32,
377    /// response message
378    #[prost(string, tag = "2")]
379    pub message: ::prost::alloc::string::String,
380    /// returned data, set in smart contract
381    #[prost(message, optional, tag = "3")]
382    pub contract_result: ::core::option::Option<ContractResult>,
383    /// tx id of request
384    #[prost(string, tag = "4")]
385    pub tx_id: ::prost::alloc::string::String,
386    /// async tx mode: tx timestamp is zero
387    /// sync tx mode: tx timestamp is TxRequest.Payload.Timestamp
388    #[prost(int64, tag = "5")]
389    pub tx_timestamp: i64,
390    /// async tx mode: tx block height is zero
391    /// sync tx mode: tx block height is the height of block which this tx was packaged
392    #[prost(uint64, tag = "6")]
393    pub tx_block_height: u64,
394}
395#[allow(clippy::derive_partial_eq_without_eq)]
396#[derive(Clone, PartialEq, ::prost::Message)]
397pub struct SubscribeResult {
398    /// when TxType == SUBSCRIBE_BLOCK_INFO, data type is pb.BlockInfo;
399    /// when TxType == SUBSCRIBE_TX_INFO,data type is pb.Transaction.
400    #[prost(bytes = "vec", tag = "1")]
401    pub data: ::prost::alloc::vec::Vec<u8>,
402}
403/// tx result, part of a transaction in block
404#[allow(clippy::derive_partial_eq_without_eq)]
405#[derive(Clone, PartialEq, ::prost::Message)]
406pub struct Result {
407    /// response code
408    #[prost(enumeration = "TxStatusCode", tag = "1")]
409    pub code: i32,
410    /// returned data, set in smart contract
411    #[prost(message, optional, tag = "2")]
412    pub contract_result: ::core::option::Option<ContractResult>,
413    /// hash of the transaction's read-write set
414    #[prost(bytes = "vec", tag = "3")]
415    pub rw_set_hash: ::prost::alloc::vec::Vec<u8>,
416    #[prost(string, tag = "4")]
417    pub message: ::prost::alloc::string::String,
418}
419/// invoke user contract method return UserContractReturnPayload
420/// Unmarshal from TransactResult.TxResponse.payload
421#[allow(clippy::derive_partial_eq_without_eq)]
422#[derive(Clone, PartialEq, ::prost::Message)]
423pub struct ContractResult {
424    /// user contract defined return code, 0-ok, >0 user define error code. for example, insufficient balance in token transfer
425    #[prost(uint32, tag = "1")]
426    pub code: u32,
427    /// user contract defined result
428    #[prost(bytes = "vec", tag = "2")]
429    pub result: ::prost::alloc::vec::Vec<u8>,
430    /// user contract defined result message
431    #[prost(string, tag = "3")]
432    pub message: ::prost::alloc::string::String,
433    /// gas used by current contract(include contract call)
434    #[prost(uint64, tag = "4")]
435    pub gas_used: u64,
436    /// contract events
437    #[prost(message, repeated, tag = "5")]
438    pub contract_event: ::prost::alloc::vec::Vec<ContractEvent>,
439}
440#[allow(clippy::derive_partial_eq_without_eq)]
441#[derive(Clone, PartialEq, ::prost::Message)]
442pub struct PrivateGetContract {
443    #[prost(bytes = "vec", tag = "1")]
444    pub contract_code: ::prost::alloc::vec::Vec<u8>,
445    #[prost(string, tag = "2")]
446    pub version: ::prost::alloc::string::String,
447    #[prost(uint64, tag = "3")]
448    pub gas_limit: u64,
449}
450#[allow(clippy::derive_partial_eq_without_eq)]
451#[derive(Clone, PartialEq, ::prost::Message)]
452pub struct StrSlice {
453    #[prost(string, repeated, tag = "1")]
454    pub str_arr: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
455}
456/// certificate collection
457#[allow(clippy::derive_partial_eq_without_eq)]
458#[derive(Clone, PartialEq, ::prost::Message)]
459pub struct CertInfos {
460    #[prost(message, repeated, tag = "1")]
461    pub cert_infos: ::prost::alloc::vec::Vec<CertInfo>,
462}
463/// certificate information
464#[allow(clippy::derive_partial_eq_without_eq)]
465#[derive(Clone, PartialEq, ::prost::Message)]
466pub struct CertInfo {
467    /// certificate hash
468    #[prost(string, tag = "1")]
469    pub hash: ::prost::alloc::string::String,
470    /// certificate contents
471    #[prost(bytes = "vec", tag = "2")]
472    pub cert: ::prost::alloc::vec::Vec<u8>,
473}
474/// contract event saved in block chain
475#[allow(clippy::derive_partial_eq_without_eq)]
476#[derive(Clone, PartialEq, ::prost::Message)]
477pub struct ContractEvent {
478    #[prost(string, tag = "1")]
479    pub topic: ::prost::alloc::string::String,
480    #[prost(string, tag = "2")]
481    pub tx_id: ::prost::alloc::string::String,
482    #[prost(string, tag = "3")]
483    pub contract_name: ::prost::alloc::string::String,
484    #[prost(string, tag = "4")]
485    pub contract_version: ::prost::alloc::string::String,
486    #[prost(string, repeated, tag = "5")]
487    pub event_data: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
488}
489/// contract event published to user
490#[allow(clippy::derive_partial_eq_without_eq)]
491#[derive(Clone, PartialEq, ::prost::Message)]
492pub struct ContractEventInfo {
493    #[prost(uint64, tag = "1")]
494    pub block_height: u64,
495    #[prost(string, tag = "2")]
496    pub chain_id: ::prost::alloc::string::String,
497    #[prost(string, tag = "3")]
498    pub topic: ::prost::alloc::string::String,
499    #[prost(string, tag = "4")]
500    pub tx_id: ::prost::alloc::string::String,
501    #[prost(uint32, tag = "5")]
502    pub event_index: u32,
503    #[prost(string, tag = "6")]
504    pub contract_name: ::prost::alloc::string::String,
505    #[prost(string, tag = "7")]
506    pub contract_version: ::prost::alloc::string::String,
507    #[prost(string, repeated, tag = "8")]
508    pub event_data: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
509}
510/// contract event published to user
511#[allow(clippy::derive_partial_eq_without_eq)]
512#[derive(Clone, PartialEq, ::prost::Message)]
513pub struct ContractEventInfoList {
514    #[prost(message, repeated, tag = "1")]
515    pub contract_events: ::prost::alloc::vec::Vec<ContractEventInfo>,
516}
517/// alias info
518#[allow(clippy::derive_partial_eq_without_eq)]
519#[derive(Clone, PartialEq, ::prost::Message)]
520pub struct AliasInfo {
521    #[prost(string, tag = "1")]
522    pub alias: ::prost::alloc::string::String,
523    #[prost(message, optional, tag = "2")]
524    pub now_cert: ::core::option::Option<AliasCertInfo>,
525    #[prost(message, repeated, tag = "3")]
526    pub his_certs: ::prost::alloc::vec::Vec<AliasCertInfo>,
527}
528/// alias info
529#[allow(clippy::derive_partial_eq_without_eq)]
530#[derive(Clone, PartialEq, ::prost::Message)]
531pub struct AliasInfos {
532    #[prost(message, repeated, tag = "1")]
533    pub alias_infos: ::prost::alloc::vec::Vec<AliasInfo>,
534}
535/// cert info
536#[allow(clippy::derive_partial_eq_without_eq)]
537#[derive(Clone, PartialEq, ::prost::Message)]
538pub struct AliasCertInfo {
539    #[prost(string, tag = "1")]
540    pub hash: ::prost::alloc::string::String,
541    #[prost(bytes = "vec", tag = "2")]
542    pub cert: ::prost::alloc::vec::Vec<u8>,
543    #[prost(uint64, tag = "3")]
544    pub block_height: u64,
545}
546/// TxStatusCode describes the tx status in tx result
547#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
548#[repr(i32)]
549pub enum TxStatusCode {
550    Success = 0,
551    Timeout = 1,
552    InvalidParameter = 2,
553    NoPermission = 3,
554    ContractFail = 4,
555    InternalError = 5,
556    InvalidContractTransactionType = 10,
557    InvalidContractParameterContractName = 11,
558    InvalidContractParameterMethod = 12,
559    InvalidContractParameterInitMethod = 13,
560    InvalidContractParameterUpgradeMethod = 14,
561    InvalidContractParameterByteCode = 15,
562    InvalidContractParameterRuntimeType = 16,
563    InvalidContractParameterVersion = 17,
564    GetFromTxContextFailed = 20,
565    PutIntoTxContextFailed = 21,
566    ContractVersionExistFailed = 22,
567    ContractVersionNotExistFailed = 23,
568    ContractByteCodeNotExistFailed = 24,
569    MarshalSenderFailed = 25,
570    InvokeInitMethodFailed = 26,
571    InvokeUpgradeMethodFailed = 27,
572    CreateRuntimeInstanceFailed = 28,
573    UnmarshalCreatorFailed = 29,
574    UnmarshalSenderFailed = 30,
575    GetSenderPkFailed = 31,
576    GetCreatorPkFailed = 32,
577    GetCreatorFailed = 33,
578    GetCreatorCertFailed = 34,
579    GetSenderCertFailed = 35,
580    ContractFreezeFailed = 36,
581    ContractTooDeepFailed = 37,
582    ContractRevokeFailed = 38,
583    ContractInvokeMethodFailed = 39,
584    ArchivedTx = 40,
585    ArchivedBlock = 41,
586    GasBalanceNotEnoughFailed = 42,
587    GasLimitNotSet = 43,
588    GasLimitTooSmall = 44,
589    /// add for optimized charging gas return message
590    GetAccountBalanceFailed = 45,
591    ParseAccountBalanceFailed = 46,
592    GetAccountStatusFailed = 47,
593    AccountStatusFrozen = 48,
594}
595impl TxStatusCode {
596    /// String value of the enum field names used in the ProtoBuf definition.
597    ///
598    /// The values are not transformed in any way and thus are considered stable
599    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
600    pub fn as_str_name(&self) -> &'static str {
601        match self {
602            TxStatusCode::Success => "SUCCESS",
603            TxStatusCode::Timeout => "TIMEOUT",
604            TxStatusCode::InvalidParameter => "INVALID_PARAMETER",
605            TxStatusCode::NoPermission => "NO_PERMISSION",
606            TxStatusCode::ContractFail => "CONTRACT_FAIL",
607            TxStatusCode::InternalError => "INTERNAL_ERROR",
608            TxStatusCode::InvalidContractTransactionType => "INVALID_CONTRACT_TRANSACTION_TYPE",
609            TxStatusCode::InvalidContractParameterContractName => {
610                "INVALID_CONTRACT_PARAMETER_CONTRACT_NAME"
611            }
612            TxStatusCode::InvalidContractParameterMethod => "INVALID_CONTRACT_PARAMETER_METHOD",
613            TxStatusCode::InvalidContractParameterInitMethod => {
614                "INVALID_CONTRACT_PARAMETER_INIT_METHOD"
615            }
616            TxStatusCode::InvalidContractParameterUpgradeMethod => {
617                "INVALID_CONTRACT_PARAMETER_UPGRADE_METHOD"
618            }
619            TxStatusCode::InvalidContractParameterByteCode => {
620                "INVALID_CONTRACT_PARAMETER_BYTE_CODE"
621            }
622            TxStatusCode::InvalidContractParameterRuntimeType => {
623                "INVALID_CONTRACT_PARAMETER_RUNTIME_TYPE"
624            }
625            TxStatusCode::InvalidContractParameterVersion => "INVALID_CONTRACT_PARAMETER_VERSION",
626            TxStatusCode::GetFromTxContextFailed => "GET_FROM_TX_CONTEXT_FAILED",
627            TxStatusCode::PutIntoTxContextFailed => "PUT_INTO_TX_CONTEXT_FAILED",
628            TxStatusCode::ContractVersionExistFailed => "CONTRACT_VERSION_EXIST_FAILED",
629            TxStatusCode::ContractVersionNotExistFailed => "CONTRACT_VERSION_NOT_EXIST_FAILED",
630            TxStatusCode::ContractByteCodeNotExistFailed => "CONTRACT_BYTE_CODE_NOT_EXIST_FAILED",
631            TxStatusCode::MarshalSenderFailed => "MARSHAL_SENDER_FAILED",
632            TxStatusCode::InvokeInitMethodFailed => "INVOKE_INIT_METHOD_FAILED",
633            TxStatusCode::InvokeUpgradeMethodFailed => "INVOKE_UPGRADE_METHOD_FAILED",
634            TxStatusCode::CreateRuntimeInstanceFailed => "CREATE_RUNTIME_INSTANCE_FAILED",
635            TxStatusCode::UnmarshalCreatorFailed => "UNMARSHAL_CREATOR_FAILED",
636            TxStatusCode::UnmarshalSenderFailed => "UNMARSHAL_SENDER_FAILED",
637            TxStatusCode::GetSenderPkFailed => "GET_SENDER_PK_FAILED",
638            TxStatusCode::GetCreatorPkFailed => "GET_CREATOR_PK_FAILED",
639            TxStatusCode::GetCreatorFailed => "GET_CREATOR_FAILED",
640            TxStatusCode::GetCreatorCertFailed => "GET_CREATOR_CERT_FAILED",
641            TxStatusCode::GetSenderCertFailed => "GET_SENDER_CERT_FAILED",
642            TxStatusCode::ContractFreezeFailed => "CONTRACT_FREEZE_FAILED",
643            TxStatusCode::ContractTooDeepFailed => "CONTRACT_TOO_DEEP_FAILED",
644            TxStatusCode::ContractRevokeFailed => "CONTRACT_REVOKE_FAILED",
645            TxStatusCode::ContractInvokeMethodFailed => "CONTRACT_INVOKE_METHOD_FAILED",
646            TxStatusCode::ArchivedTx => "ARCHIVED_TX",
647            TxStatusCode::ArchivedBlock => "ARCHIVED_BLOCK",
648            TxStatusCode::GasBalanceNotEnoughFailed => "GAS_BALANCE_NOT_ENOUGH_FAILED",
649            TxStatusCode::GasLimitNotSet => "GAS_LIMIT_NOT_SET",
650            TxStatusCode::GasLimitTooSmall => "GAS_LIMIT_TOO_SMALL",
651            TxStatusCode::GetAccountBalanceFailed => "GET_ACCOUNT_BALANCE_FAILED",
652            TxStatusCode::ParseAccountBalanceFailed => "PARSE_ACCOUNT_BALANCE_FAILED",
653            TxStatusCode::GetAccountStatusFailed => "GET_ACCOUNT_STATUS_FAILED",
654            TxStatusCode::AccountStatusFrozen => "ACCOUNT_STATUS_FROZEN",
655        }
656    }
657    /// Creates an enum from field names used in the ProtoBuf definition.
658    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
659        match value {
660            "SUCCESS" => Some(Self::Success),
661            "TIMEOUT" => Some(Self::Timeout),
662            "INVALID_PARAMETER" => Some(Self::InvalidParameter),
663            "NO_PERMISSION" => Some(Self::NoPermission),
664            "CONTRACT_FAIL" => Some(Self::ContractFail),
665            "INTERNAL_ERROR" => Some(Self::InternalError),
666            "INVALID_CONTRACT_TRANSACTION_TYPE" => Some(Self::InvalidContractTransactionType),
667            "INVALID_CONTRACT_PARAMETER_CONTRACT_NAME" => {
668                Some(Self::InvalidContractParameterContractName)
669            }
670            "INVALID_CONTRACT_PARAMETER_METHOD" => Some(Self::InvalidContractParameterMethod),
671            "INVALID_CONTRACT_PARAMETER_INIT_METHOD" => {
672                Some(Self::InvalidContractParameterInitMethod)
673            }
674            "INVALID_CONTRACT_PARAMETER_UPGRADE_METHOD" => {
675                Some(Self::InvalidContractParameterUpgradeMethod)
676            }
677            "INVALID_CONTRACT_PARAMETER_BYTE_CODE" => Some(Self::InvalidContractParameterByteCode),
678            "INVALID_CONTRACT_PARAMETER_RUNTIME_TYPE" => {
679                Some(Self::InvalidContractParameterRuntimeType)
680            }
681            "INVALID_CONTRACT_PARAMETER_VERSION" => Some(Self::InvalidContractParameterVersion),
682            "GET_FROM_TX_CONTEXT_FAILED" => Some(Self::GetFromTxContextFailed),
683            "PUT_INTO_TX_CONTEXT_FAILED" => Some(Self::PutIntoTxContextFailed),
684            "CONTRACT_VERSION_EXIST_FAILED" => Some(Self::ContractVersionExistFailed),
685            "CONTRACT_VERSION_NOT_EXIST_FAILED" => Some(Self::ContractVersionNotExistFailed),
686            "CONTRACT_BYTE_CODE_NOT_EXIST_FAILED" => Some(Self::ContractByteCodeNotExistFailed),
687            "MARSHAL_SENDER_FAILED" => Some(Self::MarshalSenderFailed),
688            "INVOKE_INIT_METHOD_FAILED" => Some(Self::InvokeInitMethodFailed),
689            "INVOKE_UPGRADE_METHOD_FAILED" => Some(Self::InvokeUpgradeMethodFailed),
690            "CREATE_RUNTIME_INSTANCE_FAILED" => Some(Self::CreateRuntimeInstanceFailed),
691            "UNMARSHAL_CREATOR_FAILED" => Some(Self::UnmarshalCreatorFailed),
692            "UNMARSHAL_SENDER_FAILED" => Some(Self::UnmarshalSenderFailed),
693            "GET_SENDER_PK_FAILED" => Some(Self::GetSenderPkFailed),
694            "GET_CREATOR_PK_FAILED" => Some(Self::GetCreatorPkFailed),
695            "GET_CREATOR_FAILED" => Some(Self::GetCreatorFailed),
696            "GET_CREATOR_CERT_FAILED" => Some(Self::GetCreatorCertFailed),
697            "GET_SENDER_CERT_FAILED" => Some(Self::GetSenderCertFailed),
698            "CONTRACT_FREEZE_FAILED" => Some(Self::ContractFreezeFailed),
699            "CONTRACT_TOO_DEEP_FAILED" => Some(Self::ContractTooDeepFailed),
700            "CONTRACT_REVOKE_FAILED" => Some(Self::ContractRevokeFailed),
701            "CONTRACT_INVOKE_METHOD_FAILED" => Some(Self::ContractInvokeMethodFailed),
702            "ARCHIVED_TX" => Some(Self::ArchivedTx),
703            "ARCHIVED_BLOCK" => Some(Self::ArchivedBlock),
704            "GAS_BALANCE_NOT_ENOUGH_FAILED" => Some(Self::GasBalanceNotEnoughFailed),
705            "GAS_LIMIT_NOT_SET" => Some(Self::GasLimitNotSet),
706            "GAS_LIMIT_TOO_SMALL" => Some(Self::GasLimitTooSmall),
707            "GET_ACCOUNT_BALANCE_FAILED" => Some(Self::GetAccountBalanceFailed),
708            "PARSE_ACCOUNT_BALANCE_FAILED" => Some(Self::ParseAccountBalanceFailed),
709            "GET_ACCOUNT_STATUS_FAILED" => Some(Self::GetAccountStatusFailed),
710            "ACCOUNT_STATUS_FROZEN" => Some(Self::AccountStatusFrozen),
711            _ => None,
712        }
713    }
714}
715/// key read version
716#[allow(clippy::derive_partial_eq_without_eq)]
717#[derive(Clone, PartialEq, ::prost::Message)]
718pub struct KeyVersion {
719    /// the transaction identifier that last modified the key
720    #[prost(string, tag = "3")]
721    pub ref_tx_id: ::prost::alloc::string::String,
722    /// the offset of the key in the write set of the transaction, starts from 0
723    #[prost(int32, tag = "4")]
724    pub ref_offset: i32,
725}
726/// TxRead describes a read operation on a key
727#[allow(clippy::derive_partial_eq_without_eq)]
728#[derive(Clone, PartialEq, ::prost::Message)]
729pub struct TxRead {
730    /// read key
731    #[prost(bytes = "vec", tag = "1")]
732    pub key: ::prost::alloc::vec::Vec<u8>,
733    /// the value of the key
734    #[prost(bytes = "vec", tag = "2")]
735    pub value: ::prost::alloc::vec::Vec<u8>,
736    /// contract name, used in cross-contract calls
737    /// set to null if only the contract in transaction request is called
738    #[prost(string, tag = "3")]
739    pub contract_name: ::prost::alloc::string::String,
740    /// read key version
741    #[prost(message, optional, tag = "4")]
742    pub version: ::core::option::Option<KeyVersion>,
743}
744/// TxRead describes a write/delete operation on a key
745#[allow(clippy::derive_partial_eq_without_eq)]
746#[derive(Clone, PartialEq, ::prost::Message)]
747pub struct TxWrite {
748    /// write key
749    #[prost(bytes = "vec", tag = "1")]
750    pub key: ::prost::alloc::vec::Vec<u8>,
751    /// write value
752    #[prost(bytes = "vec", tag = "2")]
753    pub value: ::prost::alloc::vec::Vec<u8>,
754    /// contract name, used in cross-contract calls
755    /// set to null if only the contract in transaction request is called
756    #[prost(string, tag = "3")]
757    pub contract_name: ::prost::alloc::string::String,
758}
759/// TxRWSet describes all the operations of a transaction on ledger
760#[allow(clippy::derive_partial_eq_without_eq)]
761#[derive(Clone, PartialEq, ::prost::Message)]
762pub struct TxRwSet {
763    /// transaction identifier
764    #[prost(string, tag = "1")]
765    pub tx_id: ::prost::alloc::string::String,
766    /// read set
767    #[prost(message, repeated, tag = "2")]
768    pub tx_reads: ::prost::alloc::vec::Vec<TxRead>,
769    /// write set
770    #[prost(message, repeated, tag = "3")]
771    pub tx_writes: ::prost::alloc::vec::Vec<TxWrite>,
772}
773/// a transaction includes request and its result
774#[allow(clippy::derive_partial_eq_without_eq)]
775#[derive(Clone, PartialEq, ::prost::Message)]
776pub struct Transaction {
777    /// payload
778    #[prost(message, optional, tag = "1")]
779    pub payload: ::core::option::Option<Payload>,
780    /// sender account and signature
781    #[prost(message, optional, tag = "2")]
782    pub sender: ::core::option::Option<EndorsementEntry>,
783    /// endorser accounts and signatures
784    #[prost(message, repeated, tag = "3")]
785    pub endorsers: ::prost::alloc::vec::Vec<EndorsementEntry>,
786    /// result of the transaction
787    #[prost(message, optional, tag = "4")]
788    pub result: ::core::option::Option<Result>,
789    /// payer account and signature
790    #[prost(message, optional, tag = "5")]
791    pub payer: ::core::option::Option<EndorsementEntry>,
792}
793/// transaction info include transaction and its block height hash and tx index
794#[allow(clippy::derive_partial_eq_without_eq)]
795#[derive(Clone, PartialEq, ::prost::Message)]
796pub struct TransactionInfo {
797    /// transaction raw data
798    #[prost(message, optional, tag = "1")]
799    pub transaction: ::core::option::Option<Transaction>,
800    /// block height
801    #[prost(uint64, tag = "2")]
802    pub block_height: u64,
803    /// Deprecated, block hash
804    #[prost(bytes = "vec", tag = "3")]
805    pub block_hash: ::prost::alloc::vec::Vec<u8>,
806    /// transaction index in block
807    #[prost(uint32, tag = "4")]
808    pub tx_index: u32,
809    /// block header timestamp
810    #[prost(int64, tag = "5")]
811    pub block_timestamp: i64,
812}
813/// transaction and read write set
814#[allow(clippy::derive_partial_eq_without_eq)]
815#[derive(Clone, PartialEq, ::prost::Message)]
816pub struct TransactionWithRwSet {
817    /// transaction raw data
818    #[prost(message, optional, tag = "1")]
819    pub transaction: ::core::option::Option<Transaction>,
820    #[prost(message, optional, tag = "2")]
821    pub rw_set: ::core::option::Option<TxRwSet>,
822}
823#[allow(clippy::derive_partial_eq_without_eq)]
824#[derive(Clone, PartialEq, ::prost::Message)]
825pub struct TransactionInfoWithRwSet {
826    /// transaction raw data
827    #[prost(message, optional, tag = "1")]
828    pub transaction: ::core::option::Option<Transaction>,
829    /// block height
830    #[prost(uint64, tag = "2")]
831    pub block_height: u64,
832    /// Deprecated, block hash
833    #[prost(bytes = "vec", tag = "3")]
834    pub block_hash: ::prost::alloc::vec::Vec<u8>,
835    /// transaction index in block
836    #[prost(uint32, tag = "4")]
837    pub tx_index: u32,
838    /// block header timestamp
839    #[prost(int64, tag = "5")]
840    pub block_timestamp: i64,
841    #[prost(message, optional, tag = "6")]
842    pub rw_set: ::core::option::Option<TxRwSet>,
843}
844/// Block definition
845#[allow(clippy::derive_partial_eq_without_eq)]
846#[derive(Clone, PartialEq, ::prost::Message)]
847pub struct Block {
848    /// header of the block
849    #[prost(message, optional, tag = "1")]
850    pub header: ::core::option::Option<BlockHeader>,
851    /// execution sequence of intra block transactions, generated by proposer
852    #[prost(message, optional, tag = "2")]
853    pub dag: ::core::option::Option<Dag>,
854    /// transaction list in this block
855    #[prost(message, repeated, tag = "3")]
856    pub txs: ::prost::alloc::vec::Vec<Transaction>,
857    /// stores the voting information of the current block
858    /// not included in block hash value calculation
859    #[prost(message, optional, tag = "4")]
860    pub additional_data: ::core::option::Option<AdditionalData>,
861}
862/// block information
863#[allow(clippy::derive_partial_eq_without_eq)]
864#[derive(Clone, PartialEq, ::prost::Message)]
865pub struct BlockInfo {
866    /// block
867    #[prost(message, optional, tag = "1")]
868    pub block: ::core::option::Option<Block>,
869    /// The read/write set list corresponding to the transaction included in the block
870    #[prost(message, repeated, tag = "2")]
871    pub rwset_list: ::prost::alloc::vec::Vec<TxRwSet>,
872}
873/// block additional data
874#[allow(clippy::derive_partial_eq_without_eq)]
875#[derive(Clone, PartialEq, ::prost::Message)]
876pub struct AdditionalData {
877    /// extra data, with map type, excluded in hash calculation
878    #[prost(map = "string, bytes", tag = "1")]
879    pub extra_data:
880        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::vec::Vec<u8>>,
881}
882/// tx batch info,saved in additional data
883#[allow(clippy::derive_partial_eq_without_eq)]
884#[derive(Clone, PartialEq, ::prost::Message)]
885pub struct TxBatchInfo {
886    #[prost(string, repeated, tag = "1")]
887    pub batch_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
888    #[prost(uint32, repeated, tag = "2")]
889    pub index: ::prost::alloc::vec::Vec<u32>,
890}
891/// header of the block
892#[allow(clippy::derive_partial_eq_without_eq)]
893#[derive(Clone, PartialEq, ::prost::Message)]
894pub struct BlockHeader {
895    /// block version
896    #[prost(uint32, tag = "1")]
897    pub block_version: u32,
898    /// config block or normal block or other else
899    #[prost(enumeration = "BlockType", tag = "2")]
900    pub block_type: i32,
901    /// blockchain identifier
902    #[prost(string, tag = "3")]
903    pub chain_id: ::prost::alloc::string::String,
904    /// block height
905    #[prost(uint64, tag = "4")]
906    pub block_height: u64,
907    /// block hash (block identifier)
908    #[prost(bytes = "vec", tag = "5")]
909    pub block_hash: ::prost::alloc::vec::Vec<u8>,
910    /// previous block hash
911    #[prost(bytes = "vec", tag = "6")]
912    pub pre_block_hash: ::prost::alloc::vec::Vec<u8>,
913    /// previous config block height, used to trace and check if chain config is valid
914    #[prost(uint64, tag = "7")]
915    pub pre_conf_height: u64,
916    /// count of transactions
917    #[prost(uint32, tag = "8")]
918    pub tx_count: u32,
919    /// merkle root of transactions
920    /// used to verify the existence of this transactions
921    #[prost(bytes = "vec", tag = "9")]
922    pub tx_root: ::prost::alloc::vec::Vec<u8>,
923    /// Save the DAG feature summary, and hash the DAG after Pb serialization
924    /// hash of serialized DAG
925    #[prost(bytes = "vec", tag = "10")]
926    pub dag_hash: ::prost::alloc::vec::Vec<u8>,
927    /// The root hash of Merkle tree generated by read_write_set_digest in the result of each transaction in the block
928    /// used to verify the read-write set of the block
929    #[prost(bytes = "vec", tag = "11")]
930    pub rw_set_root: ::prost::alloc::vec::Vec<u8>,
931    /// the time stamp of the block
932    #[prost(int64, tag = "12")]
933    pub block_timestamp: i64,
934    /// consensus parameters
935    /// used to store information, include in block hash calculation
936    #[prost(bytes = "vec", tag = "13")]
937    pub consensus_args: ::prost::alloc::vec::Vec<u8>,
938    /// proposal node identifier
939    #[prost(message, optional, tag = "14")]
940    pub proposer: ::core::option::Option<super::accesscontrol::Member>,
941    /// signature of proposer
942    #[prost(bytes = "vec", tag = "15")]
943    pub signature: ::prost::alloc::vec::Vec<u8>,
944}
945/// transaction execution sequence
946/// Using adjacency table storage
947#[allow(clippy::derive_partial_eq_without_eq)]
948#[derive(Clone, PartialEq, ::prost::Message)]
949pub struct Dag {
950    /// sequence number of transaction topological sort
951    /// the sequence number of the transaction topological sort associated with the transaction
952    #[prost(message, repeated, tag = "2")]
953    pub vertexes: ::prost::alloc::vec::Vec<dag::Neighbor>,
954}
955/// Nested message and enum types in `DAG`.
956pub mod dag {
957    /// Neighbor node: related transactions with reading and writing conflicts
958    #[allow(clippy::derive_partial_eq_without_eq)]
959    #[derive(Clone, PartialEq, ::prost::Message)]
960    pub struct Neighbor {
961        #[prost(uint32, repeated, tag = "1")]
962        pub neighbors: ::prost::alloc::vec::Vec<u32>,
963    }
964}
965/// BlockType specify block pack txs type
966#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
967#[repr(i32)]
968pub enum BlockType {
969    /// Normal block, pack multi txs into one block
970    NormalBlock = 0,
971    /// Config block, only include 1 chain config update tx in this block
972    ConfigBlock = 1,
973    /// Sql Contract init or upgrade block, only include 1 sql contract init or upgrade tx in this block
974    ContractMgrBlock = 2,
975    /// block.Txs\[0\] is a coinbase tx
976    HasCoinbase = 4,
977}
978impl BlockType {
979    /// String value of the enum field names used in the ProtoBuf definition.
980    ///
981    /// The values are not transformed in any way and thus are considered stable
982    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
983    pub fn as_str_name(&self) -> &'static str {
984        match self {
985            BlockType::NormalBlock => "NORMAL_BLOCK",
986            BlockType::ConfigBlock => "CONFIG_BLOCK",
987            BlockType::ContractMgrBlock => "CONTRACT_MGR_BLOCK",
988            BlockType::HasCoinbase => "HAS_COINBASE",
989        }
990    }
991    /// Creates an enum from field names used in the ProtoBuf definition.
992    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
993        match value {
994            "NORMAL_BLOCK" => Some(Self::NormalBlock),
995            "CONFIG_BLOCK" => Some(Self::ConfigBlock),
996            "CONTRACT_MGR_BLOCK" => Some(Self::ContractMgrBlock),
997            "HAS_COINBASE" => Some(Self::HasCoinbase),
998            _ => None,
999        }
1000    }
1001}
1002#[allow(clippy::derive_partial_eq_without_eq)]
1003#[derive(Clone, PartialEq, ::prost::Message)]
1004pub struct Contract {
1005    /// smart contract name, set by contract creator, can have multiple versions
1006    #[prost(string, tag = "1")]
1007    pub name: ::prost::alloc::string::String,
1008    /// smart contract version, set by contract creator, name + version should be unique
1009    #[prost(string, tag = "2")]
1010    pub version: ::prost::alloc::string::String,
1011    /// smart contract runtime type, set by contract creator
1012    #[prost(enumeration = "RuntimeType", tag = "3")]
1013    pub runtime_type: i32,
1014    /// contract status
1015    #[prost(enumeration = "ContractStatus", tag = "4")]
1016    pub status: i32,
1017    /// contract creator identity
1018    #[prost(message, optional, tag = "5")]
1019    pub creator: ::core::option::Option<super::accesscontrol::MemberFull>,
1020    /// contract address
1021    #[prost(string, tag = "6")]
1022    pub address: ::prost::alloc::string::String,
1023}
1024/// smart contract runtime, contains vm type and language type
1025#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1026#[repr(i32)]
1027pub enum RuntimeType {
1028    Invalid = 0,
1029    /// native implement in chainmaker-go
1030    Native = 1,
1031    /// vm-wasmer, language-c++
1032    Wasmer = 2,
1033    /// vm-wxvm, language-cpp
1034    Wxvm = 3,
1035    /// wasm interpreter in go
1036    Gasm = 4,
1037    /// vm-evm
1038    Evm = 5,
1039    /// vm-docker, language-golang
1040    DockerGo = 6,
1041    /// vm-java, language-java
1042    Java = 7,
1043    /// vm-go, language-go
1044    Go = 8,
1045}
1046impl RuntimeType {
1047    /// String value of the enum field names used in the ProtoBuf definition.
1048    ///
1049    /// The values are not transformed in any way and thus are considered stable
1050    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1051    pub fn as_str_name(&self) -> &'static str {
1052        match self {
1053            RuntimeType::Invalid => "INVALID",
1054            RuntimeType::Native => "NATIVE",
1055            RuntimeType::Wasmer => "WASMER",
1056            RuntimeType::Wxvm => "WXVM",
1057            RuntimeType::Gasm => "GASM",
1058            RuntimeType::Evm => "EVM",
1059            RuntimeType::DockerGo => "DOCKER_GO",
1060            RuntimeType::Java => "JAVA",
1061            RuntimeType::Go => "GO",
1062        }
1063    }
1064    /// Creates an enum from field names used in the ProtoBuf definition.
1065    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1066        match value {
1067            "INVALID" => Some(Self::Invalid),
1068            "NATIVE" => Some(Self::Native),
1069            "WASMER" => Some(Self::Wasmer),
1070            "WXVM" => Some(Self::Wxvm),
1071            "GASM" => Some(Self::Gasm),
1072            "EVM" => Some(Self::Evm),
1073            "DOCKER_GO" => Some(Self::DockerGo),
1074            "JAVA" => Some(Self::Java),
1075            "GO" => Some(Self::Go),
1076            _ => None,
1077        }
1078    }
1079}
1080/// current contract status
1081#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1082#[repr(i32)]
1083pub enum ContractStatus {
1084    /// normal, can be invoked
1085    Normal = 0,
1086    /// frozen, cannot be invoked temporarily
1087    Frozen = 1,
1088    /// revoked, cannot be invoked permanently
1089    Revoked = 2,
1090}
1091impl ContractStatus {
1092    /// String value of the enum field names used in the ProtoBuf definition.
1093    ///
1094    /// The values are not transformed in any way and thus are considered stable
1095    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1096    pub fn as_str_name(&self) -> &'static str {
1097        match self {
1098            ContractStatus::Normal => "NORMAL",
1099            ContractStatus::Frozen => "FROZEN",
1100            ContractStatus::Revoked => "REVOKED",
1101        }
1102    }
1103    /// Creates an enum from field names used in the ProtoBuf definition.
1104    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1105        match value {
1106            "NORMAL" => Some(Self::Normal),
1107            "FROZEN" => Some(Self::Frozen),
1108            "REVOKED" => Some(Self::Revoked),
1109            _ => None,
1110        }
1111    }
1112}