Skip to content

Commit 51551f6

Browse files
author
Kevin Zhang
committed
update file format
1 parent 5495754 commit 51551f6

1 file changed

Lines changed: 23 additions & 22 deletions

File tree

eos/eos.block.data.structure.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ block_extensions则定义了一系列的扩展信息,这些信息都由一个
3939
```c++
4040
// ..../eos/libraries/chain/include/eosio/chain/block.hpp
4141
struct transaction_receipt_header {
42-
// 定义交易状态的枚举类型
43-
enum status_enum {
42+
// 定义交易状态的枚举类型
43+
enum status_enum {
4444
// 这个表示执行成功(所以不需要执行出错逻辑)
4545
executed = 0,
4646
// 客观的来说,执行失败了(或者没有执行),某一个出错逻辑执行了
@@ -51,18 +51,18 @@ struct transaction_receipt_header {
5151
delayed = 3,
5252
// 交易过期了,并且存储空间返还给用户
5353
expired = 4 ///< transaction expired and storage space refuned to user
54-
};
55-
56-
// 状态数据
57-
fc::enum_type<uint8_t,status_enum> status;
58-
// CPU使用情况
59-
uint32_t cpu_usage_us;
60-
// 网络使用情况
61-
fc::unsigned_int net_usage_words;
54+
};
55+
56+
// 状态数据
57+
fc::enum_type<uint8_t,status_enum> status;
58+
// CPU使用情况
59+
uint32_t cpu_usage_us;
60+
// 网络使用情况
61+
fc::unsigned_int net_usage_words;
6262
};
6363
6464
struct transaction_receipt : public transaction_receipt_header {
65-
fc::static_variant<transaction_id_type, packed_transaction> trx;
65+
fc::static_variant<transaction_id_type, packed_transaction> trx;
6666
};
6767
```
6868

@@ -73,21 +73,22 @@ packed_transaction,顾名思义,就是把交易数据打包了,这个结
7373
```c++
7474
// ..../eos/libraries/chain/include/eosio/chain/transaction.hpp
7575
struct packed_transaction {
76-
// 定义打包数据是否压缩的枚举类型
77-
enum compression_type {
76+
// 定义打包数据是否压缩的枚举类型
77+
enum compression_type {
7878
// 没有压缩
7979
none = 0,
8080
// 使用zlib压缩
8181
zlib = 1,
82-
};
83-
// 签名信息
84-
vector<signature_type> signatures;
85-
// 是否压缩的标识信息
86-
fc::enum_type<uint8_t,compression_type> compression;
87-
// 上下文无关的信息
88-
bytes packed_context_free_data;
89-
// 打包后的交易数据
90-
bytes packed_trx;
82+
};
83+
84+
// 签名信息
85+
vector<signature_type> signatures;
86+
// 是否压缩的标识信息
87+
fc::enum_type<uint8_t,compression_type> compression;
88+
// 上下文无关的信息
89+
bytes packed_context_free_data;
90+
// 打包后的交易数据
91+
bytes packed_trx;
9192
}
9293
```
9394

0 commit comments

Comments
 (0)