From 4b9024fa452d270e45faa1869332056213b5c44b Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Thu, 18 Apr 2024 13:55:05 +0300 Subject: [PATCH] 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 --- pkg/smartcontract/context/item_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/smartcontract/context/item_test.go b/pkg/smartcontract/context/item_test.go index 84ee8e540..38ee430f0 100644 --- a/pkg/smartcontract/context/item_test.go +++ b/pkg/smartcontract/context/item_test.go @@ -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)) }