Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into pool-abi
Browse files Browse the repository at this point in the history
  • Loading branch information
awrichar committed Jan 5, 2023
2 parents 8a9225a + f1b10e9 commit d6f6387
Show file tree
Hide file tree
Showing 48 changed files with 37,706 additions and 305 deletions.
2 changes: 1 addition & 1 deletion db/migrations/postgres/000044_add_tokenpool_state.up.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BEGIN;
ALTER TABLE tokenpool ADD COLUMN state VARCHAR(64);
UPDATE tokenpool SET state='unknown';
UPDATE tokenpool SET state='confirmed';
ALTER TABLE tokenpool ALTER COLUMN state SET NOT NULL;
COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BEGIN;
DROP TABLE IF EXISTS ffierrors;
COMMIT;
14 changes: 14 additions & 0 deletions db/migrations/postgres/000103_create_ffi_errors_table.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
BEGIN;
CREATE TABLE ffierrors (
seq SERIAL PRIMARY KEY,
id UUID NOT NULL,
interface_id UUID NULL,
namespace VARCHAR(64) NOT NULL,
name VARCHAR(1024) NOT NULL,
pathname VARCHAR(1024) NOT NULL,
description TEXT NOT NULL,
params TEXT NOT NULL
);

CREATE UNIQUE INDEX ffierrors_pathname ON ffierrors(interface_id,pathname);
COMMIT;
2 changes: 1 addition & 1 deletion db/migrations/sqlite/000044_add_tokenpool_state.up.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ALTER TABLE tokenpool ADD COLUMN state VARCHAR(64);
UPDATE tokenpool SET state="unknown";
UPDATE tokenpool SET state="confirmed";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE IF EXISTS ffierrors;
12 changes: 12 additions & 0 deletions db/migrations/sqlite/000103_create_ffi_errors_table.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CREATE TABLE ffierrors (
seq INTEGER PRIMARY KEY AUTOINCREMENT,
id UUID NOT NULL,
interface_id UUID NULL,
namespace VARCHAR(64) NOT NULL,
name VARCHAR(1024) NOT NULL,
pathname VARCHAR(1024) NOT NULL,
description TEXT NOT NULL,
params TEXT NOT NULL
);

CREATE UNIQUE INDEX ffierrors_pathname ON ffierrors(interface_id,pathname);
23 changes: 23 additions & 0 deletions docs/reference/types/ffi.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ nav_order: 8
| `version` | A version for the FFI - use of semantic versioning such as 'v1.0.1' is encouraged | `string` |
| `methods` | An array of smart contract method definitions | [`FFIMethod[]`](#ffimethod) |
| `events` | An array of smart contract event definitions | [`FFIEvent[]`](#ffievent) |
| `errors` | An array of smart contract error definitions | [`FFIError[]`](#ffierror) |

## FFIMethod

Expand Down Expand Up @@ -172,3 +173,25 @@ nav_order: 8



## FFIError

| Field Name | Description | Type |
|------------|-------------|------|
| `id` | The UUID of the FFI error definition | [`UUID`](simpletypes#uuid) |
| `interface` | The UUID of the FFI smart contract definition that this error is part of | [`UUID`](simpletypes#uuid) |
| `namespace` | The namespace of the FFI | `string` |
| `pathname` | The unique name allocated to this error within the FFI for use on URL paths | `string` |
| `signature` | The stringified signature of the error, as computed by the blockchain plugin | `string` |
| `name` | The name of the error | `string` |
| `description` | A description of the smart contract error | `string` |
| `params` | An array of error parameter/argument definitions | [`FFIParam[]`](#ffiparam) |

## FFIParam

| Field Name | Description | Type |
|------------|-------------|------|
| `name` | The name of the parameter. Note that parameters must be ordered correctly on the FFI, according to the order in the blockchain smart contract | `string` |
| `schema` | FireFly uses an extended subset of JSON Schema to describe parameters, similar to OpenAPI/Swagger. Converters are available for native blockchain interface definitions / type systems - such as an Ethereum ABI. See the documentation for more detail | [`JSONAny`](simpletypes#jsonany) |



2 changes: 1 addition & 1 deletion docs/reference/types/tokenpool.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ nav_order: 10
| `decimals` | Number of decimal places that this token has | `int` |
| `connector` | The name of the token connector, as specified in the FireFly core configuration file that is responsible for the token pool. Required on input when multiple token connectors are configured | `string` |
| `message` | The UUID of the broadcast message used to inform the network to index this pool | [`UUID`](simpletypes#uuid) |
| `state` | The current state of the token pool | `FFEnum`:<br/>`"unknown"`<br/>`"pending"`<br/>`"confirmed"` |
| `state` | The current state of the token pool | `FFEnum`:<br/>`"pending"`<br/>`"confirmed"` |
| `created` | The creation time of the pool | [`FFTime`](simpletypes#fftime) |
| `config` | Input only field, with token connector specific configuration of the pool, such as an existing Ethereum address and block number to used to index the pool. See your chosen token connector documentation for details | [`JSONObject`](simpletypes#jsonobject) |
| `info` | Token connector specific information about the pool. See your chosen token connector documentation for details | [`JSONObject`](simpletypes#jsonobject) |
Expand Down
Loading

0 comments on commit d6f6387

Please sign in to comment.