Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lg/docs fix #269

Merged
merged 4 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/builtins/Capabilities/install-capability.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ When the capability is brought into scope, its management function is invoked to

The management function takes the type of the managed parameter, executes the logic required to validate the requested capability or perform the managed operation, and returns the new managed value that results from the request.

The type signature for the management function is `managed:<p> requested:<p> -> <p>`, where `<p>` indicates the type of the managed parameter.
The type signature for the management function is `managed:<type> requested:<type> -> <type>`, where `<type>` indicates the type of the managed parameter.
For example, assume you define a managed capability as:

```pact
Expand Down
2 changes: 1 addition & 1 deletion docs/builtins/Database/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Use the following arguments to specify the table, columns, and `where` clause fo
| --- | --- | --- |
| `table` | `table: <{row}>` | Specifies the table from which to select rows matching the where clause. |
| `columns` | [string] | Specifies the list of columns to select from the table matching the where clause (optional). |
| `where` | row:object:<{row}> | Specifies the `where` clause to apply to each row to determine inclusion. |
| `where` | `row:object:<{row}>` | Specifies the `where` clause to apply to each row to determine inclusion. |

### Return value

Expand Down
2 changes: 1 addition & 1 deletion docs/builtins/Database/with-default-read.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Use the following arguments to specify the table, key, defaults, bindings, and b
| `table` | `table: <{row}>` | Specifies the table from which to read the row. |
| `key` | string | Specifies the key for which to read the row. |
| `default` | object | Specifies a default object containing values for missing columns. |
| `bindings` | binding:<{row}> | Specifies the bindings for columns to be bound. |
| `bindings` | `binding:<{row}> `| Specifies the bindings for columns to be bound. |
| `body` | any | Specifies the subsequent body statements to be executed. |

### Return value
Expand Down
2 changes: 1 addition & 1 deletion docs/builtins/General/acquire-module-admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ It will attempt to acquire the governance cap and if successful, it will grant m

### Return values

Module admin acquisition will either fail, or return "Module admin for module <my-module> acquired"
Module admin acquisition will either fail, or return "Module admin for module `<my-module>` acquired"

### Examples

Expand Down
14 changes: 11 additions & 3 deletions docs/builtins/General/enforce.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,21 @@ The `enforce` function returns `true` if the specified `expression` is true. If

### Examples

The following example demonstrates how to use the `enforce` function to evaluate the expression `(+ 2 2) != 4`:
The following example demonstrates how to use the `enforce` function to evaluate the expression `(+ 2 2) = 4`:

```pact
pact> (enforce (= (+ 2 2) 4) "All is well")
true
```

Because the specified expression (`4 = 4`) is true, the function returns true and the transaction continues.
Because the specified expression (`2 + 2 = 4`) is true, the function returns true and the transaction continues.

If the expression were false, the transaction would fail with the error message "Chaos reigns". The `enforce` function provides a way to ensure conditions are met within a transaction.
The following example demonstrates how to use the `enforce` function to evaluate the expression `(2 + 2) != 4`:

```pact
pact> (enforce (!= (+ 2 2) 4) "The expression is false")
The expression is false
at <interactive>:0:0: (enforce (native `!=` True if X does not equal Y. Type: x... "The expression is false")
```

Because the expression is false, the transaction fails with the error message specified.
2 changes: 1 addition & 1 deletion docs/builtins/General/where.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Use the following arguments to specify the field, application function, and valu
| --- | --- | --- |
| `field` | string | Specifies the field in the value to be evaluated. |
| `app` | function | Specifies the application function to be applied to the field. |
| `value` | object:<{row}> | Specifies the value containing the field to be evaluated. |
| `value` | `object:<{row}>` | Specifies the value containing the field to be evaluated. |

### Return value

Expand Down
2 changes: 1 addition & 1 deletion docs/builtins/Operators/leq.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## less-than-equal (<=)
## less-than-equal (`<=`)

Use `<=` to return true if the first `oper1` argument is less than or equal to the second `oper2` argument.

Expand Down
2 changes: 1 addition & 1 deletion docs/builtins/Operators/lt.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## less-than (<)
## less-than (`<`)

Use `<` to return true if the first `oper1` argument is less than the second `oper2` argument.

Expand Down
4 changes: 3 additions & 1 deletion docs/builtins/Repl/env-sigs.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ The following example demonstrates how to use the `env-sigs` function to set two

The following example illustrates using the `env-sigs` function to grant "any" key the MINT capability:

```pact
(env-sigs [
{ 'key: 'any
,'caps: [(MINT (read-msg "token-id") (read-string 'account) 1.0)]}
])
])
```
2 changes: 2 additions & 0 deletions docs/builtins/Repl/expect.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pact> (expect "Sanity prevails." 4 (+ 2 2))

The following example illustrates using the `expect` function to verify that the information expected to be inserted into a table is the same as the result of the `get-token-info` function:

```pact
(expect "Token info is inserted into table"
{ "id": "t:YV6-cQBhE_EoIXAuNV08aGXLfcucBEGy0Gb1Pj6w_Oo"
,"supply": 0.0
Expand All @@ -44,3 +45,4 @@ The following example illustrates using the `expect` function to verify that the
}
(get-token-info "t:YV6-cQBhE_EoIXAuNV08aGXLfcucBEGy0Gb1Pj6w_Oo")
)
```
Loading