diff --git a/pkg/core/block/block.go b/pkg/core/block/block.go index 32215098b..3e451258f 100644 --- a/pkg/core/block/block.go +++ b/pkg/core/block/block.go @@ -229,6 +229,7 @@ func (b *Block) ToStackItem() stackitem.Item { stackitem.NewBigInteger(big.NewInt(int64(b.Timestamp))), stackitem.NewBigInteger(new(big.Int).SetUint64(b.Nonce)), stackitem.NewBigInteger(big.NewInt(int64(b.Index))), + stackitem.NewBigInteger(big.NewInt(int64(b.PrimaryIndex))), stackitem.NewByteArray(b.NextConsensus.BytesBE()), stackitem.NewBigInteger(big.NewInt(int64(len(b.Transactions)))), } diff --git a/pkg/core/native/native_test/ledger_test.go b/pkg/core/native/native_test/ledger_test.go index a7d878aef..308120b21 100644 --- a/pkg/core/native/native_test/ledger_test.go +++ b/pkg/core/native/native_test/ledger_test.go @@ -159,6 +159,7 @@ func TestLedger_GetBlock(t *testing.T) { stackitem.NewBigInteger(big.NewInt(int64(b.Timestamp))), stackitem.NewBigInteger(big.NewInt(int64(b.Nonce))), stackitem.NewBigInteger(big.NewInt(int64(b.Index))), + stackitem.NewBigInteger(big.NewInt(int64(b.PrimaryIndex))), stackitem.NewByteArray(b.NextConsensus.BytesBE()), stackitem.NewBigInteger(big.NewInt(int64(len(b.Transactions)))), } diff --git a/pkg/interop/native/ledger/block.go b/pkg/interop/native/ledger/block.go index 0164803cb..58c88521a 100644 --- a/pkg/interop/native/ledger/block.go +++ b/pkg/interop/native/ledger/block.go @@ -23,6 +23,8 @@ type Block struct { Nonce int // Index represents the height of the block. Index int + // PrimaryIndex represents the index of the primary node that created this block. + PrimaryIndex int // NextConsensus represents the contract address of the next miner (160 bit BE // value in a 20 byte slice). NextConsensus interop.Hash160 @@ -43,6 +45,7 @@ type BlockSR struct { Timestamp int Nonce int Index int + PrimaryIndex int NextConsensus interop.Hash160 TransactionsLength int // PrevStateRoot is a hash of the previous block's state root.