[cli] add consensus field to the block header info
@@ -4,11 +4,12 @@ import (
"encoding/json"
"errors"
"fmt"
- "github.com/aergoio/aergo/p2p/p2putil"
"math/big"
"strconv"
"time"
+ "github.com/aergoio/aergo/p2p/p2putil"
+
"github.com/aergoio/aergo/types"
"github.com/mr-tron/base58/base58"
)
@@ -25,6 +26,7 @@ type InOutBlockHeader struct {
PubKey string
Sign string
CoinbaseAccount string
+ Consensus string
}
type InOutBlockBody struct {
@@ -233,6 +235,10 @@ func ConvBlock(b *types.Block) *InOutBlock {
if b.GetHeader().GetCoinbaseAccount() != nil {
out.Header.CoinbaseAccount = types.EncodeAddress(b.GetHeader().GetCoinbaseAccount())
}
+ if consensus := b.GetHeader().GetConsensus(); consensus != nil {
+ out.Header.Consensus = types.EncodeAddress(consensus)
+ }
+
if b.Body != nil {
for _, tx := range b.Body.Txs {
out.Body.Txs = append(out.Body.Txs, ConvTx(tx))
