From dc18d3a7c8af808781aa9e04dfd247bc6b6ac4f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Thu, 31 Aug 2023 00:32:24 +0300 Subject: [PATCH] Fix after self-review. --- src/smartcontracts/nativeSerializer.spec.ts | 2 +- src/smartcontracts/nativeSerializer.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/smartcontracts/nativeSerializer.spec.ts b/src/smartcontracts/nativeSerializer.spec.ts index 61933ff4..eb104c47 100644 --- a/src/smartcontracts/nativeSerializer.spec.ts +++ b/src/smartcontracts/nativeSerializer.spec.ts @@ -46,7 +46,7 @@ describe("test native serializer", () => { assert.deepEqual(typedValues[6].valueOf(), null); }); - it("should perform type inference (variadic arguments)", async () => { + it("should perform type inference (regular variadic arguments)", async () => { const endpointModifiers = new EndpointModifiers("", []); const inputParameters = [new EndpointParameterDefinition("", "", new VariadicType(new U32Type(), false))]; const endpoint = new EndpointDefinition("foo", inputParameters, [], endpointModifiers); diff --git a/src/smartcontracts/nativeSerializer.ts b/src/smartcontracts/nativeSerializer.ts index 7b214dbf..120a5fef 100644 --- a/src/smartcontracts/nativeSerializer.ts +++ b/src/smartcontracts/nativeSerializer.ts @@ -159,7 +159,7 @@ export namespace NativeSerializer { function toVariadicValue(native: any, type: VariadicType, errorContext: ArgumentErrorContext): TypedValue { if (type.isCounted) { - throw new ErrInvalidArgument(`Counted variadic arguments must be explicitly typed. E.g. use "VariadicValue.fromItemsCounted()"`); + throw new ErrInvalidArgument(`Counted variadic arguments must be explicitly typed. E.g. use "VariadicValue.fromItemsCounted()" or "new VariadicValue()"`); } if (native == null) {