block/transaction: add network magic into the hash

We make it explicit in the appropriate Block/Transaction structures, not via a
singleton as C# node does. I think this approach has a bit more potential and
allows better packages reuse for different purposes.
This commit is contained in:
Roman Khimov 2020-06-18 12:00:51 +03:00
parent 8fda6a3407
commit b483c38593
39 changed files with 244 additions and 144 deletions

View file

@ -78,7 +78,7 @@ func getTX(t *testing.B, wif *keys.WIF) *transaction.Transaction {
fromAddressHash, err := address.StringToUint160(fromAddress)
require.NoError(t, err)
tx := transaction.New([]byte{0x51}, 1)
tx := transaction.New(netmode.UnitTestNet, []byte{0x51}, 1)
tx.Version = 0
tx.Sender = fromAddressHash
tx.Attributes = append(tx.Attributes,