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:
parent
3f1e8f66b6
commit
ebf867b11d
1 changed files with 6 additions and 0 deletions
|
@ -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()),
|
||||
|
|
Loading…
Reference in a new issue