payload: drop Network from Extensible

It's only used to sign/verify it and is not a part of the structure. It's
still neded in consensus.Payload though because that's the way dbft library
is.
This commit is contained in:
Roman Khimov 2021-03-25 21:59:54 +03:00
parent 95c279325a
commit f91ff78918
10 changed files with 18 additions and 76 deletions

View file

@ -407,7 +407,7 @@ func TestConsensus(t *testing.T) {
p.handshaked = true
newConsensusMessage := func(start, end uint32) *Message {
pl := payload.NewExtensible(netmode.UnitTestNet)
pl := payload.NewExtensible()
pl.Category = consensus.Category
pl.ValidBlockStart = start
pl.ValidBlockEnd = end
@ -438,7 +438,7 @@ func TestConsensus(t *testing.T) {
require.Error(t, s.handleMessage(p, msg))
})
t.Run("invalid category", func(t *testing.T) {
pl := payload.NewExtensible(netmode.UnitTestNet)
pl := payload.NewExtensible()
pl.Category = "invalid"
pl.ValidBlockEnd = s.chain.BlockHeight() + 1
msg := NewMessage(CMDExtensible, pl)
@ -706,7 +706,7 @@ func TestInv(t *testing.T) {
require.Equal(t, []util.Uint256{hs[0], hs[2]}, actual)
})
t.Run("extensible", func(t *testing.T) {
ep := payload.NewExtensible(netmode.UnitTestNet)
ep := payload.NewExtensible()
s.chain.(*fakechain.FakeChain).VerifyWitnessF = func() error { return nil }
ep.ValidBlockEnd = s.chain.(*fakechain.FakeChain).BlockHeight() + 1
ok, err := s.extensiblePool.Add(ep)