state: add a test for NEP5Transfer size

It's size is used in NEP5TransferLog so we need to be
sure it reflects reality.
This commit is contained in:
Evgenii Stratonikov 2020-03-05 20:46:29 +03:00
parent 3f1e8f66b6
commit ebf867b11d

View file

@ -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()),