mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 23:02:27 +00:00
core: change block.ConsensusData to neo3 format
1. Dropped `Base.ConsensusData` block field 2. Added `Block.ConsensusData` field with `Nonce` and `PrimaryIndex` 3. Removed "Neo.Header.GetConsensusData" and "AntShares.Header.GetConsensusData" interops
This commit is contained in:
parent
0de5cb1bde
commit
55fd9f8d24
18 changed files with 196 additions and 109 deletions
|
@ -9,7 +9,6 @@ import (
|
|||
"net/http"
|
||||
"net/http/httptest"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
@ -967,7 +966,6 @@ func TestRPC(t *testing.T) {
|
|||
MerkleRoot: hdr.MerkleRoot,
|
||||
Timestamp: hdr.Timestamp,
|
||||
Index: hdr.Index,
|
||||
Nonce: strconv.FormatUint(hdr.ConsensusData, 16),
|
||||
NextConsensus: address.Uint160ToString(hdr.NextConsensus),
|
||||
Script: hdr.Script,
|
||||
Confirmations: e.chain.BlockHeight() - hdr.Index + 1,
|
||||
|
@ -1051,10 +1049,13 @@ func newBlock(t *testing.T, bc blockchainer.Blockchainer, index uint32, txs ...*
|
|||
PrevHash: hdr.Hash(),
|
||||
Timestamp: (uint64(time.Now().UTC().Unix()) + uint64(hdr.Index)) * 1000,
|
||||
Index: hdr.Index + index,
|
||||
ConsensusData: 1111,
|
||||
NextConsensus: witness.ScriptHash(),
|
||||
Script: witness,
|
||||
},
|
||||
ConsensusData: block.ConsensusData{
|
||||
PrimaryIndex: 0,
|
||||
Nonce: 1111,
|
||||
},
|
||||
Transactions: txs,
|
||||
}
|
||||
_ = b.RebuildMerkleRoot()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue