From ebf867b11d06eb9f775fd5abe94b46837ae7c420 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 5 Mar 2020 20:46:29 +0300 Subject: [PATCH] state: add a test for NEP5Transfer size It's size is used in NEP5TransferLog so we need to be sure it reflects reality. --- pkg/core/state/nep5_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/core/state/nep5_test.go b/pkg/core/state/nep5_test.go index 03cf14e57..b4e70f5ea 100644 --- a/pkg/core/state/nep5_test.go +++ b/pkg/core/state/nep5_test.go @@ -58,6 +58,12 @@ func TestNEP5Transfer_DecodeBinary(t *testing.T) { testEncodeDecode(t, expected, new(NEP5Transfer)) } +func TestNEP5TransferSize(t *testing.T) { + tr := randomTransfer(t, rand.New(rand.NewSource(0))) + size := io.GetVarSize(tr) + require.EqualValues(t, NEP5TransferSize, size) +} + func randomTransfer(t *testing.T, r *rand.Rand) *NEP5Transfer { tr := &NEP5Transfer{ Amount: int64(r.Uint64()),