smartcontract: ensure nil ParameterContext Item's script is marshallable

Ensure that ParameterContext's Item with nil script can be properly
marshalled. Ref. https://github.com/neo-project/neo/pull/3198.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
Anna Shaleva 2024-04-18 13:55:05 +03:00
parent 1786136a23
commit 4b9024fa45

View file

@ -51,4 +51,8 @@ func TestContextItem_MarshalJSON(t *testing.T) {
}
testserdes.MarshalUnmarshalJSON(t, expected, new(Item))
// Empty script.
expected.Script = nil
testserdes.MarshalUnmarshalJSON(t, expected, new(Item))
}