Skip to content

Commit

Permalink
Define semantics for block metadata array positions
Browse files Browse the repository at this point in the history
Created an enum to define human readable semantic for
block metadata array content.

Change-Id: I0b55340c3aa720d563d87d3e2ebc7cdb1b26c8f9
Signed-off-by: Artem Barger <bartem@il.ibm.com>
  • Loading branch information
C0rWin committed Dec 8, 2016
1 parent 5c9fcc3 commit 18a8209
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 47 deletions.
4 changes: 3 additions & 1 deletion protos/common/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ func NewBlock(seqNum uint64, previousHash []byte) *Block {
block.Header.Number = seqNum
block.Header.PreviousHash = previousHash
block.Data = &BlockData{}
block.Metadata = &BlockMetadata{}
block.Metadata = &BlockMetadata{
Metadata: [][]byte{[]byte{}, []byte{}, []byte{}},
}
return block
}

Expand Down
121 changes: 75 additions & 46 deletions protos/common/common.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions protos/common/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ enum HeaderType {
ENDORSER_TRANSACTION = 3; // Used by the SDK to submit endorser based transactions
}

// This enum enlist indexes of the block metadata array
enum BlockMetadataIndex {
SIGNATURES = 0; // Block metadata array position for block signatures
LAST_CONFIGURATION = 1; // Block metadata array poistion to store last configuration block sequence number
TRANSACTIONS_FILTER = 2; // Block metadata array poistion to store serialized bit array filter of invalid transactions
}

message Header {
ChainHeader chainHeader = 1;
SignatureHeader signatureHeader = 2;
Expand Down

0 comments on commit 18a8209

Please sign in to comment.