[CLI] update to show chain ID in block header
@@ -42,14 +42,17 @@ type InOutTxInBlock struct {
}
type InOutBlockHeader struct {
+ ChainID string
PrevBlockHash string
BlockNo uint64
Timestamp int64
BlockRootHash string
TxRootHash string
+ ReceiptsRootHash string
Confirms uint64
PubKey string
Sign string
+ CoinbaseAccount string
}
type InOutBlockBody struct {
@@ -209,13 +212,17 @@ func ConvBlock(b *types.Block) *InOutBlock {
out := &InOutBlock{}
if b != nil {
out.Hash = base58.Encode(b.Hash)
+ out.Header.ChainID = base58.Encode(b.GetHeader().GetChainID())
out.Header.PrevBlockHash = base58.Encode(b.GetHeader().GetPrevBlockHash())
out.Header.BlockNo = b.GetHeader().GetBlockNo()
out.Header.Timestamp = b.GetHeader().GetTimestamp()
+ out.Header.BlockRootHash = base58.Encode(b.GetHeader().GetBlocksRootHash())
out.Header.TxRootHash = base58.Encode(b.GetHeader().GetTxsRootHash())
+ out.Header.ReceiptsRootHash = base58.Encode(b.GetHeader().GetReceiptsRootHash())
out.Header.Confirms = b.GetHeader().GetConfirms()
out.Header.PubKey = base58.Encode(b.GetHeader().GetPubKey())
out.Header.Sign = base58.Encode(b.GetHeader().GetSign())
+ out.Header.CoinbaseAccount = base58.Encode(b.GetHeader().GetCoinbaseAccount())
if b.Body != nil {
for _, tx := range b.Body.Txs {
out.Body.Txs = append(out.Body.Txs, ConvTx(tx))
