diff --git a/pkg/smartcontract/parameter.go b/pkg/smartcontract/parameter.go index 06556eca1..c591f5f0d 100644 --- a/pkg/smartcontract/parameter.go +++ b/pkg/smartcontract/parameter.go @@ -360,6 +360,8 @@ func NewParameterFromValue(value interface{}) (Parameter, error) { } result.Type = ArrayType result.Value = arr + case nil: + result.Type = AnyType default: return result, fmt.Errorf("unsupported parameter %T", value) } diff --git a/pkg/smartcontract/parameter_test.go b/pkg/smartcontract/parameter_test.go index 295ed8f93..2ec7a0108 100644 --- a/pkg/smartcontract/parameter_test.go +++ b/pkg/smartcontract/parameter_test.go @@ -690,6 +690,11 @@ func TestParameterFromValue(t *testing.T) { expType: PublicKeyType, expVal: pk2.PublicKey().Bytes(), }, + { + value: nil, + expType: AnyType, + expVal: nil, + }, { value: [][]byte{{1, 2, 3}, {3, 2, 1}}, expType: ArrayType,