From b20bd412e3b03c9ca395bff4a718b1a4b10dfe75 Mon Sep 17 00:00:00 2001 From: Aaron Blankstein Date: Tue, 11 Jun 2019 13:25:17 -0500 Subject: [PATCH] add test case for single argument to filter, correct SIP language. --- sip/sip-002-smart-contract-language.md | 2 +- src/vm/tests/lists.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sip/sip-002-smart-contract-language.md b/sip/sip-002-smart-contract-language.md index f4c83b389..8e20040e3 100644 --- a/sip/sip-002-smart-contract-language.md +++ b/sip/sip-002-smart-contract-language.md @@ -90,7 +90,7 @@ functions created with `define-read-only` may return any type. be charged based on the _maximal_ size of the multi-dimensional list. * `filter` `map` and `fold` functions may only be called with user-defined functions (i.e., functions defined with `(define ...)`, `(define-read-only ...)`, or - `(define-public ...)` + `(define-public ...)`) or simple native functions (e.g., `+`, `-`, `not`). * Functions that return lists of a different size than the input size (e.g., `(append-item ...)`) take a required _constant_ parameter that indicates the maximum output size of the function. This is enforced with a runtime check. diff --git a/src/vm/tests/lists.rs b/src/vm/tests/lists.rs index d66ef3343..35d9c1e23 100644 --- a/src/vm/tests/lists.rs +++ b/src/vm/tests/lists.rs @@ -67,6 +67,7 @@ fn test_simple_filter() { let bad_tests = [ "(filter 123 (list 123))", // must have function name supplied "(filter not (list 123) 3)", // must be 2 args + "(filter +)", // must be 2 args "(filter not 'false)", // must supply list "(filter - (list 1 2 3))"]; // must return bool