Update bsip-0040.md

bsip53
Stefan Schießl 2018-07-28 23:31:57 +02:00 committed by GitHub
parent 55aa5b04eb
commit ef397f0be1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 5 deletions

View File

@ -77,18 +77,28 @@ List of possible asserts are:
| function | data | state |
| ------------- |:-------------:| -----:|
| `any` | [`list`, `of`, `allowed`, `values`] | stateless |
| `range` | [`min`, `max`] | stateless |
| `none` | [`none`, `of`, `these`, `values`] | stateless |
| `lt, le, gt, ge` | `comparative` | stateless |
| `length` | [`min`, `max`] | stateless |
| `limit` | [`max_cumsum`, `interval_in_sec`] | [`current_cumsum`, `interval_began`] |
| `limit_monthly` | [`max_cumsum`, `interval_in_months`] | [`current_cumsum`, `interval_began`] |
All asserts apply to `int`, `string` and `object_ids`. There is no type converstion, incompatible type means assert failure. Any more sophisticated data types are not included yet.
#### `any`
Stateless assert, all argument types. Value of argument must be equal to one of values in the list
In the following we list possible `asserts`. Mentioning `argument value` refers to the value of the argument of the operation specified `argument` in `assert_object`.
#### `range`
Stateless assert, only `int` type arguments. Value must be inbetween `min` and `max`, inclusive. One of the bounds can be empty to indicate unlimited.
#### `any`
Stateless assert, all argument types. `Argument value` must be equal to one of values in the data list
#### `none`
Stateless assert, all argument types. `Argument value` must NOT be equal to any of the values in the list.
#### `lt, le, gt, ge`
Stateless assert, only `int` type arguments.
- `lt`: `Argument value` must be less than `comparitive`
- `lt`: `Argument value` must be less than or equal to `comparitive`
- `lt`: `Argument value` must be greater than `comparitive`
- `lt`: `Argument value` must be greater than or equal to `comparitive`
#### `length`
Stateless assert, only `string` type arguments. Length of string (or encrypted string in case of memo) must be within `min` and `max`, inclusive. One of the bounds can be empty to indicate unlimited.