Merge pull request #859 from nspcc-dev/neo3/partial_consensus_message_decoding

consensus: added partial message decoding
This commit is contained in:
Roman Khimov 2020-04-16 16:58:59 +03:00 committed by GitHub
commit e150bd7bb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 63 additions and 17 deletions

View file

@ -42,6 +42,7 @@ func TestService_GetVerified(t *testing.T) {
hashes := []util.Uint256{txs[0].Hash(), txs[1].Hash(), txs[2].Hash()}
p := new(Payload)
p.message = &message{}
p.SetType(payload.PrepareRequestType)
p.SetPayload(&prepareRequest{transactionHashes: hashes, minerTx: *transaction.NewMinerTXWithNonce(999)})
p.SetValidatorIndex(1)
@ -77,6 +78,7 @@ func TestService_ValidatePayload(t *testing.T) {
srv := newTestService(t)
priv, _ := getTestValidator(1)
p := new(Payload)
p.message = &message{}
p.SetPayload(&prepareRequest{})
@ -141,6 +143,7 @@ func TestService_OnPayload(t *testing.T) {
priv, _ := getTestValidator(1)
p := new(Payload)
p.message = &message{}
p.SetValidatorIndex(1)
p.SetPayload(&prepareRequest{})