From aebe14d75f7cfe157423ce664ce148bfaed3ddef Mon Sep 17 00:00:00 2001 From: Nex Date: Wed, 12 Dec 2018 11:03:52 +0800 Subject: [PATCH] Change Block.witness to witnesses in TxLedger --- bdchain/api/tx_ledger.proto | 2 +- test.md | 57 +++++++++++++++++++++++++++++-------- 2 files changed, 46 insertions(+), 13 deletions(-) diff --git a/bdchain/api/tx_ledger.proto b/bdchain/api/tx_ledger.proto index 10b6b55..389b2e9 100644 --- a/bdchain/api/tx_ledger.proto +++ b/bdchain/api/tx_ledger.proto @@ -37,7 +37,7 @@ message Block { uint64 index = 1; // 事务链本地区块索引,当区块处于待确认状态时为`null` bytes hash = 2; // 区块的哈希,当区块处于待确认状态时为`null` repeated bytes parent_hashes = 3; // 父区块的哈希 - bytes witness = 4; // 见证者账户地址 + repeated bytes witnesses = 4; // 见证者账户地址 uint64 timestamp = 5; // 区块产生时的UNIX时间戳 uint64 size = 6; // 区块大小的字节数 bytes transactions_root = 7; // 区块的事务树根 diff --git a/test.md b/test.md index 66a81e5..b54009c 100644 --- a/test.md +++ b/test.md @@ -64,7 +64,7 @@ message Block { uint64 index = 1; // 事务链本地区块索引,当区块处于待确认状态时为`null` bytes hash = 2; // 区块的哈希,当区块处于待确认状态时为`null` repeated bytes parent_hashes = 3; // 父区块的哈希 - bytes witness = 4; // 见证者账户地址 + bytes witnesses = 4; // 见证者账户地址 uint64 timestamp = 5; // 区块产生时的UNIX时间戳 uint64 size = 6; // 区块大小的字节数 bytes transactions_root = 7; // 区块的事务树根 @@ -308,7 +308,10 @@ blocks: - 0x0404040404040404040404040404040404040404 (in bytes) - 0x1313131313131313131313131313131313131313 (in bytes) - 0x5252525252525252525252525252525252525252 (in bytes) - witness: 0x1fee1bad1fee1bad1fee1bad1fee1bad1fee1bad (in bytes) + witnesses: + - 0x0404040404040404040404040404040404040404 (in bytes) + - 0x1313131313131313131313131313131313131313 (in bytes) + - 0x5252525252525252525252525252525252525252 (in bytes) timestamp: 2018050400000 size: 20180504 transactions_root: 0x50bada5550bada5550bada5550bada5550bada55 (in bytes) @@ -355,7 +358,10 @@ blocks: - 0x0404040404040404040404040404040404040404 (in bytes) - 0x1313131313131313131313131313131313131313 (in bytes) - 0x5252525252525252525252525252525252525252 (in bytes) - witness: 0x1fee1bad1fee1bad1fee1bad1fee1bad1fee1bad (in bytes) + witnesses: + - 0x0404040404040404040404040404040404040404 (in bytes) + - 0x1313131313131313131313131313131313131313 (in bytes) + - 0x5252525252525252525252525252525252525252 (in bytes) timestamp: 2018050400000 size: 20180504 transactions_root: 0x50bada5550bada5550bada5550bada5550bada55 (in bytes) @@ -369,7 +375,10 @@ blocks: - 0x0404040404040404040404040404040404040404 (in bytes) - 0x1313131313131313131313131313131313131313 (in bytes) - 0x5252525252525252525252525252525252525252 (in bytes) - witness: 0x1fee1bad1fee1bad1fee1bad1fee1bad1fee1bad (in bytes) + witnesses: + - 0x0404040404040404040404040404040404040404 (in bytes) + - 0x1313131313131313131313131313131313131313 (in bytes) + - 0x5252525252525252525252525252525252525252 (in bytes) timestamp: 2018050400000 size: 20180504 transactions_root: 0x50bada5550bada5550bada5550bada5550bada55 (in bytes) @@ -383,7 +392,10 @@ blocks: - 0x0404040404040404040404040404040404040404 (in bytes) - 0x1313131313131313131313131313131313131313 (in bytes) - 0x5252525252525252525252525252525252525252 (in bytes) - witness: 0x1fee1bad1fee1bad1fee1bad1fee1bad1fee1bad (in bytes) + witnesses: + - 0x0404040404040404040404040404040404040404 (in bytes) + - 0x1313131313131313131313131313131313131313 (in bytes) + - 0x5252525252525252525252525252525252525252 (in bytes) timestamp: 2018050400000 size: 20180504 transactions_root: 0x50bada5550bada5550bada5550bada5550bada55 (in bytes) @@ -397,7 +409,10 @@ blocks: - 0x0404040404040404040404040404040404040404 (in bytes) - 0x1313131313131313131313131313131313131313 (in bytes) - 0x5252525252525252525252525252525252525252 (in bytes) - witness: 0x1fee1bad1fee1bad1fee1bad1fee1bad1fee1bad (in bytes) + witnesses: + - 0x0404040404040404040404040404040404040404 (in bytes) + - 0x1313131313131313131313131313131313131313 (in bytes) + - 0x5252525252525252525252525252525252525252 (in bytes) timestamp: 2018050400000 size: 20180504 transactions_root: 0x50bada5550bada5550bada5550bada5550bada55 (in bytes) @@ -411,7 +426,10 @@ blocks: - 0x0404040404040404040404040404040404040404 (in bytes) - 0x1313131313131313131313131313131313131313 (in bytes) - 0x5252525252525252525252525252525252525252 (in bytes) - witness: 0x1fee1bad1fee1bad1fee1bad1fee1bad1fee1bad (in bytes) + witnesses: + - 0x0404040404040404040404040404040404040404 (in bytes) + - 0x1313131313131313131313131313131313131313 (in bytes) + - 0x5252525252525252525252525252525252525252 (in bytes) timestamp: 2018050400000 size: 20180504 transactions_root: 0x50bada5550bada5550bada5550bada5550bada55 (in bytes) @@ -425,7 +443,10 @@ blocks: - 0x0404040404040404040404040404040404040404 (in bytes) - 0x1313131313131313131313131313131313131313 (in bytes) - 0x5252525252525252525252525252525252525252 (in bytes) - witness: 0x1fee1bad1fee1bad1fee1bad1fee1bad1fee1bad (in bytes) + witnesses: + - 0x0404040404040404040404040404040404040404 (in bytes) + - 0x1313131313131313131313131313131313131313 (in bytes) + - 0x5252525252525252525252525252525252525252 (in bytes) timestamp: 2018050400000 size: 20180504 transactions_root: 0x50bada5550bada5550bada5550bada5550bada55 (in bytes) @@ -439,7 +460,10 @@ blocks: - 0x0404040404040404040404040404040404040404 (in bytes) - 0x1313131313131313131313131313131313131313 (in bytes) - 0x5252525252525252525252525252525252525252 (in bytes) - witness: 0x1fee1bad1fee1bad1fee1bad1fee1bad1fee1bad (in bytes) + witnesses: + - 0x0404040404040404040404040404040404040404 (in bytes) + - 0x1313131313131313131313131313131313131313 (in bytes) + - 0x5252525252525252525252525252525252525252 (in bytes) timestamp: 2018050400000 size: 20180504 transactions_root: 0x50bada5550bada5550bada5550bada5550bada55 (in bytes) @@ -453,7 +477,10 @@ blocks: - 0x0404040404040404040404040404040404040404 (in bytes) - 0x1313131313131313131313131313131313131313 (in bytes) - 0x5252525252525252525252525252525252525252 (in bytes) - witness: 0x1fee1bad1fee1bad1fee1bad1fee1bad1fee1bad (in bytes) + witnesses: + - 0x0404040404040404040404040404040404040404 (in bytes) + - 0x1313131313131313131313131313131313131313 (in bytes) + - 0x5252525252525252525252525252525252525252 (in bytes) timestamp: 2018050400000 size: 20180504 transactions_root: 0x50bada5550bada5550bada5550bada5550bada55 (in bytes) @@ -467,7 +494,10 @@ blocks: - 0x0404040404040404040404040404040404040404 (in bytes) - 0x1313131313131313131313131313131313131313 (in bytes) - 0x5252525252525252525252525252525252525252 (in bytes) - witness: 0x1fee1bad1fee1bad1fee1bad1fee1bad1fee1bad (in bytes) + witnesses: + - 0x0404040404040404040404040404040404040404 (in bytes) + - 0x1313131313131313131313131313131313131313 (in bytes) + - 0x5252525252525252525252525252525252525252 (in bytes) timestamp: 2018050400000 size: 20180504 transactions_root: 0x50bada5550bada5550bada5550bada5550bada55 (in bytes) @@ -481,7 +511,10 @@ blocks: - 0x0404040404040404040404040404040404040404 (in bytes) - 0x1313131313131313131313131313131313131313 (in bytes) - 0x5252525252525252525252525252525252525252 (in bytes) - witness: 0x1fee1bad1fee1bad1fee1bad1fee1bad1fee1bad (in bytes) + witnesses: + - 0x0404040404040404040404040404040404040404 (in bytes) + - 0x1313131313131313131313131313131313131313 (in bytes) + - 0x5252525252525252525252525252525252525252 (in bytes) timestamp: 2018050400000 size: 20180504 transactions_root: 0x50bada5550bada5550bada5550bada5550bada55 (in bytes)