diff --git a/Jenkinsfile b/Jenkinsfile index 38e99fb0..3d4a6afb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,6 +8,6 @@ def pipeline = new org.js.LibPipeline( steps: this, preBuildCmds: ['npm install -g n','n 16.17.0', 'n prune', 'pnpm install --unsafe-perm'], testCmds: ['pnpm type-check','pnpm test','npm config set registry "https://nexus.iroha.tech/repository/npm-soramitsu/"'], pushCmds: ['pnpm jake publish-all'], - secretScannerExclusion: '.*Cargo.toml' + secretScannerExclusion: '.*Cargo.toml\$|.*README.md\$' ) -pipeline.runPipeline() \ No newline at end of file +pipeline.runPipeline() diff --git a/README.md b/README.md index b803c9a5..5882d04b 100644 --- a/README.md +++ b/README.md @@ -11,40 +11,97 @@ The Iroha 2 JavaScript library includes the following packages: - [`@iroha2/crypto-target-web`](./packages/crypto/packages/target-web/) provides compiled crypto WASM for native Web (ESM) - [`@iroha2/crypto-target-bundler`](./packages/crypto/packages/target-bundler/) provides compiled crypto WASM to use with bundlers such as Webpack - [`@iroha2/data-model`](./packages/data-model/) provides SCALE codecs for Iroha 2 data model - + Other packages you can find in this repository: + - [`@iroha2/client-isomorphic-fetch`](./packages/client-isomorphic-fetch/) fallbacks to `node-fetch` or native `fetch()` in Node.js - [`@iroha2/client-isomorphic-ws`](./packages/client-isomorphic-ws/) contains isomorphic WebSocket transport for `@iroha2/client` - [`@iroha2/docs-recipes`](./packages/docs-recipes/) contains code samples used in documentation - [`@iroha2/data-model-schema`](./packages/data-model-schema/) contains Iroha 2 Schema - [`@iroha2/i64-fixnum`](./packages/i64-fixnum/) handles operations with fixed-point numbers - ## Installation The packages are published under the `@iroha2` scope into Iroha Nexus Registry. To install them using `npm`/`pnpm`, follow these steps: 1. Configure your package manager to fetch scoped packages from Nexus Registry: - ```ini - # FILE: .npmrc - @iroha2:registry=https://nexus.iroha.tech/repository/npm-group/ - ``` + ```ini + # FILE: .npmrc + @iroha2:registry=https://nexus.iroha.tech/repository/npm-group/ + ``` 2. Install these packages as any other NPM package: - ```shell - npm i @iroha2/client - yarn add @iroha2/data-model - pnpm add @iroha2/crypto-target-web - ``` + ```shell + npm i @iroha2/client + yarn add @iroha2/data-model + pnpm add @iroha2/crypto-target-web + ``` ## Get Started Check out [Hyperledger Iroha 2 Tutorial](https://hyperledger.github.io/iroha-2-docs/) that introduces you to Iroha 2 concepts and features and provides you with a step-by-step guide for JavaScript/TypeScript. -## Explore Jake tasks +## Maintenance + +### Explore Jake tasks ```bash pnpm jake -t ``` + +### Manually update reference Iroha version + +1. Update `packages/dev-iroha-bins/src/config.ts`: + + ```ts + const config: Config = { + // ... + + // update git repo reference here + git: { + repo: 'https://github.com/hyperledger/iroha.git', + revision: 'b783f10fa7de26ed1fdd4c526bd162f8636f1a65', + }, + + // ... + } + ``` + +2. Set the same Iroha version in `packages/data-model-rust-samples/Cargo.toml`: + + ```toml + iroha_data_model = { git = 'https://github.com/hyperledger/iroha.git', rev = "b783f10fa7de26ed1fdd4c526bd162f8636f1a65" } + ``` + +3. Update JSON data-model samples used for tests. In `packages/data-model-rust-samples`, run: + + ```bash + cargo run > output.json + ``` + +4. Re-compile data-model schema: + + ```bash + pnpm --filter data-model-schema compile + ``` + +5. Run codegen for data-model: + + ```bash + pnpm --filter data-model codegen + ``` + +6. Use tests and TypeScript hints and update the rest of the SDK: + + ```bash + pnpm -w type-check + pnpm -w test + ``` + +7. Update `packages/client/README.md` and `packages/data-model/README.md`. In the beginning they have the following note: + + > This package targets `hyperledger/iroha` at current `iroha2-lts` branch, which has a hash `b783f10fa7de26ed1fdd4c526bd162f8636f1a65`. + + Put here a new Iroha 2 reference commit information. diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md index d50e153c..5c1b32b6 100644 --- a/packages/client/CHANGELOG.md +++ b/packages/client/CHANGELOG.md @@ -1,5 +1,76 @@ # @iroha2/client +## 4.0.0 + +### Major Changes + +- e27467e: Update client library after data-model update in Iroha 2. +- bd757cf: **refactor!**: make `Torii` stateless; force prerequisites to be passed for each method. + + ##### What is the change + + Previously, `Torii` was a class, and its constructor accepted all prerequisites at once: + + ```ts + const torii = new Torii({ apiURL, telemetryURL, fetch, ws }) + + torii.submit(transaction) + torii.getStatus() + torii.listenForEvents({ filter }) + ``` + + Now, `Torii` is a compendium of different methods. Each method has its own prerequisites: + + ```ts + Torii.submit({ apiURL, fetch }, transaction) + + Torii.getStatus({ telemetryURL, fetch }) + + Torii.listenForEvents({ apiURL, ws }, { filter }) + ``` + + ##### Why the change was made + + This change was introduced to allow you to only provide the prerequisites each method actually needs. For example, you no longer need to provide `ws` when all you want to do is submit a transaction. Only `fetch` and `apiURL` are needed for transaction to be submitted. + + ##### How to update your code + + You should pass the necessary prerequisites for each `Torii` method invocation. + + Previously, you had to create a single `Torii` instance: + + ```ts + const torii = new Torii({ apiURL, telemetryURL, fetch, ws }) + ``` + + You no longer need a single `Torii` instance. Instead, you create an object with necessary prerequisites: + + ```ts + const pre = { apiURL, fetch } + ``` + + Then pass the prerequisites when you need to call this method: + + ```ts + Torii.submit(pre, transaction) + ``` + +### Minor Changes + +- e27467e: Some functions were renamed: + + - `makeSignedTransaction` → `makeVersionedSignedTransaction` + - `makeSignedQuery` → `makeVersionedSignedQuery` + + Old names are still accessible. They are marked as `deprecated` and will be removed in future major releases. + +- bd757cf: **feat**: expose `keyPair` as a `public readonly` field from `Signer` + +### Patch Changes + +- Updated dependencies [e27467e] + - @iroha2/data-model@4.0.0 + ## 3.0.0 ### Major Changes @@ -18,7 +89,7 @@ ##### How to update your code - The changes you need to make to the code are rather straightforward. Here we provide a couple of examples for you to compare the code before and after this breaking change. You can refer to `Torii`, `Signer` and `Client` type definitions for details. + The changes you need to make to the code are rather straightforward. Here we provide a couple of examples for you to compare the code before and after this breaking change. You can refer to `Torii`, `Signer` and `Client` type definitions for details. `Client` used to be initialized like this: diff --git a/packages/client/README.md b/packages/client/README.md index 4901fe17..959d2a0a 100644 --- a/packages/client/README.md +++ b/packages/client/README.md @@ -4,7 +4,7 @@ Client for Iroha 2, which is used to submit requests to Iroha peer. ## Target version -This package targets `hyperledger/iroha` at current `iroha2-lts` branch, which has a hash `9bfdb39aaaa2490a82a17ebc255d3557d3ad38da`. +This package targets `hyperledger/iroha` at current `iroha2-lts` branch, which has a hash `b783f10fa7de26ed1fdd4c526bd162f8636f1a65`. ## Installation diff --git a/packages/client/package.json b/packages/client/package.json index ca6768c5..f5a1ca33 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@iroha2/client", - "version": "3.0.0", + "version": "4.0.0", "module": "dist/lib.mjs", "main": "dist/lib.cjs", "types": "dist/lib.d.ts", @@ -38,7 +38,7 @@ }, "dependencies": { "@iroha2/crypto-core": "workspace:^0.1.1", - "@iroha2/data-model": "workspace:3.0.0", + "@iroha2/data-model": "workspace:4.0.0", "@types/ws": "^8.2.2", "debug": "^4.3.4", "emittery": "^0.10.1", diff --git a/packages/client/src/lib.ts b/packages/client/src/lib.ts index d178f95f..2f47637f 100644 --- a/packages/client/src/lib.ts +++ b/packages/client/src/lib.ts @@ -22,12 +22,12 @@ import { Result, Signature, SignedQueryRequest, - Transaction, + SignedTransaction, TransactionPayload, VecSignatureOfTransactionPayload, VersionedPaginatedQueryResult, VersionedSignedQueryRequest, - VersionedTransaction, + VersionedSignedTransaction, } from '@iroha2/data-model' import { SetupBlocksStreamParams, SetupBlocksStreamReturn, setupBlocksStream } from './blocks-stream' import { garbageScope } from './collect-garbage' @@ -65,26 +65,22 @@ export interface PeerStatus { } export class Signer { - #kp: KeyPair - #accountId: AccountId + public readonly keyPair: KeyPair + public readonly accountId: AccountId public constructor(accountId: AccountId, keyPair: KeyPair) { - this.#accountId = accountId - this.#kp = keyPair - } - - public get accountId(): AccountId { - return this.#accountId + this.accountId = accountId + this.keyPair = keyPair } public sign(payload: Uint8Array): Signature { const { createSignature } = getCryptoAnyway() return garbageScope((collect) => { - const signature = collect(createSignature(this.#kp, payload)) + const signature = collect(createSignature(this.keyPair, payload)) // Should it be collected? - const pubKey = this.#kp.publicKey() + const pubKey = this.keyPair.publicKey() return Signature({ public_key: PublicKey({ @@ -139,23 +135,31 @@ export function signTransaction(payload: TransactionPayload, signer: Signer): Si return signer.sign(hash) } -export function makeSignedTransaction(payload: TransactionPayload, signer: Signer): VersionedTransaction { +export function makeVersionedSignedTransaction( + payload: TransactionPayload, + signer: Signer, +): VersionedSignedTransaction { const signature = signTransaction(payload, signer) - return VersionedTransaction( + return VersionedSignedTransaction( 'V1', - Transaction({ + SignedTransaction({ payload, signatures: VecSignatureOfTransactionPayload([signature]), }), ) } +/** + * @deprecated use {@link makeVersionedSignedTransaction} + */ +export const makeSignedTransaction = makeVersionedSignedTransaction + export function executableIntoSignedTransaction(params: { signer: Signer executable: Executable payloadParams?: Except -}): VersionedTransaction { - return makeSignedTransaction( +}): VersionedSignedTransaction { + return makeVersionedSignedTransaction( makeTransactionPayload({ executable: params.executable, accountId: params.signer.accountId, @@ -197,17 +201,22 @@ export function signQuery(payload: QueryPayload, signer: Signer): Signature { return signer.sign(hash) } -export function makeSignedQuery(payload: QueryPayload, signer: Signer): VersionedSignedQueryRequest { +export function makeVersionedSignedQuery(payload: QueryPayload, signer: Signer): VersionedSignedQueryRequest { const signature = signQuery(payload, signer) return VersionedSignedQueryRequest('V1', SignedQueryRequest({ payload, signature })) } +/** + * @deprecated use {@link makeVersionedSignedQuery} + */ +export const makeSignedQuery = makeVersionedSignedQuery + export function queryBoxIntoSignedQuery(params: { query: QueryBox signer: Signer payloadParams?: Except }): VersionedSignedQueryRequest { - return makeSignedQuery( + return makeVersionedSignedQuery( makeQueryPayload({ query: params.query, accountId: params.signer.accountId, @@ -221,62 +230,78 @@ export function queryBoxIntoSignedQuery(params: { // #region TORII -export interface ToriiApiHttp { - submit: (tx: VersionedTransaction) => Promise - request: (query: VersionedSignedQueryRequest) => Promise> - getHealth: () => Promise> - setPeerConfig: (params: SetPeerConfigParams) => Promise +export interface ToriiRequirementsPartUrlApi { + apiURL: string } -export interface ToriiApiWebSocket { - listenForEvents: (params: Pick) => Promise - listenForBlocksStream: (params: Pick) => Promise +export interface ToriiRequirementsPartUrlTelemetry { + telemetryURL: string } -export interface ToriiTelemetry { - getStatus: () => Promise - getMetrics: () => Promise +export interface ToriiRequirementsPartHttp { + fetch: Fetch } -export interface CreateToriiProps { - apiURL: string - telemetryURL: string - fetch: Fetch +export interface ToriiRequirementsPartWebSocket { ws: IsomorphicWebSocketAdapter } +export type ToriiRequirementsForApiHttp = ToriiRequirementsPartUrlApi & ToriiRequirementsPartHttp + +export type ToriiRequirementsForApiWebSocket = ToriiRequirementsPartUrlApi & ToriiRequirementsPartWebSocket + +export type ToriiRequirementsForTelemetry = ToriiRequirementsPartUrlTelemetry & ToriiRequirementsPartHttp + export type ToriiQueryResult = Result -export class Torii implements ToriiApiHttp, ToriiApiWebSocket, ToriiTelemetry { - #api: string - #telemetry: string - #fetch: Fetch - #ws: IsomorphicWebSocketAdapter - - public constructor(props: CreateToriiProps) { - this.#api = props.apiURL - this.#telemetry = props.telemetryURL - this.#fetch = props.fetch - this.#ws = props.ws - } +export interface ToriiApiHttp { + submit: (prerequisites: ToriiRequirementsForApiHttp, tx: VersionedSignedTransaction) => Promise + request: ( + prerequisites: ToriiRequirementsForApiHttp, + query: VersionedSignedQueryRequest, + ) => Promise> + getHealth: (prerequisites: ToriiRequirementsForApiHttp) => Promise> + setPeerConfig: (prerequisites: ToriiRequirementsForApiHttp, params: SetPeerConfigParams) => Promise +} - public async submit(tx: VersionedTransaction): Promise { - const body = VersionedTransaction.toBuffer(tx) +export interface ToriiApiWebSocket { + listenForEvents: ( + prerequisites: ToriiRequirementsForApiWebSocket, + params: Pick, + ) => Promise + listenForBlocksStream: ( + prerequisites: ToriiRequirementsForApiWebSocket, + params: Pick, + ) => Promise +} - const response = await this.#fetch(this.#api + ENDPOINT_TRANSACTION, { +export interface ToriiTelemetry { + getStatus: (prerequisites: ToriiRequirementsForTelemetry) => Promise + getMetrics: (prerequisites: ToriiRequirementsForTelemetry) => Promise +} + +export type ToriiOmnibus = ToriiApiHttp & ToriiApiWebSocket & ToriiTelemetry + +export const Torii: ToriiOmnibus = { + async submit(pre, tx) { + const body = VersionedSignedTransaction.toBuffer(tx) + + const response = await pre.fetch(pre.apiURL + ENDPOINT_TRANSACTION, { body, method: 'POST', }) ResponseError.throwIfStatusIsNot(response, 200) - } + }, - public async request(query: VersionedSignedQueryRequest): Promise { + async request(pre, query) { const queryBytes = VersionedSignedQueryRequest.toBuffer(query) - const response = await this.#fetch(this.#api + ENDPOINT_QUERY, { - method: 'POST', - body: queryBytes!, - }).then() + const response = await pre + .fetch(pre.apiURL + ENDPOINT_QUERY, { + method: 'POST', + body: queryBytes!, + }) + .then() const bytes = new Uint8Array(await response.arrayBuffer()) @@ -289,12 +314,12 @@ export class Torii implements ToriiApiHttp, ToriiApiWebSocket, ToriiTelemetry { const error = QueryError.fromBuffer(bytes) return Enum.variant('Err', error) } - } + }, - public async getHealth(): Promise> { + async getHealth(pre) { let response: Response try { - response = await this.#fetch(this.#api + ENDPOINT_HEALTH) + response = await pre.fetch(pre.apiURL + ENDPOINT_HEALTH) } catch (err) { return Enum.variant('Err', `Network error: ${String(err)}`) } @@ -307,40 +332,39 @@ export class Torii implements ToriiApiHttp, ToriiApiWebSocket, ToriiTelemetry { } return Enum.variant('Ok', null) - } + }, - public async listenForEvents(params: Pick): Promise { + async listenForEvents(pre, params: Pick) { return setupEvents({ filter: params.filter, - toriiApiURL: this.#api, - adapter: this.#ws, + toriiApiURL: pre.apiURL, + adapter: pre.ws, }) - } + }, - public async listenForBlocksStream( - params: Pick, - ): Promise { + async listenForBlocksStream(pre, params: Pick) { return setupBlocksStream({ height: params.height, - toriiApiURL: this.#api, - adapter: this.#ws, + toriiApiURL: pre.apiURL, + adapter: pre.ws, }) - } - public async getStatus(): Promise { - const response = await this.#fetch(this.#telemetry + ENDPOINT_STATUS) + }, + + async getStatus(pre): Promise { + const response = await pre.fetch(pre.telemetryURL + ENDPOINT_STATUS) ResponseError.throwIfStatusIsNot(response, 200) return response.text().then(parseJsonWithBigInts) - } + }, - public async getMetrics(): Promise { - return this.#fetch(this.#telemetry + ENDPOINT_METRICS).then((response) => { + async getMetrics(pre) { + return pre.fetch(pre.telemetryURL + ENDPOINT_METRICS).then((response) => { ResponseError.throwIfStatusIsNot(response, 200) return response.text() }) - } + }, - public async setPeerConfig(params: SetPeerConfigParams): Promise { - const response = await this.#fetch(this.#api + ENDPOINT_CONFIGURATION, { + async setPeerConfig(pre, params: SetPeerConfigParams) { + const response = await pre.fetch(pre.apiURL + ENDPOINT_CONFIGURATION, { method: 'POST', body: JSON.stringify(params), headers: { @@ -348,7 +372,7 @@ export class Torii implements ToriiApiHttp, ToriiApiWebSocket, ToriiTelemetry { }, }) ResponseError.throwIfStatusIsNot(response, 200) - } + }, } export class ResponseError extends Error { @@ -366,21 +390,18 @@ export class ResponseError extends Error { // #region Client export class Client { - public readonly torii: Torii - public readonly signer: Signer - public constructor(params: { torii: Torii; signer: Signer }) { + public constructor(params: { signer: Signer }) { this.signer = params.signer - this.torii = params.torii } - public async submitExecutable(executable: Executable) { - return this.torii.submit(executableIntoSignedTransaction({ executable, signer: this.signer })) + public async submitExecutable(pre: ToriiRequirementsForApiHttp, executable: Executable) { + return Torii.submit(pre, executableIntoSignedTransaction({ executable, signer: this.signer })) } - public async requestWithQueryBox(query: QueryBox) { - return this.torii.request(queryBoxIntoSignedQuery({ query, signer: this.signer })) + public async requestWithQueryBox(pre: ToriiRequirementsForApiHttp, query: QueryBox) { + return Torii.request(pre, queryBoxIntoSignedQuery({ query, signer: this.signer })) } } diff --git a/packages/client/test/integration/config/peer_config.json b/packages/client/test/integration/config/peer_config.json index 7c22e009..a4a8fb7b 100644 --- a/packages/client/test/integration/config/peer_config.json +++ b/packages/client/test/integration/config/peer_config.json @@ -1,8 +1,11 @@ { + "DISABLE_PANIC_TERMINAL_COLORS": false, "TORII": { "P2P_ADDR": "127.0.0.1:1337", "API_URL": "127.0.0.1:8080", - "TELEMETRY_URL": "127.0.0.1:8081" + "TELEMETRY_URL": "127.0.0.1:8081", + "MAX_TRANSACTION_SIZE": 32768, + "MAX_CONTENT_LEN": 16384000 }, "SUMERAGI": { "TRUSTED_PEERS": [ @@ -14,18 +17,37 @@ "BLOCK_TIME_MS": 100, "COMMIT_TIME_MS": 100, "TX_RECEIPT_TIME_MS": 100, - "MAX_FAULTY_PEERS": 0 + "MAX_FAULTY_PEERS": 0, + "KEY_PAIR": null, + "PEER_ID": null, + "COMMIT_TIME_LIMIT_MS": 2000, + "TX_RECEIPT_TIME_LIMIT_MS": 500, + "TRANSACTION_LIMITS": { + "max_instruction_number": 4096, + "max_wasm_size_bytes": 4194304 + }, + "ACTOR_CHANNEL_CAPACITY": 100, + "GOSSIP_BATCH_SIZE": 500, + "GOSSIP_PERIOD_MS": 1000 }, "KURA": { "INIT_MODE": "strict", - "BLOCK_STORE_PATH": "./blocks" + "BLOCK_STORE_PATH": "./storage", + "BLOCKS_PER_STORAGE_FILE": 1000, + "ACTOR_CHANNEL_CAPACITY": 100, + "DEBUG_OUTPUT_NEW_BLOCKS": false }, "LOGGER": { - "MAX_LOG_LEVEL": "INFO" + "MAX_LOG_LEVEL": "INFO", + "TELEMETRY_CAPACITY": 1000, + "COMPACT_MODE": false, + "LOG_FILE_PATH": null, + "TERMINAL_COLORS": true }, "BLOCK_SYNC": { "GOSSIP_PERIOD_MS": 10000, - "BATCH_SIZE": 4 + "BLOCK_BATCH_SIZE": 4, + "ACTOR_CHANNEL_CAPACITY": 100 }, "PUBLIC_KEY": "ed01207233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0", "PRIVATE_KEY": { @@ -37,6 +59,51 @@ "ACCOUNT_PRIVATE_KEY": { "digest_function": "ed25519", "payload": "9ac47abf59b356e0bd7dcbbbb4dec080e302156a48ca907e47cb6aea1d32719e7233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0" + }, + "WAIT_FOR_PEERS_RETRY_COUNT_LIMIT": 100, + "WAIT_FOR_PEERS_RETRY_PERIOD_MS": 500, + "GENESIS_SUBMISSION_DELAY_MS": 1000 + }, + "QUEUE": { + "MAXIMUM_TRANSACTIONS_IN_BLOCK": 8192, + "MAXIMUM_TRANSACTIONS_IN_QUEUE": 65536, + "TRANSACTION_TIME_TO_LIVE_MS": 86400000, + "FUTURE_THRESHOLD_MS": 1000 + }, + "WSV": { + "ASSET_METADATA_LIMITS": { + "max_len": 1048576, + "max_entry_byte_size": 4096 + }, + "ASSET_DEFINITION_METADATA_LIMITS": { + "max_len": 1048576, + "max_entry_byte_size": 4096 + }, + "ACCOUNT_METADATA_LIMITS": { + "max_len": 1048576, + "max_entry_byte_size": 4096 + }, + "DOMAIN_METADATA_LIMITS": { + "max_len": 1048576, + "max_entry_byte_size": 4096 + }, + "IDENT_LENGTH_LIMITS": { + "min": 1, + "max": 128 + }, + "WASM_RUNTIME_CONFIG": { + "FUEL_LIMIT": 1000000, + "MAX_MEMORY": 524288000 } + }, + "NETWORK": { + "ACTOR_CHANNEL_CAPACITY": 100 + }, + "TELEMETRY": { + "NAME": null, + "URL": null, + "MIN_RETRY_PERIOD": 1, + "MAX_RETRY_DELAY_EXPONENT": 4, + "FILE": null } } diff --git a/packages/client/test/integration/config/peer_genesis.json b/packages/client/test/integration/config/peer_genesis.json index 51d8117d..72f0fe62 100644 --- a/packages/client/test/integration/config/peer_genesis.json +++ b/packages/client/test/integration/config/peer_genesis.json @@ -4,15 +4,13 @@ "isi": [ { "Register": { - "object": { - "Raw": { - "Identifiable": { - "NewDomain": { - "id": { - "name": "wonderland" - }, - "logo": null, - "metadata": {} + "Identifiable": { + "NewDomain": { + "id": "wonderland", + "logo": null, + "metadata": { + "key": { + "String": "value" } } } @@ -21,18 +19,13 @@ }, { "Register": { - "object": { - "Raw": { - "Identifiable": { - "NewAccount": { - "id": { - "name": "alice", - "domain_id": { - "name": "wonderland" - } - }, - "signatories": ["ed01207233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0"], - "metadata": {} + "Identifiable": { + "NewAccount": { + "id": "alice@wonderland", + "signatories": ["ed01207233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0"], + "metadata": { + "key": { + "String": "value" } } } @@ -41,49 +34,304 @@ }, { "Register": { - "object": { - "Raw": { - "Identifiable": { - "NewAssetDefinition": { - "id": { - "name": "rose", - "domain_id": { - "name": "wonderland" - } - }, - "value_type": "Quantity", - "mintable": "Infinitely", - "metadata": {} + "Identifiable": { + "NewAccount": { + "id": "bob@wonderland", + "signatories": ["ed01207233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0"], + "metadata": { + "key": { + "String": "value" } } } } } }, + { + "Register": { + "Identifiable": { + "NewAssetDefinition": { + "id": "rose#wonderland", + "value_type": "Quantity", + "mintable": "Infinitely", + "metadata": {} + } + } + } + }, + { + "Register": { + "Identifiable": { + "NewDomain": { + "id": "garden_of_live_flowers", + "logo": null, + "metadata": {} + } + } + } + }, + { + "Register": { + "Identifiable": { + "NewAccount": { + "id": "carpenter@garden_of_live_flowers", + "signatories": ["ed01207233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0"], + "metadata": {} + } + } + } + }, + { + "Register": { + "Identifiable": { + "NewAssetDefinition": { + "id": "cabbage#garden_of_live_flowers", + "value_type": "Quantity", + "mintable": "Infinitely", + "metadata": {} + } + } + } + }, + { + "Register": { + "Identifiable": { + "PermissionTokenDefinition": { + "id": "can_unregister_asset_with_definition", + "params": { + "asset_definition_id": "Id" + } + } + } + } + }, + { + "Register": { + "Identifiable": { + "PermissionTokenDefinition": { + "id": "can_burn_asset_with_definition", + "params": { + "asset_definition_id": "Id" + } + } + } + } + }, + { + "Register": { + "Identifiable": { + "PermissionTokenDefinition": { + "id": "can_burn_user_assets", + "params": { + "asset_id": "Id" + } + } + } + } + }, + { + "Register": { + "Identifiable": { + "PermissionTokenDefinition": { + "id": "can_set_key_value_in_user_assets", + "params": { + "asset_id": "Id" + } + } + } + } + }, + { + "Register": { + "Identifiable": { + "PermissionTokenDefinition": { + "id": "can_remove_key_value_in_user_assets", + "params": { + "asset_id": "Id" + } + } + } + } + }, + { + "Register": { + "Identifiable": { + "PermissionTokenDefinition": { + "id": "can_set_key_value_in_user_metadata", + "params": { + "account_id": "Id" + } + } + } + } + }, + { + "Register": { + "Identifiable": { + "PermissionTokenDefinition": { + "id": "can_remove_key_value_in_user_metadata", + "params": { + "account_id": "Id" + } + } + } + } + }, + { + "Register": { + "Identifiable": { + "PermissionTokenDefinition": { + "id": "can_set_key_value_in_asset_definition", + "params": { + "asset_definition_id": "Id" + } + } + } + } + }, + { + "Register": { + "Identifiable": { + "PermissionTokenDefinition": { + "id": "can_remove_key_value_in_asset_definition", + "params": { + "asset_definition_id": "Id" + } + } + } + } + }, + { + "Register": { + "Identifiable": { + "PermissionTokenDefinition": { + "id": "can_mint_user_asset_definitions", + "params": { + "asset_definition_id": "Id" + } + } + } + } + }, + { + "Register": { + "Identifiable": { + "PermissionTokenDefinition": { + "id": "can_transfer_user_assets", + "params": { + "asset_id": "Id" + } + } + } + } + }, + { + "Register": { + "Identifiable": { + "PermissionTokenDefinition": { + "id": "can_transfer_only_fixed_number_of_times_per_period", + "params": { + "count": "U32", + "period": "U128" + } + } + } + } + }, { "Mint": { "object": { - "Raw": { - "U32": 13 + "U32": 13 + }, + "destination_id": { + "Id": { + "AssetId": "rose##alice@wonderland" } + } + } + }, + { + "Mint": { + "object": { + "U32": 44 }, "destination_id": { - "Raw": { - "Id": { - "AssetId": { - "definition_id": { - "name": "rose", - "domain_id": { - "name": "wonderland" + "Id": { + "AssetId": "cabbage#garden_of_live_flowers#alice@wonderland" + } + } + } + }, + { + "Register": { + "Identifiable": { + "PermissionTokenDefinition": { + "id": "allowed_to_do_stuff", + "params": {} + } + } + } + }, + { + "Register": { + "Identifiable": { + "NewRole": { + "inner": { + "id": "USER_METADATA_ACCESS", + "permissions": [ + { + "definition_id": "can_remove_key_value_in_user_metadata", + "params": { + "account_id": { + "Id": { + "AccountId": "alice@wonderland" + } + } } }, - "account_id": { - "name": "alice", - "domain_id": { - "name": "wonderland" + { + "definition_id": "can_set_key_value_in_user_metadata", + "params": { + "account_id": { + "Id": { + "AccountId": "alice@wonderland" + } + } } } - } + ] + } + } + } + } + }, + { + "Grant": { + "object": { + "PermissionToken": { + "definition_id": "allowed_to_do_stuff", + "params": {} + } + }, + "destination_id": { + "Id": { + "AccountId": "alice@wonderland" + } + } + } + }, + { + "Register": { + "Identifiable": { + "NewRole": { + "inner": { + "id": "staff_that_does_stuff_in_genesis", + "permissions": [ + { + "definition_id": "allowed_to_do_stuff", + "params": {} + } + ] } } } diff --git a/packages/client/test/integration/test-node/multiple.spec.ts b/packages/client/test/integration/test-node/multiple.spec.ts index 5378b88e..8c070b91 100644 --- a/packages/client/test/integration/test-node/multiple.spec.ts +++ b/packages/client/test/integration/test-node/multiple.spec.ts @@ -1,7 +1,13 @@ -/* eslint-disable max-params */ import { afterAll, afterEach, beforeEach, describe, expect, test } from 'vitest' import { crypto } from '@iroha2/crypto-target-node' -import { Client, Signer, Torii, setCrypto } from '@iroha2/client' +import { + Client, + Signer, + Torii, + ToriiRequirementsForApiHttp, + ToriiRequirementsForTelemetry, + setCrypto, +} from '@iroha2/client' import { adapter as WS } from '@iroha2/client/web-socket/node' import nodeFetch from 'node-fetch' import { @@ -45,13 +51,12 @@ import { Logger as ScaleLogger, Value, VecInstruction, - VecPermissionToken, VecPublicKey, VecRoleId, } from '@iroha2/data-model' import { hexToBytes } from 'hada' import { Seq } from 'immutable' -import { StartPeerReturn, cleanConfiguration, setConfiguration, startPeer } from '@iroha2/test-peer' +import { StartPeerReturn, cleanConfiguration, cleanSideEffects, setConfiguration, startPeer } from '@iroha2/test-peer' import { delay } from '../util' import { PIPELINE_MS, client_config, peer_config, peer_genesis } from '../config' @@ -75,28 +80,32 @@ setCrypto(crypto) function clientFactory() { const signer = new Signer(client_config.account as AccountId, keyPair) - const torii = new Torii({ - ...client_config.torii, - ws: WS, - fetch: nodeFetch as typeof fetch, - }) + const pre = { ...client_config.torii, ws: WS, fetch: nodeFetch as typeof fetch } - const client = new Client({ torii, signer }) + const client = new Client({ signer }) - return { signer, torii, client } + return { signer, pre, client } } // #endregion -async function addAsset( - client: Client, - definitionId: AssetDefinitionId, - assetType: AssetValueType = Enum.variant('BigQuantity'), +async function addAsset({ + client, + definitionId, + opts, + assetType, + pre, +}: { + client: Client + pre: ToriiRequirementsForApiHttp + definitionId: AssetDefinitionId + assetType?: AssetValueType opts?: { mintable?: Mintable - }, -) { + } +}) { await client.submitExecutable( + pre, Executable( 'Instructions', VecInstruction([ @@ -112,7 +121,7 @@ async function addAsset( 'NewAssetDefinition', NewAssetDefinition({ id: definitionId, - value_type: assetType, + value_type: assetType ?? Enum.variant('BigQuantity'), metadata: Metadata({ map: MapNameValue(new Map()) }), mintable: opts?.mintable ?? Mintable('Not'), }), @@ -127,8 +136,17 @@ async function addAsset( ) } -async function addAccount(client: Client, accountId: AccountId) { +async function addAccount({ + client, + accountId, + pre, +}: { + client: Client + accountId: AccountId + pre: ToriiRequirementsForApiHttp +}) { await client.submitExecutable( + pre, Executable( 'Instructions', VecInstruction([ @@ -145,7 +163,6 @@ async function addAccount(client: Client, accountId: AccountId) { Account({ id: accountId, assets: MapAssetIdAsset(new Map()), - permission_tokens: VecPermissionToken([]), signature_check_condition: EvaluatesToBool({ expression: Expression('Raw', Value('Bool', false)), }), @@ -175,13 +192,13 @@ async function pipelineStepDelay() { let startedPeer: StartPeerReturn | null = null async function killStartedPeer() { - await startedPeer?.kill({ cleanSideEffects: true }) + await startedPeer?.kill() startedPeer = null } -async function waitForGenesisCommitted(torii: Torii) { +async function waitForGenesisCommitted(pre: ToriiRequirementsForTelemetry) { while (true) { - const { blocks } = await torii.getStatus() + const { blocks } = await Torii.getStatus(pre) if (blocks >= 1) return await delay(250) } @@ -191,6 +208,7 @@ async function waitForGenesisCommitted(torii: Torii) { beforeEach(async () => { await cleanConfiguration() + await cleanSideEffects(peer_config.KURA.BLOCK_STORE_PATH) // setup configs for test peer await setConfiguration({ @@ -200,7 +218,7 @@ beforeEach(async () => { startedPeer = await startPeer({ toriiApiURL: client_config.torii.apiURL }) - await waitForGenesisCommitted(clientFactory().torii) + await waitForGenesisCommitted(clientFactory().pre) }) afterEach(async () => { @@ -213,13 +231,13 @@ afterAll(async () => { // Actually it is already tested within `@iroha2/test-peer` test('Peer is healthy', async () => { - const { torii } = clientFactory() + const { pre } = clientFactory() - expect(await torii.getHealth()).toEqual(Enum.variant('Ok', null) as Result) + expect(await Torii.getHealth(pre)).toEqual(Enum.variant('Ok', null) as Result) }) test('AddAsset instruction with name length more than limit is not committed', async () => { - const { client } = clientFactory() + const { client, pre } = clientFactory() const normalAssetDefinitionId = AssetDefinitionId({ name: 'xor', @@ -227,7 +245,7 @@ test('AddAsset instruction with name length more than limit is not committed', a name: 'wonderland', }), }) - await addAsset(client, normalAssetDefinitionId) + await addAsset({ client, pre, definitionId: normalAssetDefinitionId }) const tooLongAssetName = '0'.repeat(2 ** 14) const invalidAssetDefinitionId = AssetDefinitionId({ @@ -236,11 +254,11 @@ test('AddAsset instruction with name length more than limit is not committed', a name: 'wonderland', }), }) - await addAsset(client, invalidAssetDefinitionId) + await addAsset({ client, pre, definitionId: invalidAssetDefinitionId }) await delay(PIPELINE_MS * 2) - const queryResult = await client.requestWithQueryBox(QueryBox('FindAllAssetsDefinitions', null)) + const queryResult = await client.requestWithQueryBox(pre, QueryBox('FindAllAssetsDefinitions', null)) const existingDefinitions: AssetDefinitionId[] = queryResult .as('Ok') @@ -252,7 +270,7 @@ test('AddAsset instruction with name length more than limit is not committed', a }) test('AddAccount instruction with name length more than limit is not committed', async () => { - const { client } = clientFactory() + const { client, pre } = clientFactory() const normal = AccountId({ name: 'bob', @@ -267,10 +285,10 @@ test('AddAccount instruction with name length more than limit is not committed', }), }) - await Promise.all([normal, incorrect].map((x) => addAccount(client, x))) + await Promise.all([normal, incorrect].map((x) => addAccount({ client, pre, accountId: x }))) await delay(PIPELINE_MS * 2) - const queryResult = await client.requestWithQueryBox(QueryBox('FindAllAccounts', null)) + const queryResult = await client.requestWithQueryBox(pre, QueryBox('FindAllAccounts', null)) const existingAccounts: AccountId[] = queryResult .as('Ok') @@ -281,8 +299,8 @@ test('AddAccount instruction with name length more than limit is not committed', expect(existingAccounts).not.toContainEqual(incorrect) }) -test('Ensure properly handling of Fixed type - adding Fixed asset and quering for it later', async () => { - const { client } = clientFactory() +test('Ensure properly handling of Fixed type - adding Fixed asset and querying for it later', async () => { + const { client, pre } = clientFactory() // Creating asset by definition const ASSET_DEFINITION_ID = AssetDefinitionId({ @@ -291,12 +309,19 @@ test('Ensure properly handling of Fixed type - adding Fixed asset and quering fo name: 'wonderland', }), }) - await addAsset(client, ASSET_DEFINITION_ID, AssetValueType('Fixed'), { mintable: Mintable('Infinitely') }) + await addAsset({ + client, + pre, + definitionId: ASSET_DEFINITION_ID, + assetType: AssetValueType('Fixed'), + opts: { mintable: Mintable('Infinitely') }, + }) await pipelineStepDelay() // Adding mint const DECIMAL = '512.5881' await client.submitExecutable( + pre, mintIntoExecutable( MintBox({ object: EvaluatesToValue({ @@ -324,6 +349,7 @@ test('Ensure properly handling of Fixed type - adding Fixed asset and quering fo // Checking added asset via query const result = await client.requestWithQueryBox( + pre, QueryBox( 'FindAssetsByAccountId', FindAssetsByAccountId({ @@ -345,7 +371,7 @@ test('Ensure properly handling of Fixed type - adding Fixed asset and quering fo }) test('Registering domain', async () => { - const { client } = clientFactory() + const { client, pre } = clientFactory() async function registerDomain(domainName: string) { const registerBox = RegisterBox({ @@ -369,11 +395,14 @@ test('Registering domain', async () => { }), }) - await client.submitExecutable(Executable('Instructions', VecInstruction([Instruction('Register', registerBox)]))) + await client.submitExecutable( + pre, + Executable('Instructions', VecInstruction([Instruction('Register', registerBox)])), + ) } async function ensureDomainExistence(domainName: string) { - const result = await client.requestWithQueryBox(QueryBox('FindAllDomains', null)) + const result = await client.requestWithQueryBox(pre, QueryBox('FindAllDomains', null)) const domain = result .as('Ok') @@ -389,10 +418,11 @@ test('Registering domain', async () => { await ensureDomainExistence('test') }) -test('When querying for unexisting domain, returns FindError', async () => { - const { client } = clientFactory() +test('When querying for not existing domain, returns FindError', async () => { + const { client, pre } = clientFactory() const result = await client.requestWithQueryBox( + pre, QueryBox( 'FindAssetById', FindAssetById({ @@ -427,7 +457,7 @@ test('When querying for unexisting domain, returns FindError', async () => { describe('Events API', () => { test('transaction-committed event is triggered after AddAsset instruction has been committed', async () => { - const { torii, client } = clientFactory() + const { pre, client } = clientFactory() const filter = FilterBox( 'Pipeline', @@ -440,7 +470,7 @@ describe('Events API', () => { // Listening - const { ee, stop } = await torii.listenForEvents({ filter }) + const { ee, stop } = await Torii.listenForEvents(pre, { filter }) const committedPromise = new Promise((resolve, reject) => { ee.on('event', (event) => { @@ -457,15 +487,16 @@ describe('Events API', () => { }) // Triggering transaction - await addAsset( + await addAsset({ client, - AssetDefinitionId({ + pre, + definitionId: AssetDefinitionId({ name: 'xor', domain_id: DomainId({ name: 'wonderland', }), }), - ) + }) // Waiting for resolving await new Promise((resolve, reject) => { @@ -480,38 +511,41 @@ describe('Events API', () => { describe('Setting configuration', () => { test('When setting correct peer configuration, there is no error', async () => { - const { torii } = clientFactory() + const { pre } = clientFactory() - await torii.setPeerConfig({ LogLevel: 'TRACE' }) + await Torii.setPeerConfig(pre, { LogLevel: 'TRACE' }) }) test('When setting incorrect peer log level, there is an error', async () => { - const { torii } = clientFactory() + const { pre } = clientFactory() - await expect(torii.setPeerConfig({ LogLevel: 'TR' as any })).rejects.toThrow() + await expect(Torii.setPeerConfig(pre, { LogLevel: 'TR' as any })).rejects.toThrow() }) }) describe('Blocks Stream API', () => { - test('When commiting 3 blocks sequentially, nothing fails', async () => { - const { torii, client } = clientFactory() + // FIXME: currently Iroha has a bug related to blocks stream, so this test fails + // TODO: link issue here + test.skip('When committing 3 blocks sequentially, nothing fails', async () => { + const { pre, client } = clientFactory() - const stream = await torii.listenForBlocksStream({ height: 0n }) + const stream = await Torii.listenForBlocksStream(pre, { height: 0n }) for (const assetName of ['xor', 'val', 'vat']) { // listening for some block const blockPromise = stream.ee.once('block') // triggering block creation - await addAsset( + await addAsset({ client, - AssetDefinitionId({ + pre, + definitionId: AssetDefinitionId({ name: assetName, domain_id: DomainId({ name: 'wonderland', }), }), - ) + }) // waiting for it await blockPromise @@ -523,9 +557,9 @@ describe('Blocks Stream API', () => { describe('Metrics', () => { test('When getting metrics, everything is OK', async () => { - const { torii } = clientFactory() + const { pre } = clientFactory() - const data = await torii.getMetrics() + const data = await Torii.getMetrics(pre) // just some line from Prometheus metrics expect(data).toMatch('block_height 1') @@ -533,9 +567,9 @@ describe('Metrics', () => { }) test('status - peer uptime content check, not only type', async () => { - const { torii } = clientFactory() + const { pre } = clientFactory() - const status = await torii.getStatus() + const status = await Torii.getStatus(pre) expect(status).toEqual( expect.objectContaining({ diff --git a/packages/client/test/integration/test-node/package.json b/packages/client/test/integration/test-node/package.json index 2a337589..a2bed139 100644 --- a/packages/client/test/integration/test-node/package.json +++ b/packages/client/test/integration/test-node/package.json @@ -5,7 +5,7 @@ "test": "cross-env DEBUG=@iroha2* vitest run" }, "devDependencies": { - "@iroha2/client": "workspace:^3.0.0", + "@iroha2/client": "workspace:^4.0.0", "@iroha2/crypto-target-node": "workspace:^0.4.0", "@iroha2/test-peer": "workspace:^0.0.1", "consola": "^2.15.3", diff --git a/packages/client/test/integration/test-web/cypress/e2e/main.cy.ts b/packages/client/test/integration/test-web/cypress/e2e/main.cy.ts index 4ac86bec..615023b4 100644 --- a/packages/client/test/integration/test-web/cypress/e2e/main.cy.ts +++ b/packages/client/test/integration/test-web/cypress/e2e/main.cy.ts @@ -4,20 +4,19 @@ import { client_config, peer_config, peer_genesis } from '../../../config' testPeerClient.setBaseURL('/peer-server') before(async () => { - await testPeerClient.cleanConfiguration() - await testPeerClient.cleanSideEffects() await testPeerClient.setConfiguration({ config: peer_config, genesis: peer_genesis }) }) beforeEach(async () => { await testPeerClient.killPeer() + await testPeerClient.cleanSideEffects(peer_config.KURA.BLOCK_STORE_PATH) await testPeerClient.startPeer({ toriiApiURL: client_config.torii.apiURL }) }) -it('Register new domain and wait until committment', () => { +it('Register new domain and wait until commitment', () => { cy.visit('/') - // wait for genesis committment + // wait for genesis commitment cy.get('h3').contains('Status').closest('div').contains('Blocks: 1') cy.get('button').contains('Listen').click().contains('Stop') @@ -28,6 +27,6 @@ it('Register new domain and wait until committment', () => { // Ensure that blocks count is incremented cy.contains('Blocks: 2') - // And that events are cought + // And that events are caught cy.get('ul.events-list').children('li').should('have.length', 1) }) diff --git a/packages/client/test/integration/test-web/package.json b/packages/client/test/integration/test-web/package.json index 4a3ab83f..52350577 100644 --- a/packages/client/test/integration/test-web/package.json +++ b/packages/client/test/integration/test-web/package.json @@ -11,10 +11,10 @@ }, "devDependencies": { "@bahmutov/cypress-esbuild-preprocessor": "^2.1.3", - "@iroha2/client": "workspace:^3.0.0", + "@iroha2/client": "workspace:^4.0.0", "@iroha2/crypto-core": "workspace:^0.1.1", "@iroha2/crypto-target-web": "workspace:^0.4.0", - "@iroha2/data-model": "workspace:^3.0.0", + "@iroha2/data-model": "workspace:^4.0.0", "@iroha2/test-peer": "workspace:^0.0.1", "@scale-codec/util": "^1.1.1", "@vitejs/plugin-vue": "^3.1.0", diff --git a/packages/client/test/integration/test-web/src/client.ts b/packages/client/test/integration/test-web/src/client.ts index eef6de1d..ecd826b7 100644 --- a/packages/client/test/integration/test-web/src/client.ts +++ b/packages/client/test/integration/test-web/src/client.ts @@ -1,4 +1,4 @@ -import { Client, Signer, Torii } from '@iroha2/client' +import { Client, Signer } from '@iroha2/client' import { adapter as WS } from '@iroha2/client/web-socket/native' import { crypto } from './crypto' import { KeyPair } from '@iroha2/crypto-core' @@ -8,13 +8,13 @@ import { AccountId } from '@iroha2/data-model' const HOST = window.location.host -const torii = new Torii({ +export const toriiPre = { // proxified with vite apiURL: `http://${HOST}/torii/api`, telemetryURL: `http://${HOST}/torii/telemetry`, ws: WS, fetch: fetch.bind(window), -}) +} const signer = new Signer( client_config.account as AccountId, @@ -24,7 +24,7 @@ const signer = new Signer( }), ) -export const client = new Client({ torii, signer }) +export const client = new Client({ signer }) function generateKeyPair(params: { publicKeyMultihash: string diff --git a/packages/client/test/integration/test-web/src/components/CreateDomain.vue b/packages/client/test/integration/test-web/src/components/CreateDomain.vue index 2f033e88..3cfe3da2 100644 --- a/packages/client/test/integration/test-web/src/components/CreateDomain.vue +++ b/packages/client/test/integration/test-web/src/components/CreateDomain.vue @@ -15,13 +15,14 @@ import { VecInstruction, } from '@iroha2/data-model' import { ref } from 'vue' -import { client } from '../client' +import { client, toriiPre } from '../client' import { useTask } from '@vue-kakuyaku/core' const domainName = ref('') const { state, run: registerDomain } = useTask(async () => { await client.submitExecutable( + toriiPre, Executable( 'Instructions', VecInstruction([ diff --git a/packages/client/test/integration/test-web/src/components/Listener.vue b/packages/client/test/integration/test-web/src/components/Listener.vue index 932bbea1..89aa0c84 100644 --- a/packages/client/test/integration/test-web/src/components/Listener.vue +++ b/packages/client/test/integration/test-web/src/components/Listener.vue @@ -1,5 +1,5 @@ diff --git a/packages/data-model-rust-samples/Cargo.lock b/packages/data-model-rust-samples/Cargo.lock index e0bc0246..481508eb 100644 --- a/packages/data-model-rust-samples/Cargo.lock +++ b/packages/data-model-rust-samples/Cargo.lock @@ -23,7 +23,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] @@ -125,9 +125,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.64" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e121dee8023ce33ab248d9ce1493df03c3b38a659b240096fcbd7048ff9c31f" +checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" dependencies = [ "addr2line", "cc", @@ -152,9 +152,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitvec" -version = "0.20.4" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty", "radium", @@ -192,16 +192,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ "block-padding 0.2.1", - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] @@ -231,9 +231,9 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "bumpalo" -version = "3.9.1" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" +checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" [[package]] name = "byte-slice-cast" @@ -255,9 +255,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "c2-chacha" @@ -309,7 +309,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] @@ -318,11 +318,17 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d6f2aa4d0537bcc1c74df8755072bd31c1ef1a3a1b85a68e8404a8c353b7b8b" +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" dependencies = [ "libc", ] @@ -335,9 +341,9 @@ checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" [[package]] name = "crossbeam-channel" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ "cfg-if", "crossbeam-utils", @@ -345,9 +351,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -356,26 +362,24 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.8" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" +checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" dependencies = [ "autocfg 1.1.0", "cfg-if", "crossbeam-utils", - "lazy_static", "memoffset", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.8" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ "cfg-if", - "lazy_static", ] [[package]] @@ -384,19 +388,19 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f83bd3bb4314701c568e340cd8cf78c975aa0ca79e03d3f6d1677d5b0c9c0c03" dependencies = [ - "generic-array 0.14.5", - "rand_core 0.6.3", + "generic-array 0.14.6", + "rand_core 0.6.4", "subtle", "zeroize", ] [[package]] name = "crypto-common" -version = "0.1.3" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", "typenum", ] @@ -406,7 +410,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", "subtle", ] @@ -416,7 +420,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", "subtle", ] @@ -442,14 +446,52 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4529658bdda7fd6769b8614be250cdcfc3aeb0ee72fe66f9e41e5e5eb73eac02" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "649c91bc01e8b1eac09fb91e8dbc7d517684ca6be8ebc75bb9cafc894f9fdb6f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc69c5bfcbd2fc09a0f38451d2daf0e372e367986a83906d1b0dbc88134fb5" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "dashmap" -version = "4.0.2" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c" +checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" dependencies = [ "cfg-if", - "num_cpus", + "hashbrown", + "lock_api", + "once_cell", + "parking_lot_core", ] [[package]] @@ -477,8 +519,10 @@ version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ + "convert_case", "proc-macro2", "quote", + "rustc_version", "syn", ] @@ -497,16 +541,16 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] name = "digest" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" dependencies = [ - "block-buffer 0.10.2", + "block-buffer 0.10.3", "crypto-common", ] @@ -524,9 +568,9 @@ dependencies = [ [[package]] name = "ed25519" -version = "1.4.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d5c4b5e5959dc2c2b89918d8e2cc40fcdd623cef026ed09d2f0ee05199dc8e4" +checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" dependencies = [ "signature", ] @@ -547,9 +591,9 @@ dependencies = [ [[package]] name = "either" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "elliptic-curve" @@ -559,14 +603,25 @@ checksum = "beca177dcb8eb540133e7680baff45e7cc4d93bf22002676cec549f82343721b" dependencies = [ "crypto-bigint", "ff", - "generic-array 0.14.5", + "generic-array 0.14.6", "group", "pkcs8", - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", "zeroize", ] +[[package]] +name = "enum-kinds" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e40a16955681d469ab3da85aaa6b42ff656b3c67b52e1d8d3dd36afe97fd462" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "failure" version = "0.1.8" @@ -595,17 +650,18 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0f40b2dcd8bc322217a5f6559ae5f9e9d1de202a2ecee2e9eafcbece7562a4f" dependencies = [ - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", ] [[package]] name = "fixnum" -version = "0.6.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d83b4df6079ff2f20dfd4c4a13a5c326d985ae35e289df51ff95e71e76b7ada5" +checksum = "d7bb4d4380b82ea92dfa6df95e4dae07879d404e0e25aa44040744fe601221df" dependencies = [ "derive_more", + "itoa", "parity-scale-codec", "serde", "static_assertions", @@ -635,25 +691,24 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ - "matches", "percent-encoding", ] [[package]] name = "funty" -version = "1.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures-channel" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" dependencies = [ "futures-core", "futures-sink", @@ -661,27 +716,27 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" +checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" [[package]] name = "futures-sink" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" +checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" [[package]] name = "futures-task" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" +checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" [[package]] name = "futures-util" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" dependencies = [ "futures-core", "futures-sink", @@ -701,9 +756,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ "typenum", "version_check", @@ -724,13 +779,13 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ "cfg-if", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi 0.11.0+wasi-snapshot-preview1", ] [[package]] @@ -757,9 +812,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" [[package]] name = "group" @@ -768,15 +823,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c363a5301b8f153d80747126a04b3c82073b9fe3130571a9d170cacdeaf7912" dependencies = [ "ff", - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", ] [[package]] name = "h2" -version = "0.3.12" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62eeb471aa3e3c9197aa4bfeabfe02982f6dc96f750486c0bb0009ac58b26d2b" +checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" dependencies = [ "bytes", "fnv", @@ -793,15 +848,15 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "headers" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cff78e5788be1e0ab65b04d306b2ed5092c815ec97ec70f4ebd5aee158aa55d" +checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" dependencies = [ "base64", "bitflags", @@ -810,7 +865,7 @@ dependencies = [ "http", "httpdate", "mime", - "sha-1", + "sha1", ] [[package]] @@ -868,9 +923,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", @@ -879,9 +934,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", @@ -890,9 +945,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9100414882e15fb7feccb4897e5f0ff0ff1ca7d1a86a23208ada4d7a18e6c6c4" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -902,9 +957,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.18" +version = "0.14.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b26ae0a80afebe130861d90abf98e3814a4f28a4c6ffeb5ab8ebb2be311e0ef2" +checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" dependencies = [ "bytes", "futures-channel", @@ -924,6 +979,12 @@ dependencies = [ "want", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "impl-trait-for-tuples" version = "0.2.2" @@ -937,9 +998,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.8.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg 1.1.0", "hashbrown", @@ -953,12 +1014,14 @@ checksum = "b33c9a5c599d67d051c4dc25eb1b6b4ef715d1763c20c85c688717a1734f204e" [[package]] name = "iroha_crypto" -version = "2.0.0-pre-rc.5" -source = "git+https://github.com/hyperledger/iroha?rev=75da907f66d5270f407a50e06bc76cec41d3d409#75da907f66d5270f407a50e06bc76cec41d3d409" +version = "2.0.0-pre-rc.9" +source = "git+https://github.com/hyperledger/iroha.git?rev=b783f10fa7de26ed1fdd4c526bd162f8636f1a65#b783f10fa7de26ed1fdd4c526bd162f8636f1a65" dependencies = [ "derive_more", "getset", "hex", + "iroha_ffi", + "iroha_primitives", "iroha_schema", "parity-scale-codec", "serde", @@ -967,46 +1030,66 @@ dependencies = [ [[package]] name = "iroha_data_model" -version = "2.0.0-pre-rc.5" -source = "git+https://github.com/hyperledger/iroha?rev=75da907f66d5270f407a50e06bc76cec41d3d409#75da907f66d5270f407a50e06bc76cec41d3d409" +version = "2.0.0-pre-rc.9" +source = "git+https://github.com/hyperledger/iroha.git?rev=b783f10fa7de26ed1fdd4c526bd162f8636f1a65#b783f10fa7de26ed1fdd4c526bd162f8636f1a65" dependencies = [ + "base64", "dashmap", "derive_more", + "enum-kinds", "getset", "iroha_crypto", - "iroha_data_primitives", + "iroha_data_model_derive", + "iroha_ffi", "iroha_macro", + "iroha_primitives", "iroha_schema", "iroha_version", "parity-scale-codec", "serde", "serde_json", + "serde_with", "strum", "thiserror", "tokio", ] [[package]] -name = "iroha_data_primitives" -version = "2.0.0-pre-rc.5" -source = "git+https://github.com/hyperledger/iroha?rev=75da907f66d5270f407a50e06bc76cec41d3d409#75da907f66d5270f407a50e06bc76cec41d3d409" +name = "iroha_data_model_derive" +version = "2.0.0-pre-rc.9" +source = "git+https://github.com/hyperledger/iroha.git?rev=b783f10fa7de26ed1fdd4c526bd162f8636f1a65#b783f10fa7de26ed1fdd4c526bd162f8636f1a65" dependencies = [ - "derive_more", - "fixnum", - "iroha_macro", - "iroha_schema", - "parity-scale-codec", - "serde", - "smallstr", - "smallvec", - "thiserror", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "iroha_derive" -version = "2.0.0-pre-rc.5" -source = "git+https://github.com/hyperledger/iroha?rev=75da907f66d5270f407a50e06bc76cec41d3d409#75da907f66d5270f407a50e06bc76cec41d3d409" +version = "2.0.0-pre-rc.9" +source = "git+https://github.com/hyperledger/iroha.git?rev=b783f10fa7de26ed1fdd4c526bd162f8636f1a65#b783f10fa7de26ed1fdd4c526bd162f8636f1a65" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "iroha_ffi" +version = "2.0.0-pre-rc.9" +source = "git+https://github.com/hyperledger/iroha.git?rev=b783f10fa7de26ed1fdd4c526bd162f8636f1a65#b783f10fa7de26ed1fdd4c526bd162f8636f1a65" +dependencies = [ + "iroha_ffi_derive", +] + +[[package]] +name = "iroha_ffi_derive" +version = "2.0.0-pre-rc.9" +source = "git+https://github.com/hyperledger/iroha.git?rev=b783f10fa7de26ed1fdd4c526bd162f8636f1a65#b783f10fa7de26ed1fdd4c526bd162f8636f1a65" dependencies = [ + "derive_more", + "proc-macro-error", "proc-macro2", "quote", "syn", @@ -1014,16 +1097,33 @@ dependencies = [ [[package]] name = "iroha_macro" -version = "2.0.0-pre-rc.5" -source = "git+https://github.com/hyperledger/iroha?rev=75da907f66d5270f407a50e06bc76cec41d3d409#75da907f66d5270f407a50e06bc76cec41d3d409" +version = "2.0.0-pre-rc.9" +source = "git+https://github.com/hyperledger/iroha.git?rev=b783f10fa7de26ed1fdd4c526bd162f8636f1a65#b783f10fa7de26ed1fdd4c526bd162f8636f1a65" dependencies = [ "iroha_derive", ] +[[package]] +name = "iroha_primitives" +version = "2.0.0-pre-rc.9" +source = "git+https://github.com/hyperledger/iroha.git?rev=b783f10fa7de26ed1fdd4c526bd162f8636f1a65#b783f10fa7de26ed1fdd4c526bd162f8636f1a65" +dependencies = [ + "derive_more", + "fixnum", + "iroha_ffi", + "iroha_macro", + "iroha_schema", + "parity-scale-codec", + "serde", + "smallstr", + "smallvec", + "thiserror", +] + [[package]] name = "iroha_schema" -version = "2.0.0-pre-rc.5" -source = "git+https://github.com/hyperledger/iroha?rev=75da907f66d5270f407a50e06bc76cec41d3d409#75da907f66d5270f407a50e06bc76cec41d3d409" +version = "2.0.0-pre-rc.9" +source = "git+https://github.com/hyperledger/iroha.git?rev=b783f10fa7de26ed1fdd4c526bd162f8636f1a65#b783f10fa7de26ed1fdd4c526bd162f8636f1a65" dependencies = [ "fixnum", "iroha_schema_derive", @@ -1032,8 +1132,8 @@ dependencies = [ [[package]] name = "iroha_schema_derive" -version = "2.0.0-pre-rc.5" -source = "git+https://github.com/hyperledger/iroha?rev=75da907f66d5270f407a50e06bc76cec41d3d409#75da907f66d5270f407a50e06bc76cec41d3d409" +version = "2.0.0-pre-rc.9" +source = "git+https://github.com/hyperledger/iroha.git?rev=b783f10fa7de26ed1fdd4c526bd162f8636f1a65#b783f10fa7de26ed1fdd4c526bd162f8636f1a65" dependencies = [ "proc-macro2", "quote", @@ -1042,8 +1142,8 @@ dependencies = [ [[package]] name = "iroha_version" -version = "2.0.0-pre-rc.5" -source = "git+https://github.com/hyperledger/iroha?rev=75da907f66d5270f407a50e06bc76cec41d3d409#75da907f66d5270f407a50e06bc76cec41d3d409" +version = "2.0.0-pre-rc.9" +source = "git+https://github.com/hyperledger/iroha.git?rev=b783f10fa7de26ed1fdd4c526bd162f8636f1a65#b783f10fa7de26ed1fdd4c526bd162f8636f1a65" dependencies = [ "iroha_macro", "iroha_schema", @@ -1057,8 +1157,8 @@ dependencies = [ [[package]] name = "iroha_version_derive" -version = "2.0.0-pre-rc.5" -source = "git+https://github.com/hyperledger/iroha?rev=75da907f66d5270f407a50e06bc76cec41d3d409#75da907f66d5270f407a50e06bc76cec41d3d409" +version = "2.0.0-pre-rc.9" +source = "git+https://github.com/hyperledger/iroha.git?rev=b783f10fa7de26ed1fdd4c526bd162f8636f1a65#b783f10fa7de26ed1fdd4c526bd162f8636f1a65" dependencies = [ "proc-macro-error", "proc-macro2", @@ -1068,15 +1168,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" [[package]] name = "js-sys" -version = "0.3.56" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" dependencies = [ "wasm-bindgen", ] @@ -1095,9 +1195,9 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" +checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" [[package]] name = "lazy_static" @@ -1107,30 +1207,34 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.121" +version = "0.2.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efaa7b300f3b5fe8eb6bf21ce3895e1751d9665086af2d64b42f19701015ff4f" +checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" [[package]] -name = "log" -version = "0.4.16" +name = "lock_api" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" dependencies = [ - "cfg-if", + "autocfg 1.1.0", + "scopeguard", ] [[package]] -name = "matches" -version = "0.1.9" +name = "log" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] [[package]] name = "memchr" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memoffset" @@ -1159,35 +1263,23 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.4.4" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" dependencies = [ "adler", - "autocfg 1.1.0", ] [[package]] name = "mio" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" +checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" dependencies = [ "libc", "log", - "miow", - "ntapi", "wasi 0.11.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi", + "windows-sys", ] [[package]] @@ -1196,15 +1288,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4330eca86d39f2b52d0481aa1e90fe21bfa61f11b0bf9b48ab95595013cefe48" -[[package]] -name = "ntapi" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" -dependencies = [ - "winapi", -] - [[package]] name = "num_cpus" version = "1.13.1" @@ -1217,18 +1300,18 @@ dependencies = [ [[package]] name = "object" -version = "0.27.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.10.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" [[package]] name = "opaque-debug" @@ -1244,23 +1327,35 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.38" +version = "0.10.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" +checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" dependencies = [ "bitflags", "cfg-if", "foreign-types", "libc", "once_cell", + "openssl-macros", "openssl-sys", ] +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "openssl-sys" -version = "0.9.72" +version = "0.9.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb" +checksum = "5230151e44c0f05157effb743e8d517472843121cf9243e8b81393edb5acd9ce" dependencies = [ "autocfg 1.1.0", "cc", @@ -1271,9 +1366,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "2.3.1" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" +checksum = "366e44391a8af4cfd6002ef6ba072bae071a96aafca98d7d448a34c5dca38b6a" dependencies = [ "arrayvec", "bitvec", @@ -1285,9 +1380,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "2.3.1" +version = "3.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" +checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1295,26 +1390,39 @@ dependencies = [ "syn", ] +[[package]] +name = "parking_lot_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pin-project" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", @@ -1323,9 +1431,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "pin-utils" @@ -1345,9 +1453,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" [[package]] name = "poly1305" @@ -1378,10 +1486,11 @@ checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "proc-macro-crate" -version = "1.1.3" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" dependencies = [ + "once_cell", "thiserror", "toml", ] @@ -1412,27 +1521,27 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.17" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632d02bff7f874a36f33ea8bb416cd484b90cc66c1194b1a1110d067a7013f58" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] [[package]] name = "radium" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] name = "rand" @@ -1511,11 +1620,11 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.6", + "getrandom 0.2.7", ] [[package]] @@ -1577,9 +1686,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.5.1" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" dependencies = [ "autocfg 1.1.0", "crossbeam-deque", @@ -1589,34 +1698,60 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.1" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" dependencies = [ "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "lazy_static", "num_cpus", ] +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + [[package]] name = "rustc-demangle" version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustls-pemfile" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" +dependencies = [ + "base64", +] + [[package]] name = "rustversion" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" +checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" [[package]] name = "ryu" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" [[package]] name = "scoped-tls" @@ -1650,29 +1785,35 @@ dependencies = [ "cc", ] +[[package]] +name = "semver" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" + [[package]] name = "serde" -version = "1.0.136" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.5" +version = "0.11.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +checksum = "cfc50e8183eeeb6178dcb167ae34a8051d63535023ae38b5d8d12beae193d37b" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.136" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" dependencies = [ "proc-macro2", "quote", @@ -1681,9 +1822,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" +checksum = "41feea4228a6f1cd09ec7a3593a682276702cd67b5273544757dae23c096f074" dependencies = [ "itoa", "ryu", @@ -1703,14 +1844,36 @@ dependencies = [ ] [[package]] -name = "sha-1" -version = "0.10.0" +name = "serde_with" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +checksum = "368f2d60d049ea019a84dcd6687b0d1e0030fe663ae105039bdf967ed5e6a9a7" +dependencies = [ + "serde", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ccadfacf6cf10faad22bbadf55986bdd0856edfb5d9210aa1dcf1f516e84e93" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.3", + "digest 0.10.5", ] [[package]] @@ -1758,14 +1921,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2807892cfa58e081aa1f1111391c7a0649d4fa127a4ffbe34bcbfb35a1171a4" dependencies = [ "digest 0.9.0", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] name = "slab" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg 1.1.0", +] [[package]] name = "smallstr" @@ -1779,18 +1945,18 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" dependencies = [ "serde", ] [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", "winapi", @@ -1811,6 +1977,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strum" version = "0.24.1" @@ -1822,9 +1994,9 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.24.1" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9550962e7cf70d9980392878dfaf1dcc3ece024f4cf3bf3c46b978d0bad61d6c" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck", "proc-macro2", @@ -1850,13 +2022,13 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.90" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704df27628939572cd88d33f171cd6f896f4eaca85252c6e0a72d8d8287ee86f" +checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -1879,18 +2051,18 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "thiserror" -version = "1.0.30" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.30" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" dependencies = [ "proc-macro2", "quote", @@ -1899,20 +2071,22 @@ dependencies = [ [[package]] name = "time" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ "libc", + "wasi 0.10.0+wasi-snapshot-preview1", "winapi", ] [[package]] name = "tokio" -version = "1.17.0" +version = "1.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" dependencies = [ + "autocfg 1.1.0", "bytes", "libc", "memchr", @@ -1925,9 +2099,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.8" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" +checksum = "f6edf2d6bc038a43d31353570e27270603f4648d18f5ed10c0e179abe43255af" dependencies = [ "futures-core", "pin-project-lite", @@ -1936,38 +2110,38 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.9" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" dependencies = [ "bytes", "futures-core", "futures-sink", - "log", "pin-project-lite", "tokio", + "tracing", ] [[package]] name = "toml" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ "serde", ] [[package]] name = "tower-service" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.32" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a1bdf54a7c28a2bbf701e1d2233f6c77f473486b94bee4f9678da5a148dca7f" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "log", @@ -1977,11 +2151,11 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.23" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa31669fa42c09c34d94d8165dd2012e8ff3c66aca50f3bb226b68f216f2706c" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ - "lazy_static", + "once_cell", ] [[package]] @@ -2005,11 +2179,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "unicode-ident" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + [[package]] name = "unicode-xid" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "universal-hash" @@ -2017,7 +2197,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", "subtle", ] @@ -2084,9 +2264,9 @@ dependencies = [ [[package]] name = "warp" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cef4e1e9114a4b7f1ac799f16ce71c14de5778500c5450ec6b7b920c55b587e" +checksum = "ed7b8be92646fc3d18b06147664ebc5f48d222686cb11a8755e561a735aacc6d" dependencies = [ "bytes", "futures-channel", @@ -2099,6 +2279,7 @@ dependencies = [ "mime_guess", "percent-encoding", "pin-project", + "rustls-pemfile", "scoped-tls", "serde", "serde_json", @@ -2118,9 +2299,9 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.10.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasi" @@ -2130,9 +2311,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.79" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2140,13 +2321,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.79" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", "syn", @@ -2155,9 +2336,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.79" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2165,9 +2346,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.79" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2", "quote", @@ -2178,9 +2359,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.79" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" [[package]] name = "winapi" @@ -2204,11 +2385,57 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + [[package]] name = "wyz" -version = "0.2.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" +checksum = "30b31594f29d27036c383b53b59ed3476874d518f0efb151b27a4c275141390e" +dependencies = [ + "tap", +] [[package]] name = "x25519-dalek" diff --git a/packages/data-model-rust-samples/Cargo.toml b/packages/data-model-rust-samples/Cargo.toml index ca8eca5c..1f2cd04c 100644 --- a/packages/data-model-rust-samples/Cargo.toml +++ b/packages/data-model-rust-samples/Cargo.toml @@ -7,8 +7,8 @@ edition = "2021" [dependencies] # git source should be in sync with the ref used for data-model compilation -iroha_data_model = { git = 'https://github.com/hyperledger/iroha', rev = '75da907f66d5270f407a50e06bc76cec41d3d409' } +iroha_data_model = { git = 'https://github.com/hyperledger/iroha.git', rev = "b783f10fa7de26ed1fdd4c526bd162f8636f1a65" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -parity-scale-codec = "2.3.1" +parity-scale-codec = "3.2.1" diff --git a/packages/data-model-rust-samples/output.json b/packages/data-model-rust-samples/output.json index 4cd31064..186016d2 100644 --- a/packages/data-model-rust-samples/output.json +++ b/packages/data-model-rust-samples/output.json @@ -12,11 +12,11 @@ "encoded": "0c 48 65 79" }, "Event-based Trigger ISI": { - "debug": "RegisterBox { object: EvaluatesTo { expression: Raw(Identifiable(Trigger(Trigger { id: Id { name: \"mint_rose\" }, action: Action { executable: Instructions([Mint(MintBox { object: EvaluatesTo { expression: Raw(U32(1)), _value_type: PhantomData }, destination_id: EvaluatesTo { expression: Raw(Id(AssetId(Id { definition_id: DefinitionId { name: \"rose\", domain_id: Id { name: \"wonderland\" } }, account_id: Id { name: \"alice\", domain_id: Id { name: \"wonderland\" } } }))), _value_type: PhantomData } })]), repeats: Indefinitely, technical_account: Id { name: \"alice\", domain_id: Id { name: \"wonderland\" } }, filter: Data(BySome(ByAssetDefinition(BySome(AssetDefinitionFilter { id_filter: AcceptAll, event_filter: BySome(ByCreated) })))), metadata: Metadata { map: {} } } }))), _value_type: PhantomData } }", - "encoded": "0d 09 09 24 6d 69 6e 74 5f 72 6f 73 65 00 04 02 0d 00 01 00 00 00 0d 08 03 10 72 6f 73 65 28 77 6f 6e 64 65 72 6c 61 6e 64 14 61 6c 69 63 65 28 77 6f 6e 64 65 72 6c 61 6e 64 00 14 61 6c 69 63 65 28 77 6f 6e 64 65 72 6c 61 6e 64 01 01 03 01 00 01 00 00" + "debug": "RegisterBox { object: EvaluatesTo { expression: Raw(Identifiable(Trigger(Trigger { id: Id { name: \"mint_rose\", domain_id: None }, action: Action { executable: Instructions([Mint(MintBox { object: EvaluatesTo { expression: Raw(U32(1)), _value_type: PhantomData }, destination_id: EvaluatesTo { expression: Raw(Id(AssetId(Id { definition_id: DefinitionId { name: \"rose\", domain_id: Id { name: \"wonderland\" } }, account_id: Id { name: \"alice\", domain_id: Id { name: \"wonderland\" } } }))), _value_type: PhantomData } })]), repeats: Indefinitely, technical_account: Id { name: \"alice\", domain_id: Id { name: \"wonderland\" } }, filter: Data(BySome(ByAssetDefinition(BySome(AssetDefinitionFilter { origin_filter: AcceptAll, event_filter: BySome(ByCreated) })))), metadata: Metadata { map: {} } } }))), _value_type: PhantomData } }", + "encoded": "0d 09 09 24 6d 69 6e 74 5f 72 6f 73 65 00 00 04 02 0d 00 01 00 00 00 0d 08 03 10 72 6f 73 65 28 77 6f 6e 64 65 72 6c 61 6e 64 14 61 6c 69 63 65 28 77 6f 6e 64 65 72 6c 61 6e 64 00 14 61 6c 69 63 65 28 77 6f 6e 64 65 72 6c 61 6e 64 01 01 03 01 00 01 00 00" }, "Time-based Trigger ISI": { - "debug": "RegisterBox { object: EvaluatesTo { expression: Raw(Identifiable(Trigger(Trigger { id: Id { name: \"mint_rose\" }, action: Action { executable: Instructions([Mint(MintBox { object: EvaluatesTo { expression: Raw(U32(1)), _value_type: PhantomData }, destination_id: EvaluatesTo { expression: Raw(Id(AssetId(Id { definition_id: DefinitionId { name: \"rose\", domain_id: Id { name: \"wonderland\" } }, account_id: Id { name: \"alice\", domain_id: Id { name: \"wonderland\" } } }))), _value_type: PhantomData } })]), repeats: Indefinitely, technical_account: Id { name: \"alice\", domain_id: Id { name: \"wonderland\" } }, filter: Time(EventFilter(Schedule(Schedule { start: 4141203402341234s, period: Some(3s) }))), metadata: Metadata { map: {} } } }))), _value_type: PhantomData } }", - "encoded": "0d 09 09 24 6d 69 6e 74 5f 72 6f 73 65 00 04 02 0d 00 01 00 00 00 0d 08 03 10 72 6f 73 65 28 77 6f 6e 64 65 72 6c 61 6e 64 14 61 6c 69 63 65 28 77 6f 6e 64 65 72 6c 61 6e 64 00 14 61 6c 69 63 65 28 77 6f 6e 64 65 72 6c 61 6e 64 02 01 72 3b bd 0d 67 b6 0e 00 00 00 00 00 01 03 00 00 00 00 00 00 00 00 00 00 00 00" + "debug": "RegisterBox { object: EvaluatesTo { expression: Raw(Identifiable(Trigger(Trigger { id: Id { name: \"mint_rose\", domain_id: None }, action: Action { executable: Instructions([Mint(MintBox { object: EvaluatesTo { expression: Raw(U32(1)), _value_type: PhantomData }, destination_id: EvaluatesTo { expression: Raw(Id(AssetId(Id { definition_id: DefinitionId { name: \"rose\", domain_id: Id { name: \"wonderland\" } }, account_id: Id { name: \"alice\", domain_id: Id { name: \"wonderland\" } } }))), _value_type: PhantomData } })]), repeats: Indefinitely, technical_account: Id { name: \"alice\", domain_id: Id { name: \"wonderland\" } }, filter: Time(EventFilter(Schedule(Schedule { start: 4141203402341234s, period: Some(3s) }))), metadata: Metadata { map: {} } } }))), _value_type: PhantomData } }", + "encoded": "0d 09 09 24 6d 69 6e 74 5f 72 6f 73 65 00 00 04 02 0d 00 01 00 00 00 0d 08 03 10 72 6f 73 65 28 77 6f 6e 64 65 72 6c 61 6e 64 14 61 6c 69 63 65 28 77 6f 6e 64 65 72 6c 61 6e 64 00 14 61 6c 69 63 65 28 77 6f 6e 64 65 72 6c 61 6e 64 02 01 72 3b bd 0d 67 b6 0e 00 00 00 00 00 01 03 00 00 00 00 00 00 00 00 00 00 00 00" } } diff --git a/packages/data-model-rust-samples/src/main.rs b/packages/data-model-rust-samples/src/main.rs index 86c43239..d576f450 100644 --- a/packages/data-model-rust-samples/src/main.rs +++ b/packages/data-model-rust-samples/src/main.rs @@ -83,7 +83,7 @@ fn create_some_time_based_trigger_isi() -> RegisterBox { AccountId::from_str("alice@wonderland").unwrap(), ); - RegisterBox::new(IdentifiableBox::from(Trigger::new( + RegisterBox::new(Trigger::new( TriggerId::from_str("mint_rose").unwrap(), Action::new( Executable::from(vec![MintBox::new(1_u32, asset_id.clone()).into()]), @@ -94,7 +94,7 @@ fn create_some_time_based_trigger_isi() -> RegisterBox { .with_period(Duration::from_millis(3_000)), ))), ), - ))) + )) } fn create_some_event_based_trigger_isi() -> RegisterBox { @@ -103,7 +103,7 @@ fn create_some_event_based_trigger_isi() -> RegisterBox { let asset_id = AssetId::new(asset_definition_id, account_id.clone()); let instruction = MintBox::new(1_u32, asset_id.clone()); - RegisterBox::new(IdentifiableBox::from(Trigger::new( + RegisterBox::new(Trigger::new( TriggerId::from_str("mint_rose").unwrap(), Action::new( Executable::from(vec![instruction.into()]), @@ -116,5 +116,5 @@ fn create_some_event_based_trigger_isi() -> RegisterBox { ), )))), ), - ))) + )) } diff --git a/packages/data-model-schema/CHANGELOG.md b/packages/data-model-schema/CHANGELOG.md index dadd9d08..3a2878e1 100644 --- a/packages/data-model-schema/CHANGELOG.md +++ b/packages/data-model-schema/CHANGELOG.md @@ -1,5 +1,16 @@ # @iroha2/data-model-schema +## 4.0.0 + +### Major Changes + +- e27467e: Update data model to align it with the updated model in the upcoming Iroha 2 LTS. + + Notable changes: + + - `Transaction` → `SignedTransaction` + - `VersionedTransaction` → `VersionedSignedTransaction` + ## 3.0.0 ### Patch Changes diff --git a/packages/data-model-schema/package.json b/packages/data-model-schema/package.json index 32d99617..6e58157a 100644 --- a/packages/data-model-schema/package.json +++ b/packages/data-model-schema/package.json @@ -1,6 +1,6 @@ { "name": "@iroha2/data-model-schema", - "version": "3.0.0", + "version": "4.0.0", "description": "Data model schema related utilities", "main": "src/lib.ts", "files": [ diff --git a/packages/data-model-schema/src/__schema__.json b/packages/data-model-schema/src/__schema__.json index 15ff2622..f33b19ec 100644 --- a/packages/data-model-schema/src/__schema__.json +++ b/packages/data-model-schema/src/__schema__.json @@ -33,13 +33,6 @@ "sorted_by_key": true } }, - "Map>": { - "Map": { - "key": "iroha_crypto::PublicKey", - "value": "iroha_crypto::signature::SignatureOf", - "sorted_by_key": true - } - }, "Map>": { "Map": { "key": "iroha_crypto::PublicKey", @@ -75,6 +68,13 @@ "sorted_by_key": true } }, + "Map": { + "Map": { + "key": "iroha_data_model::name::Name", + "value": "iroha_data_model::ValueKind", + "sorted_by_key": true + } + }, "Option": { "Option": "Duration" }, @@ -84,6 +84,9 @@ "Option": { "Option": "iroha_crypto::hash::Hash" }, + "Option": { + "Option": "iroha_data_model::domain::Id" + }, "Option": { "Option": "iroha_data_model::domain::IpfsPath" }, @@ -99,6 +102,9 @@ "Option": { "Option": "iroha_data_model::isi::Instruction" }, + "Option": { + "Option": "iroha_data_model::name::Name" + }, "Option": { "Option": "u32" }, @@ -109,12 +115,6 @@ "sorted": false } }, - "Vec": { - "Vec": { - "ty": "iroha_core::sumeragi::view_change::Proof", - "sorted": false - } - }, "Vec": { "Vec": { "ty": "iroha_crypto::PublicKey", @@ -127,12 +127,6 @@ "sorted": false } }, - "Vec>": { - "Vec": { - "ty": "iroha_crypto::hash::HashOf", - "sorted": false - } - }, "Vec>": { "Vec": { "ty": "iroha_crypto::signature::SignatureOf", @@ -169,9 +163,9 @@ "sorted": false } }, - "Vec": { + "Vec": { "Vec": { - "ty": "iroha_data_model::permissions::PermissionToken", + "ty": "iroha_data_model::permission::token::Token", "sorted": true } }, @@ -205,6 +199,27 @@ "sorted": false } }, + "[iroha_data_model::predicate::numerical::Interval; 8]": { + "Array": { + "ty": "iroha_data_model::predicate::numerical::Interval", + "len": 8, + "sorted": false + } + }, + "[iroha_data_model::predicate::numerical::Interval; 4]": { + "Array": { + "ty": "iroha_data_model::predicate::numerical::Interval", + "len": 4, + "sorted": false + } + }, + "[u16; 8]": { + "Array": { + "ty": "u16", + "len": 8, + "sorted": false + } + }, "[u8; 32]": { "Array": { "ty": "u8", @@ -212,6 +227,13 @@ "sorted": false } }, + "[u8; 4]": { + "Array": { + "ty": "u8", + "len": 4, + "sorted": false + } + }, "bool": "Bool", "i64": { "Int": "FixedWidth" @@ -237,19 +259,11 @@ }, { "name": "transactions_hash", - "ty": "iroha_crypto::hash::HashOf>" + "ty": "iroha_crypto::hash::HashOf>" }, { "name": "rejected_transactions_hash", - "ty": "iroha_crypto::hash::HashOf>" - }, - { - "name": "view_change_proofs", - "ty": "iroha_core::sumeragi::view_change::ProofChain" - }, - { - "name": "invalidated_blocks_hashes", - "ty": "Vec>" + "ty": "iroha_crypto::hash::HashOf>" }, { "name": "genesis_topology", @@ -442,7 +456,7 @@ { "name": "Transaction", "discriminant": 6, - "ty": "iroha_crypto::hash::HashOf" + "ty": "iroha_crypto::hash::HashOf" }, { "name": "Context", @@ -463,62 +477,16 @@ "name": "Role", "discriminant": 10, "ty": "iroha_data_model::role::Id" - } - ] - } - }, - "iroha_core::smartcontracts::isi::error::Mismatch": { - "Struct": { - "declarations": [ - { - "name": "expected", - "ty": "iroha_core::smartcontracts::isi::permissions::ValidatorType" - }, - { - "name": "actual", - "ty": "iroha_core::smartcontracts::isi::permissions::ValidatorType" - } - ] - } - }, - "iroha_core::smartcontracts::isi::permissions::ValidatorType": { - "Enum": { - "variants": [ - { - "name": "Instruction", - "discriminant": 0, - "ty": null - }, - { - "name": "Query", - "discriminant": 1, - "ty": null - }, - { - "name": "Expression", - "discriminant": 2, - "ty": null - } - ] - } - }, - "iroha_core::smartcontracts::isi::permissions::error::DenialReason": { - "Enum": { - "variants": [ - { - "name": "ValidatorTypeMismatch", - "discriminant": 0, - "ty": "iroha_core::smartcontracts::isi::error::Mismatch" }, { - "name": "Custom", - "discriminant": 1, - "ty": "String" + "name": "PermissionTokenDefinition", + "discriminant": 11, + "ty": "iroha_data_model::permission::token::Id" }, { - "name": "NoValidatorsProvided", - "discriminant": 2, - "ty": null + "name": "Validator", + "discriminant": 12, + "ty": "iroha_data_model::permission::validator::Id" } ] } @@ -539,7 +507,7 @@ { "name": "Permission", "discriminant": 2, - "ty": "iroha_core::smartcontracts::isi::permissions::error::DenialReason" + "ty": "String" }, { "name": "Evaluate", @@ -555,6 +523,11 @@ "name": "Conversion", "discriminant": 5, "ty": "String" + }, + { + "name": "Unauthorized", + "discriminant": 6, + "ty": null } ] } @@ -569,93 +542,6 @@ { "name": "at_block", "ty": "iroha_crypto::hash::HashOf" - }, - { - "name": "view_change_proofs", - "ty": "iroha_core::sumeragi::view_change::ProofChain" - } - ] - } - }, - "iroha_core::sumeragi::view_change::BlockCreationTimeout": { - "Tuple": { - "types": [] - } - }, - "iroha_core::sumeragi::view_change::CommitTimeout": { - "Struct": { - "declarations": [ - { - "name": "hash", - "ty": "iroha_crypto::hash::HashOf" - } - ] - } - }, - "iroha_core::sumeragi::view_change::NoTransactionReceiptReceived": { - "Tuple": { - "types": [] - } - }, - "iroha_core::sumeragi::view_change::Proof": { - "Struct": { - "declarations": [ - { - "name": "payload", - "ty": "iroha_core::sumeragi::view_change::ProofPayload" - }, - { - "name": "signatures", - "ty": "iroha_crypto::signature::SignaturesOf" - } - ] - } - }, - "iroha_core::sumeragi::view_change::ProofChain": { - "Struct": { - "declarations": [ - { - "name": "proofs", - "ty": "Vec" - } - ] - } - }, - "iroha_core::sumeragi::view_change::ProofPayload": { - "Struct": { - "declarations": [ - { - "name": "previous_proof", - "ty": "iroha_crypto::hash::HashOf" - }, - { - "name": "latest_block", - "ty": "iroha_crypto::hash::HashOf" - }, - { - "name": "reason", - "ty": "iroha_core::sumeragi::view_change::Reason" - } - ] - } - }, - "iroha_core::sumeragi::view_change::Reason": { - "Enum": { - "variants": [ - { - "name": "CommitTimeout", - "discriminant": 0, - "ty": "iroha_core::sumeragi::view_change::CommitTimeout" - }, - { - "name": "NoTransactionReceiptReceived", - "discriminant": 1, - "ty": "iroha_core::sumeragi::view_change::NoTransactionReceiptReceived" - }, - { - "name": "BlockCreationTimeout", - "discriminant": 2, - "ty": "iroha_core::sumeragi::view_change::BlockCreationTimeout" } ] } @@ -688,38 +574,24 @@ ] } }, - "iroha_crypto::hash::HashOf": { - "Tuple": { - "types": [ - "iroha_crypto::hash::Hash" - ] - } - }, - "iroha_crypto::hash::HashOf": { - "Tuple": { - "types": [ - "iroha_crypto::hash::Hash" - ] - } - }, - "iroha_crypto::hash::HashOf>": { + "iroha_crypto::hash::HashOf>": { "Tuple": { "types": [ "iroha_crypto::hash::Hash" ] } }, - "iroha_crypto::hash::HashOf": { + "iroha_crypto::hash::HashOf": { "Tuple": { "types": [ "iroha_crypto::hash::Hash" ] } }, - "iroha_crypto::merkle::MerkleTree": { + "iroha_crypto::merkle::MerkleTree": { "Vec": { - "ty": "iroha_crypto::hash::HashOf", - "sorted": true + "ty": "iroha_crypto::hash::HashOf", + "sorted": false } }, "iroha_crypto::signature::Signature": { @@ -750,13 +622,6 @@ ] } }, - "iroha_crypto::signature::SignatureOf": { - "Tuple": { - "types": [ - "iroha_crypto::signature::Signature" - ] - } - }, "iroha_crypto::signature::SignatureOf": { "Tuple": { "types": [ @@ -781,16 +646,6 @@ ] } }, - "iroha_crypto::signature::SignaturesOf": { - "Struct": { - "declarations": [ - { - "name": "signatures", - "ty": "Map>" - } - ] - } - }, "iroha_crypto::signature::SignaturesOf": { "Struct": { "declarations": [ @@ -838,6 +693,16 @@ "name": "RoleId", "discriminant": 6, "ty": "iroha_data_model::role::Id" + }, + { + "name": "PermissionTokenDefinitionId", + "discriminant": 7, + "ty": "iroha_data_model::permission::token::Id" + }, + { + "name": "ValidatorId", + "discriminant": 8, + "ty": "iroha_data_model::permission::validator::Id" } ] } @@ -899,6 +764,16 @@ "name": "Role", "discriminant": 10, "ty": "iroha_data_model::role::Role" + }, + { + "name": "PermissionTokenDefinition", + "discriminant": 11, + "ty": "iroha_data_model::permission::token::Definition" + }, + { + "name": "Validator", + "discriminant": 12, + "ty": "iroha_data_model::permission::validator::Validator" } ] } @@ -966,6 +841,16 @@ "name": "Role", "discriminant": 6, "ty": "iroha_data_model::role::NewRole" + }, + { + "name": "PermissionTokenDefinition", + "discriminant": 7, + "ty": "iroha_data_model::permission::token::Definition" + }, + { + "name": "Validator", + "discriminant": 8, + "ty": "iroha_data_model::permission::validator::Validator" } ] } @@ -1001,7 +886,7 @@ { "name": "Fixed", "discriminant": 5, - "ty": "iroha_data_primitives::fixed::Fixed" + "ty": "iroha_primitives::fixed::Fixed" }, { "name": "Vec", @@ -1044,56 +929,183 @@ "ty": "iroha_data_model::transaction::TransactionValue" }, { - "name": "PermissionToken", + "name": "TransactionQueryResult", "discriminant": 14, - "ty": "iroha_data_model::permissions::PermissionToken" + "ty": "iroha_data_model::transaction::TransactionQueryResult" }, { - "name": "Hash", + "name": "PermissionToken", "discriminant": 15, + "ty": "iroha_data_model::permission::token::Token" + }, + { + "name": "Hash", + "discriminant": 16, "ty": "iroha_crypto::hash::Hash" }, { "name": "Block", - "discriminant": 16, + "discriminant": 17, "ty": "iroha_data_model::block_value::BlockValue" + }, + { + "name": "BlockHeader", + "discriminant": 18, + "ty": "iroha_data_model::block_value::BlockHeaderValue" + }, + { + "name": "Ipv4Addr", + "discriminant": 19, + "ty": "iroha_primitives::addr::Ipv4Addr" + }, + { + "name": "Ipv6Addr", + "discriminant": 20, + "ty": "iroha_primitives::addr::Ipv6Addr" } ] } }, - "iroha_data_model::account::Account": { - "Struct": { - "declarations": [ + "iroha_data_model::ValueKind": { + "Enum": { + "variants": [ { - "name": "id", - "ty": "iroha_data_model::account::Id" + "name": "U32", + "discriminant": 0, + "ty": null }, { - "name": "assets", - "ty": "Map" + "name": "U128", + "discriminant": 1, + "ty": null }, { - "name": "signatories", - "ty": "Vec" + "name": "Bool", + "discriminant": 2, + "ty": null }, { - "name": "permission_tokens", - "ty": "Vec" + "name": "String", + "discriminant": 3, + "ty": null }, { - "name": "signature_check_condition", - "ty": "iroha_data_model::account::SignatureCheckCondition" + "name": "Name", + "discriminant": 4, + "ty": null }, { - "name": "metadata", - "ty": "iroha_data_model::metadata::Metadata" + "name": "Fixed", + "discriminant": 5, + "ty": null }, { - "name": "roles", - "ty": "Vec" - } - ] - } + "name": "Vec", + "discriminant": 6, + "ty": null + }, + { + "name": "LimitedMetadata", + "discriminant": 7, + "ty": null + }, + { + "name": "Id", + "discriminant": 8, + "ty": null + }, + { + "name": "Identifiable", + "discriminant": 9, + "ty": null + }, + { + "name": "PublicKey", + "discriminant": 10, + "ty": null + }, + { + "name": "Parameter", + "discriminant": 11, + "ty": null + }, + { + "name": "SignatureCheckCondition", + "discriminant": 12, + "ty": null + }, + { + "name": "TransactionValue", + "discriminant": 13, + "ty": null + }, + { + "name": "TransactionQueryResult", + "discriminant": 14, + "ty": null + }, + { + "name": "PermissionToken", + "discriminant": 15, + "ty": null + }, + { + "name": "Hash", + "discriminant": 16, + "ty": null + }, + { + "name": "Block", + "discriminant": 17, + "ty": null + }, + { + "name": "BlockHeader", + "discriminant": 18, + "ty": null + }, + { + "name": "Ipv4Addr", + "discriminant": 19, + "ty": null + }, + { + "name": "Ipv6Addr", + "discriminant": 20, + "ty": null + } + ] + } + }, + "iroha_data_model::account::Account": { + "Struct": { + "declarations": [ + { + "name": "id", + "ty": "iroha_data_model::account::Id" + }, + { + "name": "assets", + "ty": "Map" + }, + { + "name": "signatories", + "ty": "Vec" + }, + { + "name": "signature_check_condition", + "ty": "iroha_data_model::account::SignatureCheckCondition" + }, + { + "name": "metadata", + "ty": "iroha_data_model::metadata::Metadata" + }, + { + "name": "roles", + "ty": "Vec" + } + ] + } }, "iroha_data_model::account::Id": { "Struct": { @@ -1200,7 +1212,7 @@ { "name": "Fixed", "discriminant": 2, - "ty": "iroha_data_primitives::fixed::Fixed" + "ty": "iroha_primitives::fixed::Fixed" }, { "name": "Store", @@ -1324,11 +1336,11 @@ }, { "name": "transactions_hash", - "ty": "iroha_crypto::hash::HashOf>" + "ty": "iroha_crypto::hash::HashOf>" }, { "name": "rejected_transactions_hash", - "ty": "iroha_crypto::hash::HashOf>" + "ty": "iroha_crypto::hash::HashOf>" }, { "name": "invalidated_blocks_hashes", @@ -1567,6 +1579,16 @@ "name": "Role", "discriminant": 6, "ty": "iroha_data_model::events::data::events::role::RoleEvent" + }, + { + "name": "PermissionToken", + "discriminant": 7, + "ty": "iroha_data_model::events::data::events::permission::PermissionTokenEvent" + }, + { + "name": "PermissionValidator", + "discriminant": 8, + "ty": "iroha_data_model::events::data::events::permission::PermissionValidatorEvent" } ] } @@ -1632,6 +1654,81 @@ ] } }, + "iroha_data_model::events::data::events::account::AccountEventFilter": { + "Enum": { + "variants": [ + { + "name": "ByCreated", + "discriminant": 0, + "ty": null + }, + { + "name": "ByDeleted", + "discriminant": 1, + "ty": null + }, + { + "name": "ByAuthenticationAdded", + "discriminant": 2, + "ty": null + }, + { + "name": "ByAuthenticationRemoved", + "discriminant": 3, + "ty": null + }, + { + "name": "ByPermissionAdded", + "discriminant": 4, + "ty": null + }, + { + "name": "ByPermissionRemoved", + "discriminant": 5, + "ty": null + }, + { + "name": "ByRoleRevoked", + "discriminant": 6, + "ty": null + }, + { + "name": "ByRoleGranted", + "discriminant": 7, + "ty": null + }, + { + "name": "ByMetadataInserted", + "discriminant": 8, + "ty": null + }, + { + "name": "ByMetadataRemoved", + "discriminant": 9, + "ty": null + }, + { + "name": "ByAsset", + "discriminant": 10, + "ty": "iroha_data_model::events::data::filters::FilterOpt" + } + ] + } + }, + "iroha_data_model::events::data::events::account::AccountFilter": { + "Struct": { + "declarations": [ + { + "name": "origin_filter", + "ty": "iroha_data_model::events::data::filters::FilterOpt>" + }, + { + "name": "event_filter", + "ty": "iroha_data_model::events::data::filters::FilterOpt" + } + ] + } + }, "iroha_data_model::events::data::events::asset::AssetDefinitionEvent": { "Enum": { "variants": [ @@ -1663,6 +1760,51 @@ ] } }, + "iroha_data_model::events::data::events::asset::AssetDefinitionEventFilter": { + "Enum": { + "variants": [ + { + "name": "ByCreated", + "discriminant": 0, + "ty": null + }, + { + "name": "ByMintabilityChanged", + "discriminant": 1, + "ty": null + }, + { + "name": "ByDeleted", + "discriminant": 2, + "ty": null + }, + { + "name": "ByMetadataInserted", + "discriminant": 3, + "ty": null + }, + { + "name": "ByMetadataRemoved", + "discriminant": 4, + "ty": null + } + ] + } + }, + "iroha_data_model::events::data::events::asset::AssetDefinitionFilter": { + "Struct": { + "declarations": [ + { + "name": "origin_filter", + "ty": "iroha_data_model::events::data::filters::FilterOpt>" + }, + { + "name": "event_filter", + "ty": "iroha_data_model::events::data::filters::FilterOpt" + } + ] + } + }, "iroha_data_model::events::data::events::asset::AssetEvent": { "Enum": { "variants": [ @@ -1699,286 +1841,398 @@ ] } }, - "iroha_data_model::events::data::events::domain::DomainEvent": { + "iroha_data_model::events::data::events::asset::AssetEventFilter": { "Enum": { "variants": [ { - "name": "Account", + "name": "ByCreated", "discriminant": 0, - "ty": "iroha_data_model::events::data::events::account::AccountEvent" + "ty": null }, { - "name": "AssetDefinition", + "name": "ByDeleted", "discriminant": 1, - "ty": "iroha_data_model::events::data::events::asset::AssetDefinitionEvent" + "ty": null }, { - "name": "Created", + "name": "ByAdded", "discriminant": 2, - "ty": "iroha_data_model::domain::Id" + "ty": null }, { - "name": "Deleted", + "name": "ByRemoved", "discriminant": 3, - "ty": "iroha_data_model::domain::Id" + "ty": null }, { - "name": "MetadataInserted", + "name": "ByMetadataInserted", "discriminant": 4, - "ty": "iroha_data_model::domain::Id" + "ty": null }, { - "name": "MetadataRemoved", + "name": "ByMetadataRemoved", "discriminant": 5, - "ty": "iroha_data_model::domain::Id" + "ty": null } ] } }, - "iroha_data_model::events::data::events::peer::PeerEvent": { - "Enum": { - "variants": [ + "iroha_data_model::events::data::events::asset::AssetFilter": { + "Struct": { + "declarations": [ { - "name": "Added", - "discriminant": 0, - "ty": "iroha_data_model::peer::Id" + "name": "origin_filter", + "ty": "iroha_data_model::events::data::filters::FilterOpt>" }, { - "name": "Removed", - "discriminant": 1, - "ty": "iroha_data_model::peer::Id" + "name": "event_filter", + "ty": "iroha_data_model::events::data::filters::FilterOpt" } ] } }, - "iroha_data_model::events::data::events::role::RoleEvent": { + "iroha_data_model::events::data::events::domain::DomainEvent": { "Enum": { "variants": [ { - "name": "Created", + "name": "Account", "discriminant": 0, - "ty": "iroha_data_model::role::Id" + "ty": "iroha_data_model::events::data::events::account::AccountEvent" }, { - "name": "Deleted", + "name": "AssetDefinition", "discriminant": 1, - "ty": "iroha_data_model::role::Id" - } - ] - } - }, - "iroha_data_model::events::data::events::trigger::TriggerEvent": { - "Enum": { - "variants": [ + "ty": "iroha_data_model::events::data::events::asset::AssetDefinitionEvent" + }, { "name": "Created", - "discriminant": 0, - "ty": "iroha_data_model::trigger::Id" + "discriminant": 2, + "ty": "iroha_data_model::domain::Id" }, { "name": "Deleted", - "discriminant": 1, - "ty": "iroha_data_model::trigger::Id" + "discriminant": 3, + "ty": "iroha_data_model::domain::Id" }, { - "name": "Extended", - "discriminant": 2, - "ty": "iroha_data_model::trigger::Id" + "name": "MetadataInserted", + "discriminant": 4, + "ty": "iroha_data_model::domain::Id" }, { - "name": "Shortened", - "discriminant": 3, - "ty": "iroha_data_model::trigger::Id" + "name": "MetadataRemoved", + "discriminant": 5, + "ty": "iroha_data_model::domain::Id" } ] } }, - "iroha_data_model::events::data::filters::EntityFilter": { + "iroha_data_model::events::data::events::domain::DomainEventFilter": { "Enum": { "variants": [ { - "name": "ByPeer", + "name": "ByCreated", "discriminant": 0, - "ty": "iroha_data_model::events::data::filters::FilterOpt" + "ty": null }, { - "name": "ByDomain", + "name": "ByDeleted", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::FilterOpt" + "ty": null }, { - "name": "ByAccount", + "name": "ByMetadataInserted", "discriminant": 2, - "ty": "iroha_data_model::events::data::filters::FilterOpt" + "ty": null }, { - "name": "ByAssetDefinition", + "name": "ByMetadataRemoved", "discriminant": 3, - "ty": "iroha_data_model::events::data::filters::FilterOpt" + "ty": null }, { - "name": "ByAsset", + "name": "ByAccount", "discriminant": 4, - "ty": "iroha_data_model::events::data::filters::FilterOpt" + "ty": "iroha_data_model::events::data::filters::FilterOpt" }, { - "name": "ByTrigger", + "name": "ByAssetDefinition", "discriminant": 5, - "ty": "iroha_data_model::events::data::filters::FilterOpt" + "ty": "iroha_data_model::events::data::filters::FilterOpt" + } + ] + } + }, + "iroha_data_model::events::data::events::domain::DomainFilter": { + "Struct": { + "declarations": [ + { + "name": "origin_filter", + "ty": "iroha_data_model::events::data::filters::FilterOpt>" }, { - "name": "ByRole", - "discriminant": 6, - "ty": "iroha_data_model::events::data::filters::FilterOpt" + "name": "event_filter", + "ty": "iroha_data_model::events::data::filters::FilterOpt" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt": { + "iroha_data_model::events::data::events::peer::PeerEvent": { "Enum": { "variants": [ { - "name": "AcceptAll", + "name": "Added", "discriminant": 0, - "ty": null + "ty": "iroha_data_model::peer::Id" }, { - "name": "BySome", + "name": "Removed", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::EntityFilter" + "ty": "iroha_data_model::peer::Id" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt>": { + "iroha_data_model::events::data::events::peer::PeerEventFilter": { "Enum": { "variants": [ { - "name": "AcceptAll", + "name": "ByAdded", "discriminant": 0, "ty": null }, { - "name": "BySome", + "name": "ByRemoved", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::IdFilter" + "ty": null } ] } }, - "iroha_data_model::events::data::filters::FilterOpt>": { + "iroha_data_model::events::data::events::peer::PeerFilter": { + "Struct": { + "declarations": [ + { + "name": "origin_filter", + "ty": "iroha_data_model::events::data::filters::FilterOpt>" + }, + { + "name": "event_filter", + "ty": "iroha_data_model::events::data::filters::FilterOpt" + } + ] + } + }, + "iroha_data_model::events::data::events::permission::PermissionTokenEvent": { "Enum": { "variants": [ { - "name": "AcceptAll", + "name": "DefinitionCreated", "discriminant": 0, - "ty": null + "ty": "iroha_data_model::permission::token::Definition" }, { - "name": "BySome", + "name": "DefinitionDeleted", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::IdFilter" + "ty": "iroha_data_model::permission::token::Definition" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt>": { + "iroha_data_model::events::data::events::permission::PermissionValidatorEvent": { "Enum": { "variants": [ { - "name": "AcceptAll", + "name": "Added", "discriminant": 0, - "ty": null + "ty": "iroha_data_model::permission::validator::Id" }, { - "name": "BySome", + "name": "Removed", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::IdFilter" + "ty": "iroha_data_model::permission::validator::Id" + } + ] + } + }, + "iroha_data_model::events::data::events::role::PermissionRemoved": { + "Struct": { + "declarations": [ + { + "name": "role_id", + "ty": "iroha_data_model::role::Id" + }, + { + "name": "permission_definition_id", + "ty": "iroha_data_model::permission::token::Id" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt>": { + "iroha_data_model::events::data::events::role::RoleEvent": { "Enum": { "variants": [ { - "name": "AcceptAll", + "name": "Created", "discriminant": 0, - "ty": null + "ty": "iroha_data_model::role::Id" }, { - "name": "BySome", + "name": "Deleted", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::IdFilter" + "ty": "iroha_data_model::role::Id" + }, + { + "name": "PermissionRemoved", + "discriminant": 2, + "ty": "iroha_data_model::events::data::events::role::PermissionRemoved" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt>": { + "iroha_data_model::events::data::events::role::RoleEventFilter": { "Enum": { "variants": [ { - "name": "AcceptAll", + "name": "ByCreated", "discriminant": 0, "ty": null }, { - "name": "BySome", + "name": "ByDeleted", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::IdFilter" + "ty": null + }, + { + "name": "ByPermissionRemoved", + "discriminant": 2, + "ty": null } ] } }, - "iroha_data_model::events::data::filters::FilterOpt>": { + "iroha_data_model::events::data::events::role::RoleFilter": { + "Struct": { + "declarations": [ + { + "name": "origin_filter", + "ty": "iroha_data_model::events::data::filters::FilterOpt>" + }, + { + "name": "event_filter", + "ty": "iroha_data_model::events::data::filters::FilterOpt" + } + ] + } + }, + "iroha_data_model::events::data::events::trigger::TriggerEvent": { "Enum": { "variants": [ { - "name": "AcceptAll", + "name": "Created", "discriminant": 0, - "ty": null + "ty": "iroha_data_model::trigger::Id" }, { - "name": "BySome", + "name": "Deleted", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::IdFilter" + "ty": "iroha_data_model::trigger::Id" + }, + { + "name": "Extended", + "discriminant": 2, + "ty": "iroha_data_model::trigger::Id" + }, + { + "name": "Shortened", + "discriminant": 3, + "ty": "iroha_data_model::trigger::Id" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt>": { + "iroha_data_model::events::data::events::trigger::TriggerEventFilter": { "Enum": { "variants": [ { - "name": "AcceptAll", + "name": "ByCreated", "discriminant": 0, "ty": null }, { - "name": "BySome", + "name": "ByDeleted", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::IdFilter" + "ty": null + }, + { + "name": "ByExtended", + "discriminant": 2, + "ty": null + }, + { + "name": "ByShortened", + "discriminant": 3, + "ty": null } ] } }, - "iroha_data_model::events::data::filters::FilterOpt": { + "iroha_data_model::events::data::events::trigger::TriggerFilter": { + "Struct": { + "declarations": [ + { + "name": "origin_filter", + "ty": "iroha_data_model::events::data::filters::FilterOpt>" + }, + { + "name": "event_filter", + "ty": "iroha_data_model::events::data::filters::FilterOpt" + } + ] + } + }, + "iroha_data_model::events::data::filters::EntityFilter": { "Enum": { "variants": [ { - "name": "AcceptAll", + "name": "ByPeer", "discriminant": 0, - "ty": null + "ty": "iroha_data_model::events::data::filters::FilterOpt" }, { - "name": "BySome", + "name": "ByDomain", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::account::AccountEventFilter" + "ty": "iroha_data_model::events::data::filters::FilterOpt" + }, + { + "name": "ByAccount", + "discriminant": 2, + "ty": "iroha_data_model::events::data::filters::FilterOpt" + }, + { + "name": "ByAssetDefinition", + "discriminant": 3, + "ty": "iroha_data_model::events::data::filters::FilterOpt" + }, + { + "name": "ByAsset", + "discriminant": 4, + "ty": "iroha_data_model::events::data::filters::FilterOpt" + }, + { + "name": "ByTrigger", + "discriminant": 5, + "ty": "iroha_data_model::events::data::filters::FilterOpt" + }, + { + "name": "ByRole", + "discriminant": 6, + "ty": "iroha_data_model::events::data::filters::FilterOpt" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt": { + "iroha_data_model::events::data::filters::FilterOpt": { "Enum": { "variants": [ { @@ -1989,12 +2243,12 @@ { "name": "BySome", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::account::AccountFilter" + "ty": "iroha_data_model::events::data::events::account::AccountEventFilter" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt": { + "iroha_data_model::events::data::filters::FilterOpt": { "Enum": { "variants": [ { @@ -2005,12 +2259,12 @@ { "name": "BySome", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::asset::AssetDefinitionEventFilter" + "ty": "iroha_data_model::events::data::events::account::AccountFilter" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt": { + "iroha_data_model::events::data::filters::FilterOpt": { "Enum": { "variants": [ { @@ -2021,12 +2275,12 @@ { "name": "BySome", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::asset::AssetDefinitionFilter" + "ty": "iroha_data_model::events::data::events::asset::AssetDefinitionEventFilter" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt": { + "iroha_data_model::events::data::filters::FilterOpt": { "Enum": { "variants": [ { @@ -2037,12 +2291,12 @@ { "name": "BySome", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::asset::AssetEventFilter" + "ty": "iroha_data_model::events::data::events::asset::AssetDefinitionFilter" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt": { + "iroha_data_model::events::data::filters::FilterOpt": { "Enum": { "variants": [ { @@ -2053,12 +2307,12 @@ { "name": "BySome", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::asset::AssetFilter" + "ty": "iroha_data_model::events::data::events::asset::AssetEventFilter" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt": { + "iroha_data_model::events::data::filters::FilterOpt": { "Enum": { "variants": [ { @@ -2069,12 +2323,12 @@ { "name": "BySome", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::domain::DomainEventFilter" + "ty": "iroha_data_model::events::data::events::asset::AssetFilter" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt": { + "iroha_data_model::events::data::filters::FilterOpt": { "Enum": { "variants": [ { @@ -2085,12 +2339,12 @@ { "name": "BySome", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::domain::DomainFilter" + "ty": "iroha_data_model::events::data::events::domain::DomainEventFilter" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt": { + "iroha_data_model::events::data::filters::FilterOpt": { "Enum": { "variants": [ { @@ -2101,12 +2355,12 @@ { "name": "BySome", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::peer::PeerEventFilter" + "ty": "iroha_data_model::events::data::events::domain::DomainFilter" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt": { + "iroha_data_model::events::data::filters::FilterOpt": { "Enum": { "variants": [ { @@ -2117,12 +2371,12 @@ { "name": "BySome", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::peer::PeerFilter" + "ty": "iroha_data_model::events::data::events::peer::PeerEventFilter" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt": { + "iroha_data_model::events::data::filters::FilterOpt": { "Enum": { "variants": [ { @@ -2133,12 +2387,12 @@ { "name": "BySome", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::role::RoleEventFilter" + "ty": "iroha_data_model::events::data::events::peer::PeerFilter" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt": { + "iroha_data_model::events::data::filters::FilterOpt": { "Enum": { "variants": [ { @@ -2149,12 +2403,12 @@ { "name": "BySome", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::role::RoleFilter" + "ty": "iroha_data_model::events::data::events::role::RoleEventFilter" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt": { + "iroha_data_model::events::data::filters::FilterOpt": { "Enum": { "variants": [ { @@ -2165,12 +2419,12 @@ { "name": "BySome", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::trigger::TriggerEventFilter" + "ty": "iroha_data_model::events::data::events::role::RoleFilter" } ] } }, - "iroha_data_model::events::data::filters::FilterOpt": { + "iroha_data_model::events::data::filters::FilterOpt": { "Enum": { "variants": [ { @@ -2181,377 +2435,201 @@ { "name": "BySome", "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::trigger::TriggerFilter" + "ty": "iroha_data_model::events::data::events::trigger::TriggerEventFilter" } ] } }, - "iroha_data_model::events::data::filters::IdFilter": { - "Tuple": { - "types": [ - "iroha_data_model::account::Id" - ] - } - }, - "iroha_data_model::events::data::filters::IdFilter": { - "Tuple": { - "types": [ - "iroha_data_model::asset::DefinitionId" - ] - } - }, - "iroha_data_model::events::data::filters::IdFilter": { - "Tuple": { - "types": [ - "iroha_data_model::asset::Id" - ] - } - }, - "iroha_data_model::events::data::filters::IdFilter": { - "Tuple": { - "types": [ - "iroha_data_model::domain::Id" - ] - } - }, - "iroha_data_model::events::data::filters::IdFilter": { - "Tuple": { - "types": [ - "iroha_data_model::peer::Id" - ] - } - }, - "iroha_data_model::events::data::filters::IdFilter": { - "Tuple": { - "types": [ - "iroha_data_model::role::Id" - ] - } - }, - "iroha_data_model::events::data::filters::IdFilter": { - "Tuple": { - "types": [ - "iroha_data_model::trigger::Id" - ] - } - }, - "iroha_data_model::events::data::filters::account::AccountEventFilter": { + "iroha_data_model::events::data::filters::FilterOpt": { "Enum": { "variants": [ { - "name": "ByAsset", + "name": "AcceptAll", "discriminant": 0, - "ty": "iroha_data_model::events::data::filters::FilterOpt" - }, - { - "name": "ByCreated", - "discriminant": 1, - "ty": null - }, - { - "name": "ByDeleted", - "discriminant": 2, - "ty": null - }, - { - "name": "ByAuthenticationAdded", - "discriminant": 3, "ty": null }, { - "name": "ByAuthenticationRemoved", - "discriminant": 4, - "ty": null - }, - { - "name": "ByPermissionAdded", - "discriminant": 5, - "ty": null - }, - { - "name": "ByPermissionRemoved", - "discriminant": 6, - "ty": null - }, - { - "name": "ByRoleRevoked", - "discriminant": 7, - "ty": null - }, - { - "name": "ByRoleGranted", - "discriminant": 8, - "ty": null - }, - { - "name": "ByMetadataInserted", - "discriminant": 9, - "ty": null - }, - { - "name": "ByMetadataRemoved", - "discriminant": 10, - "ty": null + "name": "BySome", + "discriminant": 1, + "ty": "iroha_data_model::events::data::events::trigger::TriggerFilter" } ] } }, - "iroha_data_model::events::data::filters::account::AccountFilter": { - "Struct": { - "declarations": [ + "iroha_data_model::events::data::filters::FilterOpt": { + "Enum": { + "variants": [ { - "name": "id_filter", - "ty": "iroha_data_model::events::data::filters::FilterOpt>" + "name": "AcceptAll", + "discriminant": 0, + "ty": null }, { - "name": "event_filter", - "ty": "iroha_data_model::events::data::filters::FilterOpt" + "name": "BySome", + "discriminant": 1, + "ty": "iroha_data_model::events::data::filters::EntityFilter" } ] } }, - "iroha_data_model::events::data::filters::asset::AssetDefinitionEventFilter": { + "iroha_data_model::events::data::filters::FilterOpt>": { "Enum": { "variants": [ { - "name": "ByCreated", + "name": "AcceptAll", "discriminant": 0, "ty": null }, { - "name": "ByDeleted", + "name": "BySome", "discriminant": 1, - "ty": null - }, - { - "name": "ByMintabilityChanged", - "discriminant": 2, - "ty": null - }, - { - "name": "ByMetadataInserted", - "discriminant": 3, - "ty": null - }, - { - "name": "ByMetadataRemoved", - "discriminant": 4, - "ty": null + "ty": "iroha_data_model::events::data::filters::OriginFilter" } ] } }, - "iroha_data_model::events::data::filters::asset::AssetDefinitionFilter": { - "Struct": { - "declarations": [ + "iroha_data_model::events::data::filters::FilterOpt>": { + "Enum": { + "variants": [ { - "name": "id_filter", - "ty": "iroha_data_model::events::data::filters::FilterOpt>" + "name": "AcceptAll", + "discriminant": 0, + "ty": null }, { - "name": "event_filter", - "ty": "iroha_data_model::events::data::filters::FilterOpt" + "name": "BySome", + "discriminant": 1, + "ty": "iroha_data_model::events::data::filters::OriginFilter" } ] } }, - "iroha_data_model::events::data::filters::asset::AssetEventFilter": { + "iroha_data_model::events::data::filters::FilterOpt>": { "Enum": { "variants": [ { - "name": "ByCreated", + "name": "AcceptAll", "discriminant": 0, "ty": null }, { - "name": "ByDeleted", + "name": "BySome", "discriminant": 1, - "ty": null - }, - { - "name": "ByAdded", - "discriminant": 2, - "ty": null - }, - { - "name": "ByRemoved", - "discriminant": 3, - "ty": null - }, - { - "name": "ByMetadataInserted", - "discriminant": 4, - "ty": null - }, - { - "name": "ByMetadataRemoved", - "discriminant": 5, - "ty": null + "ty": "iroha_data_model::events::data::filters::OriginFilter" } ] } }, - "iroha_data_model::events::data::filters::asset::AssetFilter": { - "Struct": { - "declarations": [ + "iroha_data_model::events::data::filters::FilterOpt>": { + "Enum": { + "variants": [ { - "name": "id_filter", - "ty": "iroha_data_model::events::data::filters::FilterOpt>" + "name": "AcceptAll", + "discriminant": 0, + "ty": null }, { - "name": "event_filter", - "ty": "iroha_data_model::events::data::filters::FilterOpt" + "name": "BySome", + "discriminant": 1, + "ty": "iroha_data_model::events::data::filters::OriginFilter" } ] } }, - "iroha_data_model::events::data::filters::domain::DomainEventFilter": { + "iroha_data_model::events::data::filters::FilterOpt>": { "Enum": { "variants": [ { - "name": "ByAccount", + "name": "AcceptAll", "discriminant": 0, - "ty": "iroha_data_model::events::data::filters::FilterOpt" - }, - { - "name": "ByAssetDefinition", - "discriminant": 1, - "ty": "iroha_data_model::events::data::filters::FilterOpt" - }, - { - "name": "ByCreated", - "discriminant": 2, - "ty": null - }, - { - "name": "ByDeleted", - "discriminant": 3, - "ty": null - }, - { - "name": "ByMetadataInserted", - "discriminant": 4, "ty": null }, { - "name": "ByMetadataRemoved", - "discriminant": 5, - "ty": null + "name": "BySome", + "discriminant": 1, + "ty": "iroha_data_model::events::data::filters::OriginFilter" } ] } }, - "iroha_data_model::events::data::filters::domain::DomainFilter": { - "Struct": { - "declarations": [ + "iroha_data_model::events::data::filters::FilterOpt>": { + "Enum": { + "variants": [ { - "name": "id_filter", - "ty": "iroha_data_model::events::data::filters::FilterOpt>" + "name": "AcceptAll", + "discriminant": 0, + "ty": null }, { - "name": "event_filter", - "ty": "iroha_data_model::events::data::filters::FilterOpt" + "name": "BySome", + "discriminant": 1, + "ty": "iroha_data_model::events::data::filters::OriginFilter" } ] } }, - "iroha_data_model::events::data::filters::peer::PeerEventFilter": { + "iroha_data_model::events::data::filters::FilterOpt>": { "Enum": { "variants": [ { - "name": "ByAdded", + "name": "AcceptAll", "discriminant": 0, "ty": null }, { - "name": "ByRemoved", + "name": "BySome", "discriminant": 1, - "ty": null + "ty": "iroha_data_model::events::data::filters::OriginFilter" } ] } }, - "iroha_data_model::events::data::filters::peer::PeerFilter": { - "Struct": { - "declarations": [ - { - "name": "id_filter", - "ty": "iroha_data_model::events::data::filters::FilterOpt>" - }, - { - "name": "event_filter", - "ty": "iroha_data_model::events::data::filters::FilterOpt" - } + "iroha_data_model::events::data::filters::OriginFilter": { + "Tuple": { + "types": [ + "iroha_data_model::account::Id" ] } }, - "iroha_data_model::events::data::filters::role::RoleEventFilter": { - "Enum": { - "variants": [ - { - "name": "ByCreated", - "discriminant": 0, - "ty": null - }, - { - "name": "ByDeleted", - "discriminant": 1, - "ty": null - } + "iroha_data_model::events::data::filters::OriginFilter": { + "Tuple": { + "types": [ + "iroha_data_model::asset::DefinitionId" ] } }, - "iroha_data_model::events::data::filters::role::RoleFilter": { - "Struct": { - "declarations": [ - { - "name": "id_filter", - "ty": "iroha_data_model::events::data::filters::FilterOpt>" - }, - { - "name": "event_filter", - "ty": "iroha_data_model::events::data::filters::FilterOpt" - } + "iroha_data_model::events::data::filters::OriginFilter": { + "Tuple": { + "types": [ + "iroha_data_model::asset::Id" + ] + } + }, + "iroha_data_model::events::data::filters::OriginFilter": { + "Tuple": { + "types": [ + "iroha_data_model::domain::Id" ] } }, - "iroha_data_model::events::data::filters::trigger::TriggerEventFilter": { - "Enum": { - "variants": [ - { - "name": "ByCreated", - "discriminant": 0, - "ty": null - }, - { - "name": "ByDeleted", - "discriminant": 1, - "ty": null - }, - { - "name": "ByExtended", - "discriminant": 2, - "ty": null - }, - { - "name": "ByShortened", - "discriminant": 3, - "ty": null - } + "iroha_data_model::events::data::filters::OriginFilter": { + "Tuple": { + "types": [ + "iroha_data_model::peer::Id" ] } }, - "iroha_data_model::events::data::filters::trigger::TriggerFilter": { - "Struct": { - "declarations": [ - { - "name": "id_filter", - "ty": "iroha_data_model::events::data::filters::FilterOpt>" - }, - { - "name": "event_filter", - "ty": "iroha_data_model::events::data::filters::FilterOpt" - } + "iroha_data_model::events::data::filters::OriginFilter": { + "Tuple": { + "types": [ + "iroha_data_model::role::Id" + ] + } + }, + "iroha_data_model::events::data::filters::OriginFilter": { + "Tuple": { + "types": [ + "iroha_data_model::trigger::Id" ] } }, @@ -3555,12 +3633,36 @@ ] } }, - "iroha_data_model::permissions::PermissionToken": { + "iroha_data_model::permission::token::Definition": { + "Struct": { + "declarations": [ + { + "name": "id", + "ty": "iroha_data_model::permission::token::Id" + }, + { + "name": "params", + "ty": "Map" + } + ] + } + }, + "iroha_data_model::permission::token::Id": { "Struct": { "declarations": [ { "name": "name", "ty": "iroha_data_model::name::Name" + } + ] + } + }, + "iroha_data_model::permission::token::Token": { + "Struct": { + "declarations": [ + { + "name": "definition_id", + "ty": "iroha_data_model::permission::token::Id" }, { "name": "params", @@ -3569,6 +3671,64 @@ ] } }, + "iroha_data_model::permission::validator::Id": { + "Struct": { + "declarations": [ + { + "name": "name", + "ty": "iroha_data_model::name::Name" + }, + { + "name": "account_id", + "ty": "iroha_data_model::account::Id" + } + ] + } + }, + "iroha_data_model::permission::validator::Type": { + "Enum": { + "variants": [ + { + "name": "Transaction", + "discriminant": 0, + "ty": null + }, + { + "name": "Instruction", + "discriminant": 1, + "ty": null + }, + { + "name": "Query", + "discriminant": 2, + "ty": null + }, + { + "name": "Expression", + "discriminant": 3, + "ty": null + } + ] + } + }, + "iroha_data_model::permission::validator::Validator": { + "Struct": { + "declarations": [ + { + "name": "id", + "ty": "iroha_data_model::permission::validator::Id" + }, + { + "name": "validator_type", + "ty": "iroha_data_model::permission::validator::Type" + }, + { + "name": "wasm", + "ty": "iroha_data_model::transaction::WasmSmartContract" + } + ] + } + }, "iroha_data_model::predicate::PredicateBox": { "Enum": { "variants": [ @@ -3595,37 +3755,58 @@ ] } }, - "iroha_data_model::predicate::numerical::Range": { - "Enum": { - "variants": [ + "iroha_data_model::predicate::ip_addr::Ipv4Predicate": { + "Tuple": { + "types": [ + "[iroha_data_model::predicate::numerical::Interval; 4]" + ] + } + }, + "iroha_data_model::predicate::ip_addr::Ipv6Predicate": { + "Tuple": { + "types": [ + "[iroha_data_model::predicate::numerical::Interval; 8]" + ] + } + }, + "iroha_data_model::predicate::numerical::Interval": { + "Struct": { + "declarations": [ { - "name": "U32", - "discriminant": 0, - "ty": "iroha_data_model::predicate::numerical::SemiInterval" + "name": "start", + "ty": "u16" }, { - "name": "U128", - "discriminant": 1, - "ty": "iroha_data_model::predicate::numerical::SemiInterval" + "name": "limit", + "ty": "u16" + } + ] + } + }, + "iroha_data_model::predicate::numerical::Interval": { + "Struct": { + "declarations": [ + { + "name": "start", + "ty": "u8" }, { - "name": "Fixed", - "discriminant": 2, - "ty": "iroha_data_model::predicate::numerical::SemiInterval" + "name": "limit", + "ty": "u8" } ] } }, - "iroha_data_model::predicate::numerical::SemiInterval": { + "iroha_data_model::predicate::numerical::SemiInterval": { "Struct": { "declarations": [ { "name": "start", - "ty": "iroha_data_primitives::fixed::Fixed" + "ty": "iroha_primitives::fixed::Fixed" }, { "name": "limit", - "ty": "iroha_data_primitives::fixed::Fixed" + "ty": "iroha_primitives::fixed::Fixed" } ] } @@ -3658,6 +3839,27 @@ ] } }, + "iroha_data_model::predicate::numerical::SemiRange": { + "Enum": { + "variants": [ + { + "name": "U32", + "discriminant": 0, + "ty": "iroha_data_model::predicate::numerical::SemiInterval" + }, + { + "name": "U128", + "discriminant": 1, + "ty": "iroha_data_model::predicate::numerical::SemiInterval" + }, + { + "name": "Fixed", + "discriminant": 2, + "ty": "iroha_data_model::predicate::numerical::SemiInterval" + } + ] + } + }, "iroha_data_model::predicate::string::Predicate": { "Enum": { "variants": [ @@ -3750,7 +3952,7 @@ { "name": "Numerical", "discriminant": 3, - "ty": "iroha_data_model::predicate::numerical::Range" + "ty": "iroha_data_model::predicate::numerical::SemiRange" }, { "name": "TimeStamp", @@ -3758,8 +3960,18 @@ "ty": "iroha_data_model::predicate::numerical::SemiInterval" }, { - "name": "Pass", + "name": "Ipv4Addr", "discriminant": 5, + "ty": "iroha_data_model::predicate::ip_addr::Ipv4Predicate" + }, + { + "name": "Ipv6Addr", + "discriminant": 6, + "ty": "iroha_data_model::predicate::ip_addr::Ipv6Predicate" + }, + { + "name": "Pass", + "discriminant": 7, "ty": null } ] @@ -3794,6 +4006,10 @@ "name": "pagination", "ty": "iroha_data_model::pagination::Pagination" }, + { + "name": "sorting", + "ty": "iroha_data_model::sorting::Sorting" + }, { "name": "total", "ty": "u64" @@ -3942,63 +4158,78 @@ "ty": "iroha_data_model::query::block::FindAllBlocks" }, { - "name": "FindAllTransactions", + "name": "FindAllBlockHeaders", "discriminant": 23, + "ty": "iroha_data_model::query::block::FindAllBlockHeaders" + }, + { + "name": "FindBlockHeaderByHash", + "discriminant": 24, + "ty": "iroha_data_model::query::block::FindBlockHeaderByHash" + }, + { + "name": "FindAllTransactions", + "discriminant": 25, "ty": "iroha_data_model::query::transaction::FindAllTransactions" }, { "name": "FindTransactionsByAccountId", - "discriminant": 24, + "discriminant": 26, "ty": "iroha_data_model::query::transaction::FindTransactionsByAccountId" }, { "name": "FindTransactionByHash", - "discriminant": 25, + "discriminant": 27, "ty": "iroha_data_model::query::transaction::FindTransactionByHash" }, { "name": "FindPermissionTokensByAccountId", - "discriminant": 26, + "discriminant": 28, "ty": "iroha_data_model::query::permissions::FindPermissionTokensByAccountId" }, + { + "name": "FindAllPermissionTokenDefinitions", + "discriminant": 29, + "ty": "iroha_data_model::query::permissions::FindAllPermissionTokenDefinitions" + }, { "name": "FindAllActiveTriggerIds", - "discriminant": 27, + "discriminant": 30, "ty": "iroha_data_model::query::trigger::FindAllActiveTriggerIds" }, { "name": "FindTriggerById", - "discriminant": 28, + "discriminant": 31, "ty": "iroha_data_model::query::trigger::FindTriggerById" }, { "name": "FindTriggerKeyValueByIdAndKey", - "discriminant": 29, + "discriminant": 32, "ty": "iroha_data_model::query::trigger::FindTriggerKeyValueByIdAndKey" }, { "name": "FindTriggersByDomainId", - "discriminant": 30, + "discriminant": 33, "ty": "iroha_data_model::query::trigger::FindTriggersByDomainId" }, { "name": "FindAllRoles", - "discriminant": 31, + "discriminant": 34, "ty": "iroha_data_model::query::role::FindAllRoles" }, { "name": "FindAllRoleIds", - "discriminant": 32, + "discriminant": 35, "ty": "iroha_data_model::query::role::FindAllRoleIds" }, { "name": "FindRoleByRoleId", - "discriminant": 33, + "discriminant": 36, "ty": "iroha_data_model::query::role::FindRoleByRoleId" }, { "name": "FindRolesByAccountId", - "discriminant": 34, + "discriminant": 37, "ty": "iroha_data_model::query::role::FindRolesByAccountId" } ] @@ -4228,11 +4459,26 @@ ] } }, + "iroha_data_model::query::block::FindAllBlockHeaders": { + "Tuple": { + "types": [] + } + }, "iroha_data_model::query::block::FindAllBlocks": { "Tuple": { "types": [] } }, + "iroha_data_model::query::block::FindBlockHeaderByHash": { + "Struct": { + "declarations": [ + { + "name": "hash", + "ty": "iroha_data_model::expression::EvaluatesTo" + } + ] + } + }, "iroha_data_model::query::domain::FindAllDomains": { "Tuple": { "types": [] @@ -4267,6 +4513,11 @@ "types": [] } }, + "iroha_data_model::query::permissions::FindAllPermissionTokenDefinitions": { + "Tuple": { + "types": [] + } + }, "iroha_data_model::query::permissions::FindPermissionTokensByAccountId": { "Struct": { "declarations": [ @@ -4400,7 +4651,17 @@ }, { "name": "permissions", - "ty": "Vec" + "ty": "Vec" + } + ] + } + }, + "iroha_data_model::sorting::Sorting": { + "Struct": { + "declarations": [ + { + "name": "sort_by_metadata_key", + "ty": "Option" } ] } @@ -4520,7 +4781,7 @@ ] } }, - "iroha_data_model::transaction::Transaction": { + "iroha_data_model::transaction::SignedTransaction": { "Struct": { "declarations": [ { @@ -4541,6 +4802,20 @@ ] } }, + "iroha_data_model::transaction::TransactionQueryResult": { + "Struct": { + "declarations": [ + { + "name": "tx_value", + "ty": "iroha_data_model::transaction::TransactionValue" + }, + { + "name": "block_hash", + "ty": "iroha_crypto::hash::Hash" + } + ] + } + }, "iroha_data_model::transaction::TransactionRejectionReason": { "Enum": { "variants": [ @@ -4583,7 +4858,7 @@ { "name": "Transaction", "discriminant": 0, - "ty": "iroha_data_model::transaction::VersionedTransaction" + "ty": "iroha_data_model::transaction::VersionedSignedTransaction" }, { "name": "RejectedTransaction", @@ -4628,13 +4903,13 @@ ] } }, - "iroha_data_model::transaction::VersionedTransaction": { + "iroha_data_model::transaction::VersionedSignedTransaction": { "Enum": { "variants": [ { "name": "V1", "discriminant": 1, - "ty": "iroha_data_model::transaction::Transaction" + "ty": "iroha_data_model::transaction::SignedTransaction" } ] } @@ -4676,6 +4951,10 @@ { "name": "name", "ty": "iroha_data_model::name::Name" + }, + { + "name": "domain_id", + "ty": "Option" } ] } @@ -4736,7 +5015,21 @@ ] } }, - "iroha_data_primitives::fixed::Fixed": { + "iroha_primitives::addr::Ipv4Addr": { + "Tuple": { + "types": [ + "[u8; 4]" + ] + } + }, + "iroha_primitives::addr::Ipv6Addr": { + "Tuple": { + "types": [ + "[u16; 8]" + ] + } + }, + "iroha_primitives::fixed::Fixed": { "Tuple": { "types": [ "FixedPoint" @@ -4827,6 +5120,9 @@ "u128": { "Int": "FixedWidth" }, + "u16": { + "Int": "FixedWidth" + }, "u32": { "Int": "FixedWidth" }, diff --git a/packages/data-model/CHANGELOG.md b/packages/data-model/CHANGELOG.md index 4cc05571..cc4272f8 100644 --- a/packages/data-model/CHANGELOG.md +++ b/packages/data-model/CHANGELOG.md @@ -1,5 +1,16 @@ # @iroha2/data-model +## 4.0.0 + +### Major Changes + +- e27467e: Update data model to align it with the updated model in the upcoming Iroha 2 LTS. + + Notable changes: + + - `Transaction` → `SignedTransaction` + - `VersionedTransaction` → `VersionedSignedTransaction` + ## 3.0.0 ### Patch Changes diff --git a/packages/data-model/README.md b/packages/data-model/README.md index f66d37cd..5f5fb53d 100644 --- a/packages/data-model/README.md +++ b/packages/data-model/README.md @@ -4,7 +4,7 @@ The `@iroha2/data-model` packages contains generated SCALE-definitions for Iroha ## Target version -This package targets `hyperledger/iroha` at current `iroha2-lts` branch, which has a hash `9bfdb39aaaa2490a82a17ebc255d3557d3ad38da`. +This package targets `hyperledger/iroha` at current `iroha2-lts` branch, which has a hash `b783f10fa7de26ed1fdd4c526bd162f8636f1a65`. ## Installation diff --git a/packages/data-model/package.json b/packages/data-model/package.json index cac882e8..63bae32a 100644 --- a/packages/data-model/package.json +++ b/packages/data-model/package.json @@ -1,6 +1,6 @@ { "name": "@iroha2/data-model", - "version": "3.0.0", + "version": "4.0.0", "module": "dist/lib.mjs", "main": "dist/lib.cjs", "types": "dist/lib.d.ts", @@ -26,7 +26,7 @@ "@scale-codec/definition-runtime": "^2.2.2" }, "devDependencies": { - "@iroha2/data-model-schema": "workspace:3.0.0", + "@iroha2/data-model-schema": "workspace:4.0.0", "@iroha2/dev-iroha-bins": "workspace:^0.0.0", "@scale-codec/definition-compiler": "^2.2.2", "@scale-codec/util": "^1.1.1", diff --git a/packages/data-model/src/__generated__.ts b/packages/data-model/src/__generated__.ts index 8f30d4a9..5388afb5 100644 --- a/packages/data-model/src/__generated__.ts +++ b/packages/data-model/src/__generated__.ts @@ -1,4 +1,4 @@ -import { Bool, Compact, Enum, Str, U128, U32, U64, U8, VecU8, createArrayU8Codec, createEnumCodec, createMapCodec, createOptionCodec, createStructCodec, createTupleCodec, createVecCodec, dynCodec } from '@scale-codec/definition-runtime' +import { Bool, Compact, Enum, Str, U128, U16, U32, U64, U8, VecU8, createArrayCodec, createArrayU8Codec, createEnumCodec, createMapCodec, createOptionCodec, createStructCodec, createTupleCodec, createVecCodec, dynCodec } from '@scale-codec/definition-runtime' import type { ArrayCodecAndFactory, Codec, EnumCodecAndFactory, MapCodecAndFactory, Opaque, Option, StructCodecAndFactory } from '@scale-codec/definition-runtime' @@ -6,8 +6,9 @@ import type { ArrayCodecAndFactory, Codec, EnumCodecAndFactory, MapCodecAndFacto const __dyn_FilterOptAssetDefinitionFilter = dynCodec(() => FilterOptAssetDefinitionFilter) const __dyn_FindAccountKeyValueByIdAndKey = dynCodec(() => FindAccountKeyValueByIdAndKey) +const __dyn_OptionName = dynCodec(() => OptionName) const __dyn_SignatureOfCommittedBlock = dynCodec(() => SignatureOfCommittedBlock) -const __dyn_IdFilterTriggerId = dynCodec(() => IdFilterTriggerId) +const __dyn_OriginFilterTriggerEvent = dynCodec(() => OriginFilterTriggerEvent) const __dyn_FilterOptAccountEventFilter = dynCodec(() => FilterOptAccountEventFilter) const __dyn_TransferBox = dynCodec(() => TransferBox) const __dyn_EvaluatesToName = dynCodec(() => EvaluatesToName) @@ -22,11 +23,14 @@ const __dyn_MapAssetIdAsset = dynCodec(() => MapAssetIdAsset) const __dyn_FindAccountsByName = dynCodec(() => FindAccountsByName) const __dyn_SemiIntervalU32 = dynCodec(() => SemiIntervalU32) const __dyn_MapAccountIdAccount = dynCodec(() => MapAccountIdAccount) +const __dyn_IntervalU16L8 = dynCodec(() => IntervalU16L8) const __dyn_FilterOptRoleEventFilter = dynCodec(() => FilterOptRoleEventFilter) +const __dyn_FindAllBlockHeaders = dynCodec(() => FindAllBlockHeaders) const __dyn_ContextValue = dynCodec(() => ContextValue) const __dyn_ValidTransaction = dynCodec(() => ValidTransaction) const __dyn_Peer = dynCodec(() => Peer) const __dyn_AssetEventFilter = dynCodec(() => AssetEventFilter) +const __dyn_SignedTransaction = dynCodec(() => SignedTransaction) const __dyn_VecPublicKey = dynCodec(() => VecPublicKey) const __dyn_SignaturesOfTransactionPayload = dynCodec(() => SignaturesOfTransactionPayload) const __dyn_VecHash = dynCodec(() => VecHash) @@ -35,9 +39,9 @@ const __dyn_Mod = dynCodec(() => Mod) const __dyn_TriggerEvent = dynCodec(() => TriggerEvent) const __dyn_QueryBox = dynCodec(() => QueryBox) const __dyn_AssetDefinition = dynCodec(() => AssetDefinition) +const __dyn_FilterOptOriginFilterAssetEvent = dynCodec(() => FilterOptOriginFilterAssetEvent) const __dyn_HashOfVersionedCommittedBlock = dynCodec(() => HashOfVersionedCommittedBlock) const __dyn_FindAssetKeyValueByIdAndKey = dynCodec(() => FindAssetKeyValueByIdAndKey) -const __dyn_HashOfVersionedValidBlock = dynCodec(() => HashOfVersionedValidBlock) const __dyn_UnsupportedVersion = dynCodec(() => UnsupportedVersion) const __dyn_SignaturesOfCommittedBlock = dynCodec(() => SignaturesOfCommittedBlock) const __dyn_NotPermittedFail = dynCodec(() => NotPermittedFail) @@ -48,15 +52,15 @@ const __dyn_NewAssetDefinition = dynCodec(() => NewAssetDefinition) const __dyn_FindTransactionsByAccountId = dynCodec(() => FindTransactionsByAccountId) const __dyn_OptionHash = dynCodec(() => OptionHash) const __dyn_TimeSchedule = dynCodec(() => TimeSchedule) +const __dyn_ArrayU8L4 = dynCodec(() => ArrayU8L4) const __dyn_Domain = dynCodec(() => Domain) const __dyn_BlockValue = dynCodec(() => BlockValue) -const __dyn_Proof = dynCodec(() => Proof) +const __dyn_Sorting = dynCodec(() => Sorting) const __dyn_OptionTopology = dynCodec(() => OptionTopology) const __dyn_Multiply = dynCodec(() => Multiply) const __dyn_NewDomain = dynCodec(() => NewDomain) -const __dyn_Reason = dynCodec(() => Reason) -const __dyn_IdFilterRoleId = dynCodec(() => IdFilterRoleId) const __dyn_RoleEvent = dynCodec(() => RoleEvent) +const __dyn_ValueKind = dynCodec(() => ValueKind) const __dyn_MapPublicKeySignatureOfTransactionPayload = dynCodec(() => MapPublicKeySignatureOfTransactionPayload) const __dyn_VecRoleId = dynCodec(() => VecRoleId) const __dyn_EventPublisherMessage = dynCodec(() => EventPublisherMessage) @@ -65,18 +69,21 @@ const __dyn_TimeEventFilter = dynCodec(() => TimeEventFilter) const __dyn_VecVersionedValidTransaction = dynCodec(() => VecVersionedValidTransaction) const __dyn_ExecutionTime = dynCodec(() => ExecutionTime) const __dyn_AccountEventFilter = dynCodec(() => AccountEventFilter) +const __dyn_VecToken = dynCodec(() => VecToken) const __dyn_QueryResult = dynCodec(() => QueryResult) -const __dyn_FilterOptIdFilterTriggerId = dynCodec(() => FilterOptIdFilterTriggerId) const __dyn_EventSubscriberMessage = dynCodec(() => EventSubscriberMessage) const __dyn_AccountFilter = dynCodec(() => AccountFilter) const __dyn_FindAccountById = dynCodec(() => FindAccountById) const __dyn_MapPublicKeySignatureOfCommittedBlock = dynCodec(() => MapPublicKeySignatureOfCommittedBlock) +const __dyn_FilterOptOriginFilterAccountEvent = dynCodec(() => FilterOptOriginFilterAccountEvent) +const __dyn_OriginFilterRoleEvent = dynCodec(() => OriginFilterRoleEvent) +const __dyn_FindBlockHeaderByHash = dynCodec(() => FindBlockHeaderByHash) const __dyn_EvaluatesToRoleId = dynCodec(() => EvaluatesToRoleId) const __dyn_VecEvent = dynCodec(() => VecEvent) const __dyn_QueryPayload = dynCodec(() => QueryPayload) const __dyn_Where = dynCodec(() => Where) +const __dyn_TransactionQueryResult = dynCodec(() => TransactionQueryResult) const __dyn_FindAllDomains = dynCodec(() => FindAllDomains) -const __dyn_VersionedTransaction = dynCodec(() => VersionedTransaction) const __dyn_RaiseTo = dynCodec(() => RaiseTo) const __dyn_OptionTimeInterval = dynCodec(() => OptionTimeInterval) const __dyn_RegisterBox = dynCodec(() => RegisterBox) @@ -84,8 +91,10 @@ const __dyn_AccountId = dynCodec(() => AccountId) const __dyn_InstructionExecutionFail = dynCodec(() => InstructionExecutionFail) const __dyn_VersionedCommittedBlock = dynCodec(() => VersionedCommittedBlock) const __dyn_VecPredicateBox = dynCodec(() => VecPredicateBox) +const __dyn_IntervalU8 = dynCodec(() => IntervalU8) const __dyn_ExecuteTriggerBox = dynCodec(() => ExecuteTriggerBox) const __dyn_AssetFilter = dynCodec(() => AssetFilter) +const __dyn_OriginFilterAssetEvent = dynCodec(() => OriginFilterAssetEvent) const __dyn_PipelineStatusKind = dynCodec(() => PipelineStatusKind) const __dyn_FindAssetById = dynCodec(() => FindAssetById) const __dyn_OptionDuration = dynCodec(() => OptionDuration) @@ -97,11 +106,9 @@ const __dyn_EvaluatesToAssetDefinitionId = dynCodec(() => EvaluatesToAssetDefini const __dyn_VersionedRejectedTransaction = dynCodec(() => VersionedRejectedTransaction) const __dyn_FindAllPeers = dynCodec(() => FindAllPeers) const __dyn_Parameter = dynCodec(() => Parameter) -const __dyn_CommitTimeout = dynCodec(() => CommitTimeout) const __dyn_FindTriggersByDomainId = dynCodec(() => FindTriggersByDomainId) const __dyn_Executable = dynCodec(() => Executable) const __dyn_EvaluatesToRegistrableBox = dynCodec(() => EvaluatesToRegistrableBox) -const __dyn_PermissionToken = dynCodec(() => PermissionToken) const __dyn_FindTransactionByHash = dynCodec(() => FindTransactionByHash) const __dyn_AssetEvent = dynCodec(() => AssetEvent) const __dyn_SequenceBox = dynCodec(() => SequenceBox) @@ -109,26 +116,23 @@ const __dyn_FilterOptAssetDefinitionEventFilter = dynCodec(() => FilterOptAssetD const __dyn_VecGenesisTransaction = dynCodec(() => VecGenesisTransaction) const __dyn_MapNameValue = dynCodec(() => MapNameValue) const __dyn_FilterOptAccountFilter = dynCodec(() => FilterOptAccountFilter) -const __dyn_ProofPayload = dynCodec(() => ProofPayload) const __dyn_AssetId = dynCodec(() => AssetId) -const __dyn_DenialReason = dynCodec(() => DenialReason) const __dyn_TransactionLimitError = dynCodec(() => TransactionLimitError) -const __dyn_IdFilterAssetDefinitionId = dynCodec(() => IdFilterAssetDefinitionId) const __dyn_FixedPointI64 = dynCodec(() => FixedPointI64) const __dyn_VecSignatureOfTransactionPayload = dynCodec(() => VecSignatureOfTransactionPayload) const __dyn_FindAssetsByAssetDefinitionId = dynCodec(() => FindAssetsByAssetDefinitionId) -const __dyn_FilterOptIdFilterPeerId = dynCodec(() => FilterOptIdFilterPeerId) +const __dyn_FilterOptOriginFilterRoleEvent = dynCodec(() => FilterOptOriginFilterRoleEvent) +const __dyn_OriginFilterAccountEvent = dynCodec(() => OriginFilterAccountEvent) const __dyn_FindAllAssets = dynCodec(() => FindAllAssets) const __dyn_Name = dynCodec(() => Name) const __dyn_FindTriggerKeyValueByIdAndKey = dynCodec(() => FindTriggerKeyValueByIdAndKey) +const __dyn_VersionedSignedTransaction = dynCodec(() => VersionedSignedTransaction) const __dyn_FindAccountsWithAsset = dynCodec(() => FindAccountsWithAsset) const __dyn_SignatureCheckCondition = dynCodec(() => SignatureCheckCondition) const __dyn_VecSignatureOfValidBlock = dynCodec(() => VecSignatureOfValidBlock) -const __dyn_ValidatorType = dynCodec(() => ValidatorType) -const __dyn_HashOfVersionedTransaction = dynCodec(() => HashOfVersionedTransaction) const __dyn_AccountEvent = dynCodec(() => AccountEvent) const __dyn_NewAccount = dynCodec(() => NewAccount) -const __dyn_FilterOptIdFilterDomainId = dynCodec(() => FilterOptIdFilterDomainId) +const __dyn_ArrayU16L8 = dynCodec(() => ArrayU16L8) const __dyn_FailBox = dynCodec(() => FailBox) const __dyn_Account = dynCodec(() => Account) const __dyn_FindRolesByAccountId = dynCodec(() => FindRolesByAccountId) @@ -150,26 +154,27 @@ const __dyn_TransactionRejectionReason = dynCodec(() => TransactionRejectionReas const __dyn_FindDomainById = dynCodec(() => FindDomainById) const __dyn_AssetDefinitionEntry = dynCodec(() => AssetDefinitionEntry) const __dyn_ExecuteTriggerEventFilter = dynCodec(() => ExecuteTriggerEventFilter) +const __dyn_SemiRange = dynCodec(() => SemiRange) const __dyn_AssetDefinitionEventFilter = dynCodec(() => AssetDefinitionEventFilter) const __dyn_Topology = dynCodec(() => Topology) const __dyn_GrantBox = dynCodec(() => GrantBox) const __dyn_Metadata = dynCodec(() => Metadata) -const __dyn_MapPublicKeySignatureOfProof = dynCodec(() => MapPublicKeySignatureOfProof) const __dyn_FindError = dynCodec(() => FindError) const __dyn_ArrayU8L32 = dynCodec(() => ArrayU8L32) const __dyn_UnregisterBox = dynCodec(() => UnregisterBox) -const __dyn_VecHashOfVersionedValidBlock = dynCodec(() => VecHashOfVersionedValidBlock) const __dyn_FindPermissionTokensByAccountId = dynCodec(() => FindPermissionTokensByAccountId) const __dyn_VersionError = dynCodec(() => VersionError) -const __dyn_IdFilterPeerId = dynCodec(() => IdFilterPeerId) const __dyn_TransactionPayload = dynCodec(() => TransactionPayload) -const __dyn_FilterOptIdFilterAssetDefinitionId = dynCodec(() => FilterOptIdFilterAssetDefinitionId) const __dyn_DataEvent = dynCodec(() => DataEvent) -const __dyn_VecProof = dynCodec(() => VecProof) +const __dyn_IntervalU8L4 = dynCodec(() => IntervalU8L4) const __dyn_IdBox = dynCodec(() => IdBox) const __dyn_PipelineEventFilter = dynCodec(() => PipelineEventFilter) const __dyn_Asset = dynCodec(() => Asset) +const __dyn_HashOfVersionedSignedTransaction = dynCodec(() => HashOfVersionedSignedTransaction) const __dyn_TriggerFilter = dynCodec(() => TriggerFilter) +const __dyn_PermissionTokenEvent = dynCodec(() => PermissionTokenEvent) +const __dyn_Ipv6Predicate = dynCodec(() => Ipv6Predicate) +const __dyn_FilterOptOriginFilterAssetDefinitionEvent = dynCodec(() => FilterOptOriginFilterAssetDefinitionEvent) const __dyn_PeerEventFilter = dynCodec(() => PeerEventFilter) const __dyn_RoleId = dynCodec(() => RoleId) const __dyn_Value = dynCodec(() => Value) @@ -178,43 +183,44 @@ const __dyn_FindTriggerById = dynCodec(() => FindTriggerById) const __dyn_CommittedBlock = dynCodec(() => CommittedBlock) const __dyn_VecPeerId = dynCodec(() => VecPeerId) const __dyn_IfInstruction = dynCodec(() => IfInstruction) +const __dyn_PermissionRemoved = dynCodec(() => PermissionRemoved) const __dyn_MapAssetDefinitionIdAssetDefinitionEntry = dynCodec(() => MapAssetDefinitionIdAssetDefinitionEntry) const __dyn_EvaluatesToVecValue = dynCodec(() => EvaluatesToVecValue) +const __dyn_Ipv4Predicate = dynCodec(() => Ipv4Predicate) const __dyn_BlockSubscriberMessage = dynCodec(() => BlockSubscriberMessage) const __dyn_WasmExecutionFail = dynCodec(() => WasmExecutionFail) -const __dyn_SignaturesOfProof = dynCodec(() => SignaturesOfProof) const __dyn_FindAssetsByDomainId = dynCodec(() => FindAssetsByDomainId) -const __dyn_IdFilterDomainId = dynCodec(() => IdFilterDomainId) const __dyn_TimeInterval = dynCodec(() => TimeInterval) +const __dyn_Validator = dynCodec(() => Validator) const __dyn_FilterOptDomainEventFilter = dynCodec(() => FilterOptDomainEventFilter) const __dyn_EvaluatesToAccountId = dynCodec(() => EvaluatesToAccountId) const __dyn_TriggerId = dynCodec(() => TriggerId) const __dyn_TransactionValue = dynCodec(() => TransactionValue) +const __dyn_Definition = dynCodec(() => Definition) const __dyn_Not = dynCodec(() => Not) const __dyn_FilterBox = dynCodec(() => FilterBox) +const __dyn_OptionDomainId = dynCodec(() => OptionDomainId) const __dyn_PredicateBox = dynCodec(() => PredicateBox) const __dyn_FindAssetQuantityById = dynCodec(() => FindAssetQuantityById) const __dyn_PipelineStatus = dynCodec(() => PipelineStatus) const __dyn_Duration = dynCodec(() => Duration) -const __dyn_HashOfMerkleTreeVersionedTransaction = dynCodec(() => HashOfMerkleTreeVersionedTransaction) const __dyn_EvaluatesToDomainId = dynCodec(() => EvaluatesToDomainId) const __dyn_Equal = dynCodec(() => Equal) const __dyn_Subtract = dynCodec(() => Subtract) const __dyn_Fixed = dynCodec(() => Fixed) const __dyn_FindAccountsByDomainId = dynCodec(() => FindAccountsByDomainId) -const __dyn_IdFilterAccountId = dynCodec(() => IdFilterAccountId) const __dyn_FindAssetsByAccountId = dynCodec(() => FindAssetsByAccountId) const __dyn_FilterOptTriggerEventFilter = dynCodec(() => FilterOptTriggerEventFilter) -const __dyn_BlockCreationTimeout = dynCodec(() => BlockCreationTimeout) const __dyn_FilterOptPeerFilter = dynCodec(() => FilterOptPeerFilter) const __dyn_FindAllAssetsDefinitions = dynCodec(() => FindAllAssetsDefinitions) const __dyn_SignatureOfQueryPayload = dynCodec(() => SignatureOfQueryPayload) -const __dyn_SignatureOfProof = dynCodec(() => SignatureOfProof) +const __dyn_IntervalU16 = dynCodec(() => IntervalU16) const __dyn_FilterOptPeerEventFilter = dynCodec(() => FilterOptPeerEventFilter) const __dyn_FindAllRoles = dynCodec(() => FindAllRoles) const __dyn_SemiIntervalU128 = dynCodec(() => SemiIntervalU128) const __dyn_RemoveKeyValueBox = dynCodec(() => RemoveKeyValueBox) const __dyn_FilterOptTriggerFilter = dynCodec(() => FilterOptTriggerFilter) +const __dyn_OriginFilterAssetDefinitionEvent = dynCodec(() => OriginFilterAssetDefinitionEvent) const __dyn_IdentifiableBox = dynCodec(() => IdentifiableBox) const __dyn_IfExpression = dynCodec(() => IfExpression) const __dyn_DomainEvent = dynCodec(() => DomainEvent) @@ -224,8 +230,8 @@ const __dyn_FilterOptEntityFilter = dynCodec(() => FilterOptEntityFilter) const __dyn_NewRole = dynCodec(() => NewRole) const __dyn_FindAssetDefinitionKeyValueByIdAndKey = dynCodec(() => FindAssetDefinitionKeyValueByIdAndKey) const __dyn_PublicKey = dynCodec(() => PublicKey) -const __dyn_VecPermissionToken = dynCodec(() => VecPermissionToken) const __dyn_EvaluatesToAssetId = dynCodec(() => EvaluatesToAssetId) +const __dyn_Ipv4Addr = dynCodec(() => Ipv4Addr) const __dyn_AssetDefinitionEvent = dynCodec(() => AssetDefinitionEvent) const __dyn_BlockHeaderValue = dynCodec(() => BlockHeaderValue) const __dyn_SetKeyValueBox = dynCodec(() => SetKeyValueBox) @@ -233,41 +239,47 @@ const __dyn_FilterOptDomainFilter = dynCodec(() => FilterOptDomainFilter) const __dyn_Predicate = dynCodec(() => Predicate) const __dyn_WasmSmartContract = dynCodec(() => WasmSmartContract) const __dyn_And = dynCodec(() => And) +const __dyn_PermissionValidatorEvent = dynCodec(() => PermissionValidatorEvent) const __dyn_ValueOfKey = dynCodec(() => ValueOfKey) const __dyn_FindRoleByRoleId = dynCodec(() => FindRoleByRoleId) const __dyn_ExecuteTriggerEvent = dynCodec(() => ExecuteTriggerEvent) -const __dyn_IdFilterAssetId = dynCodec(() => IdFilterAssetId) const __dyn_Signature = dynCodec(() => Signature) +const __dyn_HashOfMerkleTreeVersionedSignedTransaction = dynCodec(() => HashOfMerkleTreeVersionedSignedTransaction) const __dyn_BlockPublisherMessage = dynCodec(() => BlockPublisherMessage) const __dyn_PipelineEvent = dynCodec(() => PipelineEvent) const __dyn_Repeats = dynCodec(() => Repeats) const __dyn_PaginatedQueryResult = dynCodec(() => PaginatedQueryResult) const __dyn_PeerEvent = dynCodec(() => PeerEvent) +const __dyn_Ipv6Addr = dynCodec(() => Ipv6Addr) const __dyn_Expression = dynCodec(() => Expression) +const __dyn_OriginFilterDomainEvent = dynCodec(() => OriginFilterDomainEvent) const __dyn_Divide = dynCodec(() => Divide) const __dyn_OptionInstruction = dynCodec(() => OptionInstruction) const __dyn_FindAssetsByDomainIdAndAssetDefinitionId = dynCodec(() => FindAssetsByDomainIdAndAssetDefinitionId) const __dyn_Less = dynCodec(() => Less) +const __dyn_Token = dynCodec(() => Token) const __dyn_PipelineEntityKind = dynCodec(() => PipelineEntityKind) const __dyn_IpfsPath = dynCodec(() => IpfsPath) const __dyn_VersionedValidTransaction = dynCodec(() => VersionedValidTransaction) const __dyn_FindAllRoleIds = dynCodec(() => FindAllRoleIds) const __dyn_VecInstruction = dynCodec(() => VecInstruction) const __dyn_BlockHeader = dynCodec(() => BlockHeader) +const __dyn_OriginFilterPeerEvent = dynCodec(() => OriginFilterPeerEvent) const __dyn_TriggerEventFilter = dynCodec(() => TriggerEventFilter) const __dyn_UnsatisfiedSignatureConditionFail = dynCodec(() => UnsatisfiedSignatureConditionFail) -const __dyn_FilterOptIdFilterAccountId = dynCodec(() => FilterOptIdFilterAccountId) const __dyn_Event = dynCodec(() => Event) const __dyn_Pair = dynCodec(() => Pair) +const __dyn_Type = dynCodec(() => Type) const __dyn_PeerFilter = dynCodec(() => PeerFilter) const __dyn_Pagination = dynCodec(() => Pagination) const __dyn_Greater = dynCodec(() => Greater) +const __dyn_FilterOptOriginFilterTriggerEvent = dynCodec(() => FilterOptOriginFilterTriggerEvent) const __dyn_TriggerFilterBox = dynCodec(() => TriggerFilterBox) const __dyn_EvaluatesToIdBox = dynCodec(() => EvaluatesToIdBox) +const __dyn_Id = dynCodec(() => Id) const __dyn_EntityFilter = dynCodec(() => EntityFilter) const __dyn_AssetDefinitionFilter = dynCodec(() => AssetDefinitionFilter) const __dyn_AssetValueType = dynCodec(() => AssetValueType) -const __dyn_NoTransactionReceiptReceived = dynCodec(() => NoTransactionReceiptReceived) const __dyn_RoleEventFilter = dynCodec(() => RoleEventFilter) const __dyn_FindAssetDefinitionById = dynCodec(() => FindAssetDefinitionById) const __dyn_Mintable = dynCodec(() => Mintable) @@ -276,26 +288,23 @@ const __dyn_DomainFilter = dynCodec(() => DomainFilter) const __dyn_EvaluatesToValue = dynCodec(() => EvaluatesToValue) const __dyn_VecVersionedRejectedTransaction = dynCodec(() => VecVersionedRejectedTransaction) const __dyn_OptionPipelineStatusKind = dynCodec(() => OptionPipelineStatusKind) -const __dyn_Range = dynCodec(() => Range) +const __dyn_FilterOptOriginFilterDomainEvent = dynCodec(() => FilterOptOriginFilterDomainEvent) const __dyn_ActionFilterBox = dynCodec(() => ActionFilterBox) const __dyn_PeerId = dynCodec(() => PeerId) const __dyn_VecValue = dynCodec(() => VecValue) const __dyn_FindAllTransactions = dynCodec(() => FindAllTransactions) -const __dyn_FilterOptIdFilterAssetId = dynCodec(() => FilterOptIdFilterAssetId) const __dyn_FilterOptAssetEventFilter = dynCodec(() => FilterOptAssetEventFilter) -const __dyn_ProofChain = dynCodec(() => ProofChain) const __dyn_AssetDefinitionId = dynCodec(() => AssetDefinitionId) +const __dyn_FindAllPermissionTokenDefinitions = dynCodec(() => FindAllPermissionTokenDefinitions) const __dyn_FindAssetsByName = dynCodec(() => FindAssetsByName) const __dyn_EvaluatesToTriggerId = dynCodec(() => EvaluatesToTriggerId) -const __dyn_MismatchValidatorType = dynCodec(() => MismatchValidatorType) -const __dyn_Transaction = dynCodec(() => Transaction) +const __dyn_MapNameValueKind = dynCodec(() => MapNameValueKind) const __dyn_AtIndex = dynCodec(() => AtIndex) -const __dyn_HashOfProof = dynCodec(() => HashOfProof) +const __dyn_FilterOptOriginFilterPeerEvent = dynCodec(() => FilterOptOriginFilterPeerEvent) const __dyn_OptionU32 = dynCodec(() => OptionU32) const __dyn_DomainId = dynCodec(() => DomainId) const __dyn_Contains = dynCodec(() => Contains) const __dyn_EvaluatesToU32 = dynCodec(() => EvaluatesToU32) -const __dyn_FilterOptIdFilterRoleId = dynCodec(() => FilterOptIdFilterRoleId) const __dyn_EvaluatesToBool = dynCodec(() => EvaluatesToBool) const __dyn_SignatureOfTransactionPayload = dynCodec(() => SignatureOfTransactionPayload) @@ -305,7 +314,6 @@ interface Account__actual { id: AccountId assets: MapAssetIdAsset signatories: VecPublicKey - permission_tokens: VecPermissionToken signature_check_condition: SignatureCheckCondition metadata: Metadata roles: VecRoleId @@ -317,7 +325,6 @@ const Account: StructCodecAndFactory = createStructCod ['id', __dyn_AccountId], ['assets', __dyn_MapAssetIdAsset], ['signatories', __dyn_VecPublicKey], - ['permission_tokens', __dyn_VecPermissionToken], ['signature_check_condition', __dyn_SignatureCheckCondition], ['metadata', __dyn_Metadata], ['roles', __dyn_VecRoleId] @@ -358,7 +365,6 @@ const AccountEvent: EnumCodecAndFactory = createEnumCodec interface AccountEventFilter extends Opaque {} const AccountEventFilter: EnumCodecAndFactory = createEnumCodec('AccountEventFilter', [ - [0, 'ByAsset', __dyn_FilterOptAssetFilter], - [1, 'ByCreated'], - [2, 'ByDeleted'], - [3, 'ByAuthenticationAdded'], - [4, 'ByAuthenticationRemoved'], - [5, 'ByPermissionAdded'], - [6, 'ByPermissionRemoved'], - [7, 'ByRoleRevoked'], - [8, 'ByRoleGranted'], - [9, 'ByMetadataInserted'], - [10, 'ByMetadataRemoved'] + [0, 'ByCreated'], + [1, 'ByDeleted'], + [2, 'ByAuthenticationAdded'], + [3, 'ByAuthenticationRemoved'], + [4, 'ByPermissionAdded'], + [5, 'ByPermissionRemoved'], + [6, 'ByRoleRevoked'], + [7, 'ByRoleGranted'], + [8, 'ByMetadataInserted'], + [9, 'ByMetadataRemoved'], + [10, 'ByAsset', __dyn_FilterOptAssetFilter] ]) // Type: AccountFilter interface AccountFilter__actual { - id_filter: FilterOptIdFilterAccountId + origin_filter: FilterOptOriginFilterAccountEvent event_filter: FilterOptAccountEventFilter } interface AccountFilter extends Opaque {} const AccountFilter: StructCodecAndFactory = createStructCodec('AccountFilter', [ - ['id_filter', __dyn_FilterOptIdFilterAccountId], + ['origin_filter', __dyn_FilterOptOriginFilterAccountEvent], ['event_filter', __dyn_FilterOptAccountEventFilter] ]) @@ -463,12 +470,26 @@ const And: StructCodecAndFactory = createStructCodec {} + +interface ArrayU16L8 extends Opaque {} + +const ArrayU16L8: ArrayCodecAndFactory = createArrayCodec('ArrayU16L8', U16, 8) + // Type: ArrayU8L32 type ArrayU8L32 = Uint8Array const ArrayU8L32: Codec = createArrayU8Codec('ArrayU8L32', 32) +// Type: ArrayU8L4 + +type ArrayU8L4 = Uint8Array + +const ArrayU8L4: Codec = createArrayU8Codec('ArrayU8L4', 4) + // Type: Asset interface Asset__actual { @@ -539,8 +560,8 @@ const AssetDefinitionEvent: EnumCodecAndFactory = createEn type AssetDefinitionEventFilter__actual = Enum< | 'ByCreated' - | 'ByDeleted' | 'ByMintabilityChanged' + | 'ByDeleted' | 'ByMetadataInserted' | 'ByMetadataRemoved' > @@ -549,8 +570,8 @@ interface AssetDefinitionEventFilter extends Opaque = createEnumCodec('AssetDefinitionEventFilter', [ [0, 'ByCreated'], - [1, 'ByDeleted'], - [2, 'ByMintabilityChanged'], + [1, 'ByMintabilityChanged'], + [2, 'ByDeleted'], [3, 'ByMetadataInserted'], [4, 'ByMetadataRemoved'] ]) @@ -558,14 +579,14 @@ const AssetDefinitionEventFilter: EnumCodecAndFactory {} const AssetDefinitionFilter: StructCodecAndFactory = createStructCodec('AssetDefinitionFilter', [ - ['id_filter', __dyn_FilterOptIdFilterAssetDefinitionId], + ['origin_filter', __dyn_FilterOptOriginFilterAssetDefinitionEvent], ['event_filter', __dyn_FilterOptAssetDefinitionEventFilter] ]) @@ -630,14 +651,14 @@ const AssetEventFilter: EnumCodecAndFactory = createEnumCodec< // Type: AssetFilter interface AssetFilter__actual { - id_filter: FilterOptIdFilterAssetId + origin_filter: FilterOptOriginFilterAssetEvent event_filter: FilterOptAssetEventFilter } interface AssetFilter extends Opaque {} const AssetFilter: StructCodecAndFactory = createStructCodec('AssetFilter', [ - ['id_filter', __dyn_FilterOptIdFilterAssetId], + ['origin_filter', __dyn_FilterOptOriginFilterAssetEvent], ['event_filter', __dyn_FilterOptAssetEventFilter] ]) @@ -705,10 +726,6 @@ const AtIndex: StructCodecAndFactory = createStructCod ['predicate', __dyn_Predicate] ]) -// Type: BlockCreationTimeout - -import { Void as BlockCreationTimeout } from '@scale-codec/definition-runtime' - // Type: BlockHeader interface BlockHeader__actual { @@ -716,10 +733,8 @@ interface BlockHeader__actual { consensus_estimation: U64 height: U64 previous_block_hash: HashOfVersionedCommittedBlock - transactions_hash: HashOfMerkleTreeVersionedTransaction - rejected_transactions_hash: HashOfMerkleTreeVersionedTransaction - view_change_proofs: ProofChain - invalidated_blocks_hashes: VecHashOfVersionedValidBlock + transactions_hash: HashOfMerkleTreeVersionedSignedTransaction + rejected_transactions_hash: HashOfMerkleTreeVersionedSignedTransaction genesis_topology: OptionTopology } @@ -730,10 +745,8 @@ const BlockHeader: StructCodecAndFactory = cre ['consensus_estimation', U64], ['height', U64], ['previous_block_hash', __dyn_HashOfVersionedCommittedBlock], - ['transactions_hash', __dyn_HashOfMerkleTreeVersionedTransaction], - ['rejected_transactions_hash', __dyn_HashOfMerkleTreeVersionedTransaction], - ['view_change_proofs', __dyn_ProofChain], - ['invalidated_blocks_hashes', __dyn_VecHashOfVersionedValidBlock], + ['transactions_hash', __dyn_HashOfMerkleTreeVersionedSignedTransaction], + ['rejected_transactions_hash', __dyn_HashOfMerkleTreeVersionedSignedTransaction], ['genesis_topology', __dyn_OptionTopology] ]) @@ -743,8 +756,8 @@ interface BlockHeaderValue__actual { timestamp: U128 height: U64 previous_block_hash: Hash - transactions_hash: HashOfMerkleTreeVersionedTransaction - rejected_transactions_hash: HashOfMerkleTreeVersionedTransaction + transactions_hash: HashOfMerkleTreeVersionedSignedTransaction + rejected_transactions_hash: HashOfMerkleTreeVersionedSignedTransaction invalidated_blocks_hashes: VecHash current_block_hash: Hash } @@ -755,8 +768,8 @@ const BlockHeaderValue: StructCodecAndFactory = createStructCod ['destination_id', __dyn_EvaluatesToIdBox] ]) -// Type: CommitTimeout - -interface CommitTimeout__actual { - hash: HashOfVersionedValidBlock -} - -interface CommitTimeout extends Opaque {} - -const CommitTimeout: StructCodecAndFactory = createStructCodec('CommitTimeout', [ - ['hash', __dyn_HashOfVersionedValidBlock] -]) - // Type: CommittedBlock interface CommittedBlock__actual { @@ -949,6 +950,8 @@ type DataEvent__actual = Enum< | ['Asset', AssetEvent] | ['Trigger', TriggerEvent] | ['Role', RoleEvent] + | ['PermissionToken', PermissionTokenEvent] + | ['PermissionValidator', PermissionValidatorEvent] > interface DataEvent extends Opaque {} @@ -960,23 +963,23 @@ const DataEvent: EnumCodecAndFactory = createEnumCodec +interface Definition__actual { + id: Id + params: MapNameValueKind +} -interface DenialReason extends Opaque {} +interface Definition extends Opaque {} -const DenialReason: EnumCodecAndFactory = createEnumCodec('DenialReason', [ - [0, 'ValidatorTypeMismatch', __dyn_MismatchValidatorType], - [1, 'Custom', Str], - [2, 'NoValidatorsProvided'] +const Definition: StructCodecAndFactory = createStructCodec('Definition', [ + ['id', __dyn_Id], + ['params', __dyn_MapNameValueKind] ]) // Type: Divide @@ -1038,36 +1041,36 @@ const DomainEvent: EnumCodecAndFactory = createEnumCodec interface DomainEventFilter extends Opaque {} const DomainEventFilter: EnumCodecAndFactory = createEnumCodec('DomainEventFilter', [ - [0, 'ByAccount', __dyn_FilterOptAccountFilter], - [1, 'ByAssetDefinition', __dyn_FilterOptAssetDefinitionFilter], - [2, 'ByCreated'], - [3, 'ByDeleted'], - [4, 'ByMetadataInserted'], - [5, 'ByMetadataRemoved'] + [0, 'ByCreated'], + [1, 'ByDeleted'], + [2, 'ByMetadataInserted'], + [3, 'ByMetadataRemoved'], + [4, 'ByAccount', __dyn_FilterOptAccountFilter], + [5, 'ByAssetDefinition', __dyn_FilterOptAssetDefinitionFilter] ]) // Type: DomainFilter interface DomainFilter__actual { - id_filter: FilterOptIdFilterDomainId + origin_filter: FilterOptOriginFilterDomainEvent event_filter: FilterOptDomainEventFilter } interface DomainFilter extends Opaque {} const DomainFilter: StructCodecAndFactory = createStructCodec('DomainFilter', [ - ['id_filter', __dyn_FilterOptIdFilterDomainId], + ['origin_filter', __dyn_FilterOptOriginFilterDomainEvent], ['event_filter', __dyn_FilterOptDomainEventFilter] ]) @@ -1617,102 +1620,102 @@ const FilterOptEntityFilter: EnumCodecAndFactory = create [1, 'BySome', __dyn_EntityFilter] ]) -// Type: FilterOptIdFilterAccountId +// Type: FilterOptOriginFilterAccountEvent -type FilterOptIdFilterAccountId__actual = Enum< +type FilterOptOriginFilterAccountEvent__actual = Enum< | 'AcceptAll' - | ['BySome', IdFilterAccountId] + | ['BySome', OriginFilterAccountEvent] > -interface FilterOptIdFilterAccountId extends Opaque {} +interface FilterOptOriginFilterAccountEvent extends Opaque {} -const FilterOptIdFilterAccountId: EnumCodecAndFactory = createEnumCodec('FilterOptIdFilterAccountId', [ +const FilterOptOriginFilterAccountEvent: EnumCodecAndFactory = createEnumCodec('FilterOptOriginFilterAccountEvent', [ [0, 'AcceptAll'], - [1, 'BySome', __dyn_IdFilterAccountId] + [1, 'BySome', __dyn_OriginFilterAccountEvent] ]) -// Type: FilterOptIdFilterAssetDefinitionId +// Type: FilterOptOriginFilterAssetDefinitionEvent -type FilterOptIdFilterAssetDefinitionId__actual = Enum< +type FilterOptOriginFilterAssetDefinitionEvent__actual = Enum< | 'AcceptAll' - | ['BySome', IdFilterAssetDefinitionId] + | ['BySome', OriginFilterAssetDefinitionEvent] > -interface FilterOptIdFilterAssetDefinitionId extends Opaque {} +interface FilterOptOriginFilterAssetDefinitionEvent extends Opaque {} -const FilterOptIdFilterAssetDefinitionId: EnumCodecAndFactory = createEnumCodec('FilterOptIdFilterAssetDefinitionId', [ +const FilterOptOriginFilterAssetDefinitionEvent: EnumCodecAndFactory = createEnumCodec('FilterOptOriginFilterAssetDefinitionEvent', [ [0, 'AcceptAll'], - [1, 'BySome', __dyn_IdFilterAssetDefinitionId] + [1, 'BySome', __dyn_OriginFilterAssetDefinitionEvent] ]) -// Type: FilterOptIdFilterAssetId +// Type: FilterOptOriginFilterAssetEvent -type FilterOptIdFilterAssetId__actual = Enum< +type FilterOptOriginFilterAssetEvent__actual = Enum< | 'AcceptAll' - | ['BySome', IdFilterAssetId] + | ['BySome', OriginFilterAssetEvent] > -interface FilterOptIdFilterAssetId extends Opaque {} +interface FilterOptOriginFilterAssetEvent extends Opaque {} -const FilterOptIdFilterAssetId: EnumCodecAndFactory = createEnumCodec('FilterOptIdFilterAssetId', [ +const FilterOptOriginFilterAssetEvent: EnumCodecAndFactory = createEnumCodec('FilterOptOriginFilterAssetEvent', [ [0, 'AcceptAll'], - [1, 'BySome', __dyn_IdFilterAssetId] + [1, 'BySome', __dyn_OriginFilterAssetEvent] ]) -// Type: FilterOptIdFilterDomainId +// Type: FilterOptOriginFilterDomainEvent -type FilterOptIdFilterDomainId__actual = Enum< +type FilterOptOriginFilterDomainEvent__actual = Enum< | 'AcceptAll' - | ['BySome', IdFilterDomainId] + | ['BySome', OriginFilterDomainEvent] > -interface FilterOptIdFilterDomainId extends Opaque {} +interface FilterOptOriginFilterDomainEvent extends Opaque {} -const FilterOptIdFilterDomainId: EnumCodecAndFactory = createEnumCodec('FilterOptIdFilterDomainId', [ +const FilterOptOriginFilterDomainEvent: EnumCodecAndFactory = createEnumCodec('FilterOptOriginFilterDomainEvent', [ [0, 'AcceptAll'], - [1, 'BySome', __dyn_IdFilterDomainId] + [1, 'BySome', __dyn_OriginFilterDomainEvent] ]) -// Type: FilterOptIdFilterPeerId +// Type: FilterOptOriginFilterPeerEvent -type FilterOptIdFilterPeerId__actual = Enum< +type FilterOptOriginFilterPeerEvent__actual = Enum< | 'AcceptAll' - | ['BySome', IdFilterPeerId] + | ['BySome', OriginFilterPeerEvent] > -interface FilterOptIdFilterPeerId extends Opaque {} +interface FilterOptOriginFilterPeerEvent extends Opaque {} -const FilterOptIdFilterPeerId: EnumCodecAndFactory = createEnumCodec('FilterOptIdFilterPeerId', [ +const FilterOptOriginFilterPeerEvent: EnumCodecAndFactory = createEnumCodec('FilterOptOriginFilterPeerEvent', [ [0, 'AcceptAll'], - [1, 'BySome', __dyn_IdFilterPeerId] + [1, 'BySome', __dyn_OriginFilterPeerEvent] ]) -// Type: FilterOptIdFilterRoleId +// Type: FilterOptOriginFilterRoleEvent -type FilterOptIdFilterRoleId__actual = Enum< +type FilterOptOriginFilterRoleEvent__actual = Enum< | 'AcceptAll' - | ['BySome', IdFilterRoleId] + | ['BySome', OriginFilterRoleEvent] > -interface FilterOptIdFilterRoleId extends Opaque {} +interface FilterOptOriginFilterRoleEvent extends Opaque {} -const FilterOptIdFilterRoleId: EnumCodecAndFactory = createEnumCodec('FilterOptIdFilterRoleId', [ +const FilterOptOriginFilterRoleEvent: EnumCodecAndFactory = createEnumCodec('FilterOptOriginFilterRoleEvent', [ [0, 'AcceptAll'], - [1, 'BySome', __dyn_IdFilterRoleId] + [1, 'BySome', __dyn_OriginFilterRoleEvent] ]) -// Type: FilterOptIdFilterTriggerId +// Type: FilterOptOriginFilterTriggerEvent -type FilterOptIdFilterTriggerId__actual = Enum< +type FilterOptOriginFilterTriggerEvent__actual = Enum< | 'AcceptAll' - | ['BySome', IdFilterTriggerId] + | ['BySome', OriginFilterTriggerEvent] > -interface FilterOptIdFilterTriggerId extends Opaque {} +interface FilterOptOriginFilterTriggerEvent extends Opaque {} -const FilterOptIdFilterTriggerId: EnumCodecAndFactory = createEnumCodec('FilterOptIdFilterTriggerId', [ +const FilterOptOriginFilterTriggerEvent: EnumCodecAndFactory = createEnumCodec('FilterOptOriginFilterTriggerEvent', [ [0, 'AcceptAll'], - [1, 'BySome', __dyn_IdFilterTriggerId] + [1, 'BySome', __dyn_OriginFilterTriggerEvent] ]) // Type: FilterOptPeerEventFilter @@ -1877,6 +1880,10 @@ import { Void as FindAllAssets } from '@scale-codec/definition-runtime' import { Void as FindAllAssetsDefinitions } from '@scale-codec/definition-runtime' +// Type: FindAllBlockHeaders + +import { Void as FindAllBlockHeaders } from '@scale-codec/definition-runtime' + // Type: FindAllBlocks import { Void as FindAllBlocks } from '@scale-codec/definition-runtime' @@ -1889,6 +1896,10 @@ import { Void as FindAllDomains } from '@scale-codec/definition-runtime' import { Void as FindAllPeers } from '@scale-codec/definition-runtime' +// Type: FindAllPermissionTokenDefinitions + +import { Void as FindAllPermissionTokenDefinitions } from '@scale-codec/definition-runtime' + // Type: FindAllRoleIds import { Void as FindAllRoleIds } from '@scale-codec/definition-runtime' @@ -2027,6 +2038,18 @@ const FindAssetsByName: StructCodecAndFactory {} + +const FindBlockHeaderByHash: StructCodecAndFactory = createStructCodec('FindBlockHeaderByHash', [ + ['hash', __dyn_EvaluatesToHash] +]) + // Type: FindDomainById interface FindDomainById__actual { @@ -2062,11 +2085,13 @@ type FindError__actual = Enum< | ['Domain', DomainId] | ['MetadataKey', Name] | ['Block', HashOfVersionedCommittedBlock] - | ['Transaction', HashOfVersionedTransaction] + | ['Transaction', HashOfVersionedSignedTransaction] | ['Context', Str] | ['Peer', PeerId] | ['Trigger', TriggerId] | ['Role', RoleId] + | ['PermissionTokenDefinition', Id] + | ['Validator', Id] > interface FindError extends Opaque {} @@ -2078,11 +2103,13 @@ const FindError: EnumCodecAndFactory = createEnumCodec = __dyn_ArrayU8L32 -// Type: HashOfMerkleTreeVersionedTransaction - -type HashOfMerkleTreeVersionedTransaction = Hash - -const HashOfMerkleTreeVersionedTransaction: Codec = __dyn_Hash +// Type: HashOfMerkleTreeVersionedSignedTransaction -// Type: HashOfProof +type HashOfMerkleTreeVersionedSignedTransaction = Hash -type HashOfProof = Hash - -const HashOfProof: Codec = __dyn_Hash +const HashOfMerkleTreeVersionedSignedTransaction: Codec = __dyn_Hash // Type: HashOfVersionedCommittedBlock @@ -2257,17 +2278,23 @@ type HashOfVersionedCommittedBlock = Hash const HashOfVersionedCommittedBlock: Codec = __dyn_Hash -// Type: HashOfVersionedTransaction +// Type: HashOfVersionedSignedTransaction -type HashOfVersionedTransaction = Hash +type HashOfVersionedSignedTransaction = Hash -const HashOfVersionedTransaction: Codec = __dyn_Hash +const HashOfVersionedSignedTransaction: Codec = __dyn_Hash -// Type: HashOfVersionedValidBlock +// Type: Id -type HashOfVersionedValidBlock = Hash +interface Id__actual { + name: Name +} -const HashOfVersionedValidBlock: Codec = __dyn_Hash +interface Id extends Opaque {} + +const Id: StructCodecAndFactory = createStructCodec('Id', [ + ['name', __dyn_Name] +]) // Type: IdBox @@ -2279,6 +2306,8 @@ type IdBox__actual = Enum< | ['PeerId', PeerId] | ['TriggerId', TriggerId] | ['RoleId', RoleId] + | ['PermissionTokenDefinitionId', Id] + | ['ValidatorId', Id] > interface IdBox extends Opaque {} @@ -2290,51 +2319,11 @@ const IdBox: EnumCodecAndFactory = createEnumCodec( [3, 'AssetId', __dyn_AssetId], [4, 'PeerId', __dyn_PeerId], [5, 'TriggerId', __dyn_TriggerId], - [6, 'RoleId', __dyn_RoleId] + [6, 'RoleId', __dyn_RoleId], + [7, 'PermissionTokenDefinitionId', __dyn_Id], + [8, 'ValidatorId', __dyn_Id] ]) -// Type: IdFilterAccountId - -type IdFilterAccountId = AccountId - -const IdFilterAccountId: Codec = __dyn_AccountId - -// Type: IdFilterAssetDefinitionId - -type IdFilterAssetDefinitionId = AssetDefinitionId - -const IdFilterAssetDefinitionId: Codec = __dyn_AssetDefinitionId - -// Type: IdFilterAssetId - -type IdFilterAssetId = AssetId - -const IdFilterAssetId: Codec = __dyn_AssetId - -// Type: IdFilterDomainId - -type IdFilterDomainId = DomainId - -const IdFilterDomainId: Codec = __dyn_DomainId - -// Type: IdFilterPeerId - -type IdFilterPeerId = PeerId - -const IdFilterPeerId: Codec = __dyn_PeerId - -// Type: IdFilterRoleId - -type IdFilterRoleId = RoleId - -const IdFilterRoleId: Codec = __dyn_RoleId - -// Type: IdFilterTriggerId - -type IdFilterTriggerId = TriggerId - -const IdFilterTriggerId: Codec = __dyn_TriggerId - // Type: IdentifiableBox type IdentifiableBox__actual = Enum< @@ -2349,6 +2338,8 @@ type IdentifiableBox__actual = Enum< | ['Asset', Asset] | ['Trigger', TriggerFilterBox] | ['Role', Role] + | ['PermissionTokenDefinition', Definition] + | ['Validator', Validator] > interface IdentifiableBox extends Opaque {} @@ -2364,7 +2355,9 @@ const IdentifiableBox: EnumCodecAndFactory = createEnumCodec {} + +const IntervalU16: StructCodecAndFactory = createStructCodec('IntervalU16', [ + ['start', U16], + ['limit', U16] +]) + +// Type: IntervalU16L8 + +interface IntervalU16L8__actual extends Array {} + +interface IntervalU16L8 extends Opaque {} + +const IntervalU16L8: ArrayCodecAndFactory = createArrayCodec('IntervalU16L8', __dyn_IntervalU16, 8) + +// Type: IntervalU8 + +interface IntervalU8__actual { + start: U8 + limit: U8 +} + +interface IntervalU8 extends Opaque {} + +const IntervalU8: StructCodecAndFactory = createStructCodec('IntervalU8', [ + ['start', U8], + ['limit', U8] +]) + +// Type: IntervalU8L4 + +interface IntervalU8L4__actual extends Array {} + +interface IntervalU8L4 extends Opaque {} + +const IntervalU8L4: ArrayCodecAndFactory = createArrayCodec('IntervalU8L4', __dyn_IntervalU8, 4) + // Type: IpfsPath type IpfsPath = Str const IpfsPath: Codec = Str +// Type: Ipv4Addr + +type Ipv4Addr = ArrayU8L4 + +const Ipv4Addr: Codec = __dyn_ArrayU8L4 + +// Type: Ipv4Predicate + +type Ipv4Predicate = IntervalU8L4 + +const Ipv4Predicate: Codec = __dyn_IntervalU8L4 + +// Type: Ipv6Addr + +type Ipv6Addr = ArrayU16L8 + +const Ipv6Addr: Codec = __dyn_ArrayU16L8 + +// Type: Ipv6Predicate + +type Ipv6Predicate = IntervalU16L8 + +const Ipv6Predicate: Codec = __dyn_IntervalU16L8 + // Type: Less interface Less__actual { @@ -2503,21 +2564,21 @@ interface MapNameValue extends Opaque {} const MapNameValue: MapCodecAndFactory = createMapCodec('MapNameValue', __dyn_Name, __dyn_Value) -// Type: MapPublicKeySignatureOfCommittedBlock +// Type: MapNameValueKind -type MapPublicKeySignatureOfCommittedBlock__actual = Map +type MapNameValueKind__actual = Map -interface MapPublicKeySignatureOfCommittedBlock extends Opaque {} +interface MapNameValueKind extends Opaque {} -const MapPublicKeySignatureOfCommittedBlock: MapCodecAndFactory = createMapCodec('MapPublicKeySignatureOfCommittedBlock', __dyn_PublicKey, __dyn_SignatureOfCommittedBlock) +const MapNameValueKind: MapCodecAndFactory = createMapCodec('MapNameValueKind', __dyn_Name, __dyn_ValueKind) -// Type: MapPublicKeySignatureOfProof +// Type: MapPublicKeySignatureOfCommittedBlock -type MapPublicKeySignatureOfProof__actual = Map +type MapPublicKeySignatureOfCommittedBlock__actual = Map -interface MapPublicKeySignatureOfProof extends Opaque {} +interface MapPublicKeySignatureOfCommittedBlock extends Opaque {} -const MapPublicKeySignatureOfProof: MapCodecAndFactory = createMapCodec('MapPublicKeySignatureOfProof', __dyn_PublicKey, __dyn_SignatureOfProof) +const MapPublicKeySignatureOfCommittedBlock: MapCodecAndFactory = createMapCodec('MapPublicKeySignatureOfCommittedBlock', __dyn_PublicKey, __dyn_SignatureOfCommittedBlock) // Type: MapPublicKeySignatureOfTransactionPayload @@ -2535,13 +2596,13 @@ interface MapStringEvaluatesToValue extends Opaque = createMapCodec('MapStringEvaluatesToValue', Str, __dyn_EvaluatesToValue) -// Type: MerkleTreeVersionedTransaction +// Type: MerkleTreeVersionedSignedTransaction -type MerkleTreeVersionedTransaction__actual = HashOfVersionedTransaction[] +type MerkleTreeVersionedSignedTransaction__actual = HashOfVersionedSignedTransaction[] -interface MerkleTreeVersionedTransaction extends Opaque {} +interface MerkleTreeVersionedSignedTransaction extends Opaque {} -const MerkleTreeVersionedTransaction: ArrayCodecAndFactory = createVecCodec('MerkleTreeVersionedTransaction', __dyn_HashOfVersionedTransaction) +const MerkleTreeVersionedSignedTransaction: ArrayCodecAndFactory = createVecCodec('MerkleTreeVersionedSignedTransaction', __dyn_HashOfVersionedSignedTransaction) // Type: Metadata @@ -2585,20 +2646,6 @@ const Mintable: EnumCodecAndFactory = createEnumCodec {} - -const MismatchValidatorType: StructCodecAndFactory = createStructCodec('MismatchValidatorType', [ - ['expected', __dyn_ValidatorType], - ['actual', __dyn_ValidatorType] -]) - // Type: Mod interface Mod__actual { @@ -2695,10 +2742,6 @@ const NewRole: StructCodecAndFactory = createStructCod ['inner', __dyn_Role] ]) -// Type: NoTransactionReceiptReceived - -import { Void as NoTransactionReceiptReceived } from '@scale-codec/definition-runtime' - // Type: Not interface Not__actual { @@ -2723,6 +2766,14 @@ const NotPermittedFail: StructCodecAndFactory {} + +interface OptionDomainId extends Opaque {} + +const OptionDomainId: EnumCodecAndFactory = createOptionCodec('OptionDomainId', __dyn_DomainId) + // Type: OptionDuration interface OptionDuration__actual extends Option {} @@ -2755,6 +2806,14 @@ interface OptionIpfsPath extends Opaque const OptionIpfsPath: EnumCodecAndFactory = createOptionCodec('OptionIpfsPath', __dyn_IpfsPath) +// Type: OptionName + +interface OptionName__actual extends Option {} + +interface OptionName extends Opaque {} + +const OptionName: EnumCodecAndFactory = createOptionCodec('OptionName', __dyn_Name) + // Type: OptionPipelineEntityKind interface OptionPipelineEntityKind__actual extends Option {} @@ -2809,12 +2868,55 @@ const Or: StructCodecAndFactory = createStructCodec = __dyn_AccountId + +// Type: OriginFilterAssetDefinitionEvent + +type OriginFilterAssetDefinitionEvent = AssetDefinitionId + +const OriginFilterAssetDefinitionEvent: Codec = __dyn_AssetDefinitionId + +// Type: OriginFilterAssetEvent + +type OriginFilterAssetEvent = AssetId + +const OriginFilterAssetEvent: Codec = __dyn_AssetId + +// Type: OriginFilterDomainEvent + +type OriginFilterDomainEvent = DomainId + +const OriginFilterDomainEvent: Codec = __dyn_DomainId + +// Type: OriginFilterPeerEvent + +type OriginFilterPeerEvent = PeerId + +const OriginFilterPeerEvent: Codec = __dyn_PeerId + +// Type: OriginFilterRoleEvent + +type OriginFilterRoleEvent = RoleId + +const OriginFilterRoleEvent: Codec = __dyn_RoleId + +// Type: OriginFilterTriggerEvent + +type OriginFilterTriggerEvent = TriggerId + +const OriginFilterTriggerEvent: Codec = __dyn_TriggerId + // Type: PaginatedQueryResult interface PaginatedQueryResult__actual { result: QueryResult filter: PredicateBox pagination: Pagination + sorting: Sorting total: U64 } @@ -2824,6 +2926,7 @@ const PaginatedQueryResult: StructCodecAndFactory = createEnumCodec {} const PeerFilter: StructCodecAndFactory = createStructCodec('PeerFilter', [ - ['id_filter', __dyn_FilterOptIdFilterPeerId], + ['origin_filter', __dyn_FilterOptOriginFilterPeerEvent], ['event_filter', __dyn_FilterOptPeerEventFilter] ]) @@ -2941,18 +3044,46 @@ const PeerId: StructCodecAndFactory = createStructCodec< ['public_key', __dyn_PublicKey] ]) -// Type: PermissionToken +// Type: PermissionRemoved -interface PermissionToken__actual { - name: Name - params: MapNameValue +interface PermissionRemoved__actual { + role_id: RoleId + permission_definition_id: Id } -interface PermissionToken extends Opaque {} +interface PermissionRemoved extends Opaque {} -const PermissionToken: StructCodecAndFactory = createStructCodec('PermissionToken', [ - ['name', __dyn_Name], - ['params', __dyn_MapNameValue] +const PermissionRemoved: StructCodecAndFactory = createStructCodec('PermissionRemoved', [ + ['role_id', __dyn_RoleId], + ['permission_definition_id', __dyn_Id] +]) + +// Type: PermissionTokenEvent + +type PermissionTokenEvent__actual = Enum< + | ['DefinitionCreated', Definition] + | ['DefinitionDeleted', Definition] +> + +interface PermissionTokenEvent extends Opaque {} + +const PermissionTokenEvent: EnumCodecAndFactory = createEnumCodec('PermissionTokenEvent', [ + [0, 'DefinitionCreated', __dyn_Definition], + [1, 'DefinitionDeleted', __dyn_Definition] +]) + +// Type: PermissionValidatorEvent + +type PermissionValidatorEvent__actual = Enum< + | ['Added', Id] + | ['Removed', Id] +> + +interface PermissionValidatorEvent extends Opaque {} + +const PermissionValidatorEvent: EnumCodecAndFactory = createEnumCodec('PermissionValidatorEvent', [ + [0, 'Added', __dyn_Id], + [1, 'Removed', __dyn_Id] ]) // Type: PipelineEntityKind @@ -3039,8 +3170,10 @@ type Predicate__actual = Enum< | ['Identifiable', Predicate] | ['Container', Container] | ['Display', Predicate] - | ['Numerical', Range] + | ['Numerical', SemiRange] | ['TimeStamp', SemiIntervalU128] + | ['Ipv4Addr', Ipv4Predicate] + | ['Ipv6Addr', Ipv6Predicate] | 'Pass' > @@ -3050,9 +3183,11 @@ const Predicate: EnumCodecAndFactory = createEnumCodec = createEnumCodec {} - -const Proof: StructCodecAndFactory = createStructCodec('Proof', [ - ['payload', __dyn_ProofPayload], - ['signatures', __dyn_SignaturesOfProof] -]) - -// Type: ProofChain - -interface ProofChain__actual { - proofs: VecProof -} - -interface ProofChain extends Opaque {} - -const ProofChain: StructCodecAndFactory = createStructCodec('ProofChain', [ - ['proofs', __dyn_VecProof] -]) - -// Type: ProofPayload - -interface ProofPayload__actual { - previous_proof: HashOfProof - latest_block: HashOfVersionedCommittedBlock - reason: Reason -} - -interface ProofPayload extends Opaque {} - -const ProofPayload: StructCodecAndFactory = createStructCodec('ProofPayload', [ - ['previous_proof', __dyn_HashOfProof], - ['latest_block', __dyn_HashOfVersionedCommittedBlock], - ['reason', __dyn_Reason] -]) - // Type: PublicKey interface PublicKey__actual { @@ -3155,10 +3248,13 @@ type QueryBox__actual = Enum< | ['FindDomainKeyValueByIdAndKey', FindDomainKeyValueByIdAndKey] | ['FindAllPeers', FindAllPeers] | ['FindAllBlocks', FindAllBlocks] + | ['FindAllBlockHeaders', FindAllBlockHeaders] + | ['FindBlockHeaderByHash', FindBlockHeaderByHash] | ['FindAllTransactions', FindAllTransactions] | ['FindTransactionsByAccountId', FindTransactionsByAccountId] | ['FindTransactionByHash', FindTransactionByHash] | ['FindPermissionTokensByAccountId', FindPermissionTokensByAccountId] + | ['FindAllPermissionTokenDefinitions', FindAllPermissionTokenDefinitions] | ['FindAllActiveTriggerIds', FindAllActiveTriggerIds] | ['FindTriggerById', FindTriggerById] | ['FindTriggerKeyValueByIdAndKey', FindTriggerKeyValueByIdAndKey] @@ -3195,18 +3291,21 @@ const QueryBox: EnumCodecAndFactory = createEnumCodec = createEnumCodec interface QueryError extends Opaque {} @@ -3225,10 +3325,11 @@ interface QueryError extends Opaque {} const QueryError: EnumCodecAndFactory = createEnumCodec('QueryError', [ [0, 'Decode', __dyn_VersionError], [1, 'Signature', Str], - [2, 'Permission', __dyn_DenialReason], + [2, 'Permission', Str], [3, 'Evaluate', Str], [4, 'Find', __dyn_FindError], - [5, 'Conversion', Str] + [5, 'Conversion', Str], + [6, 'Unauthorized'] ]) // Type: QueryPayload @@ -3269,22 +3370,6 @@ const RaiseTo: StructCodecAndFactory = createStructCod ['right', __dyn_EvaluatesToU32] ]) -// Type: Range - -type Range__actual = Enum< - | ['U32', SemiIntervalU32] - | ['U128', SemiIntervalU128] - | ['Fixed', SemiIntervalFixed] -> - -interface Range extends Opaque {} - -const Range: EnumCodecAndFactory = createEnumCodec('Range', [ - [0, 'U32', __dyn_SemiIntervalU32], - [1, 'U128', __dyn_SemiIntervalU128], - [2, 'Fixed', __dyn_SemiIntervalFixed] -]) - // Type: RawGenesisBlock interface RawGenesisBlock__actual { @@ -3311,22 +3396,6 @@ const RawVersioned: EnumCodecAndFactory = createEnumCodec - -interface Reason extends Opaque {} - -const Reason: EnumCodecAndFactory = createEnumCodec('Reason', [ - [0, 'CommitTimeout', __dyn_CommitTimeout], - [1, 'NoTransactionReceiptReceived', __dyn_NoTransactionReceiptReceived], - [2, 'BlockCreationTimeout', __dyn_BlockCreationTimeout] -]) - // Type: RegisterBox interface RegisterBox__actual { @@ -3349,6 +3418,8 @@ type RegistrableBox__actual = Enum< | ['Asset', Asset] | ['Trigger', TriggerFilterBox] | ['Role', NewRole] + | ['PermissionTokenDefinition', Definition] + | ['Validator', Validator] > interface RegistrableBox extends Opaque {} @@ -3360,7 +3431,9 @@ const RegistrableBox: EnumCodecAndFactory = createEnumCodec = createStr interface Role__actual { id: RoleId - permissions: VecPermissionToken + permissions: VecToken } interface Role extends Opaque {} const Role: StructCodecAndFactory = createStructCodec('Role', [ ['id', __dyn_RoleId], - ['permissions', __dyn_VecPermissionToken] + ['permissions', __dyn_VecToken] ]) // Type: RoleEvent @@ -3454,13 +3527,15 @@ const Role: StructCodecAndFactory = createStructCodec interface RoleEvent extends Opaque {} const RoleEvent: EnumCodecAndFactory = createEnumCodec('RoleEvent', [ [0, 'Created', __dyn_RoleId], - [1, 'Deleted', __dyn_RoleId] + [1, 'Deleted', __dyn_RoleId], + [2, 'PermissionRemoved', __dyn_PermissionRemoved] ]) // Type: RoleEventFilter @@ -3468,26 +3543,28 @@ const RoleEvent: EnumCodecAndFactory = createEnumCodec interface RoleEventFilter extends Opaque {} const RoleEventFilter: EnumCodecAndFactory = createEnumCodec('RoleEventFilter', [ [0, 'ByCreated'], - [1, 'ByDeleted'] + [1, 'ByDeleted'], + [2, 'ByPermissionRemoved'] ]) // Type: RoleFilter interface RoleFilter__actual { - id_filter: FilterOptIdFilterRoleId + origin_filter: FilterOptOriginFilterRoleEvent event_filter: FilterOptRoleEventFilter } interface RoleFilter extends Opaque {} const RoleFilter: StructCodecAndFactory = createStructCodec('RoleFilter', [ - ['id_filter', __dyn_FilterOptIdFilterRoleId], + ['origin_filter', __dyn_FilterOptOriginFilterRoleEvent], ['event_filter', __dyn_FilterOptRoleEventFilter] ]) @@ -3545,6 +3622,22 @@ const SemiIntervalU32: StructCodecAndFactory + +interface SemiRange extends Opaque {} + +const SemiRange: EnumCodecAndFactory = createEnumCodec('SemiRange', [ + [0, 'U32', __dyn_SemiIntervalU32], + [1, 'U128', __dyn_SemiIntervalU128], + [2, 'Fixed', __dyn_SemiIntervalFixed] +]) + // Type: SequenceBox interface SequenceBox__actual { @@ -3599,12 +3692,6 @@ type SignatureOfCommittedBlock = Signature const SignatureOfCommittedBlock: Codec = __dyn_Signature -// Type: SignatureOfProof - -type SignatureOfProof = Signature - -const SignatureOfProof: Codec = __dyn_Signature - // Type: SignatureOfQueryPayload type SignatureOfQueryPayload = Signature @@ -3635,18 +3722,6 @@ const SignaturesOfCommittedBlock: StructCodecAndFactory {} - -const SignaturesOfProof: StructCodecAndFactory = createStructCodec('SignaturesOfProof', [ - ['signatures', __dyn_MapPublicKeySignatureOfProof] -]) - // Type: SignaturesOfTransactionPayload interface SignaturesOfTransactionPayload__actual { @@ -3673,6 +3748,32 @@ const SignedQueryRequest: StructCodecAndFactory {} + +const SignedTransaction: StructCodecAndFactory = createStructCodec('SignedTransaction', [ + ['payload', __dyn_TransactionPayload], + ['signatures', __dyn_VecSignatureOfTransactionPayload] +]) + +// Type: Sorting + +interface Sorting__actual { + sort_by_metadata_key: OptionName +} + +interface Sorting extends Opaque {} + +const Sorting: StructCodecAndFactory = createStructCodec('Sorting', [ + ['sort_by_metadata_key', __dyn_OptionName] +]) + // Type: Subtract interface Subtract__actual { @@ -3735,34 +3836,32 @@ const TimeSchedule: StructCodecAndFactory = ['period', __dyn_OptionDuration] ]) +// Type: Token + +interface Token__actual { + definition_id: Id + params: MapNameValue +} + +interface Token extends Opaque {} + +const Token: StructCodecAndFactory = createStructCodec('Token', [ + ['definition_id', __dyn_Id], + ['params', __dyn_MapNameValue] +]) + // Type: Topology interface Topology__actual { sorted_peers: VecPeerId at_block: HashOfVersionedCommittedBlock - view_change_proofs: ProofChain } interface Topology extends Opaque {} const Topology: StructCodecAndFactory = createStructCodec('Topology', [ ['sorted_peers', __dyn_VecPeerId], - ['at_block', __dyn_HashOfVersionedCommittedBlock], - ['view_change_proofs', __dyn_ProofChain] -]) - -// Type: Transaction - -interface Transaction__actual { - payload: TransactionPayload - signatures: VecSignatureOfTransactionPayload -} - -interface Transaction extends Opaque {} - -const Transaction: StructCodecAndFactory = createStructCodec('Transaction', [ - ['payload', __dyn_TransactionPayload], - ['signatures', __dyn_VecSignatureOfTransactionPayload] + ['at_block', __dyn_HashOfVersionedCommittedBlock] ]) // Type: TransactionLimitError @@ -3793,6 +3892,20 @@ const TransactionPayload: StructCodecAndFactory {} + +const TransactionQueryResult: StructCodecAndFactory = createStructCodec('TransactionQueryResult', [ + ['tx_value', __dyn_TransactionValue], + ['block_hash', __dyn_Hash] +]) + // Type: TransactionRejectionReason type TransactionRejectionReason__actual = Enum< @@ -3818,14 +3931,14 @@ const TransactionRejectionReason: EnumCodecAndFactory interface TransactionValue extends Opaque {} const TransactionValue: EnumCodecAndFactory = createEnumCodec('TransactionValue', [ - [0, 'Transaction', __dyn_VersionedTransaction], + [0, 'Transaction', __dyn_VersionedSignedTransaction], [1, 'RejectedTransaction', __dyn_VersionedRejectedTransaction] ]) @@ -3884,14 +3997,14 @@ const TriggerEventFilter: EnumCodecAndFactory = createEnumCo // Type: TriggerFilter interface TriggerFilter__actual { - id_filter: FilterOptIdFilterTriggerId + origin_filter: FilterOptOriginFilterTriggerEvent event_filter: FilterOptTriggerEventFilter } interface TriggerFilter extends Opaque {} const TriggerFilter: StructCodecAndFactory = createStructCodec('TriggerFilter', [ - ['id_filter', __dyn_FilterOptIdFilterTriggerId], + ['origin_filter', __dyn_FilterOptOriginFilterTriggerEvent], ['event_filter', __dyn_FilterOptTriggerEventFilter] ]) @@ -3913,12 +4026,32 @@ const TriggerFilterBox: StructCodecAndFactory {} const TriggerId: StructCodecAndFactory = createStructCodec('TriggerId', [ - ['name', __dyn_Name] + ['name', __dyn_Name], + ['domain_id', __dyn_OptionDomainId] +]) + +// Type: Type + +type Type__actual = Enum< + | 'Transaction' + | 'Instruction' + | 'Query' + | 'Expression' +> + +interface Type extends Opaque {} + +const Type: EnumCodecAndFactory = createEnumCodec('Type', [ + [0, 'Transaction'], + [1, 'Instruction'], + [2, 'Query'], + [3, 'Expression'] ]) // Type: UnregisterBox @@ -3993,20 +4126,20 @@ const ValidTransaction: StructCodecAndFactory +interface Validator__actual { + id: Id + validator_type: Type + wasm: WasmSmartContract +} -interface ValidatorType extends Opaque {} +interface Validator extends Opaque {} -const ValidatorType: EnumCodecAndFactory = createEnumCodec('ValidatorType', [ - [0, 'Instruction'], - [1, 'Query'], - [2, 'Expression'] +const Validator: StructCodecAndFactory = createStructCodec('Validator', [ + ['id', __dyn_Id], + ['validator_type', __dyn_Type], + ['wasm', __dyn_WasmSmartContract] ]) // Type: Value @@ -4026,9 +4159,13 @@ type Value__actual = Enum< | ['Parameter', Parameter] | ['SignatureCheckCondition', SignatureCheckCondition] | ['TransactionValue', TransactionValue] - | ['PermissionToken', PermissionToken] + | ['TransactionQueryResult', TransactionQueryResult] + | ['PermissionToken', Token] | ['Hash', Hash] | ['Block', BlockValue] + | ['BlockHeader', BlockHeaderValue] + | ['Ipv4Addr', Ipv4Addr] + | ['Ipv6Addr', Ipv6Addr] > interface Value extends Opaque {} @@ -4048,9 +4185,65 @@ const Value: EnumCodecAndFactory = createEnumCodec( [11, 'Parameter', __dyn_Parameter], [12, 'SignatureCheckCondition', __dyn_SignatureCheckCondition], [13, 'TransactionValue', __dyn_TransactionValue], - [14, 'PermissionToken', __dyn_PermissionToken], - [15, 'Hash', __dyn_Hash], - [16, 'Block', __dyn_BlockValue] + [14, 'TransactionQueryResult', __dyn_TransactionQueryResult], + [15, 'PermissionToken', __dyn_Token], + [16, 'Hash', __dyn_Hash], + [17, 'Block', __dyn_BlockValue], + [18, 'BlockHeader', __dyn_BlockHeaderValue], + [19, 'Ipv4Addr', __dyn_Ipv4Addr], + [20, 'Ipv6Addr', __dyn_Ipv6Addr] +]) + +// Type: ValueKind + +type ValueKind__actual = Enum< + | 'U32' + | 'U128' + | 'Bool' + | 'String' + | 'Name' + | 'Fixed' + | 'Vec' + | 'LimitedMetadata' + | 'Id' + | 'Identifiable' + | 'PublicKey' + | 'Parameter' + | 'SignatureCheckCondition' + | 'TransactionValue' + | 'TransactionQueryResult' + | 'PermissionToken' + | 'Hash' + | 'Block' + | 'BlockHeader' + | 'Ipv4Addr' + | 'Ipv6Addr' +> + +interface ValueKind extends Opaque {} + +const ValueKind: EnumCodecAndFactory = createEnumCodec('ValueKind', [ + [0, 'U32'], + [1, 'U128'], + [2, 'Bool'], + [3, 'String'], + [4, 'Name'], + [5, 'Fixed'], + [6, 'Vec'], + [7, 'LimitedMetadata'], + [8, 'Id'], + [9, 'Identifiable'], + [10, 'PublicKey'], + [11, 'Parameter'], + [12, 'SignatureCheckCondition'], + [13, 'TransactionValue'], + [14, 'TransactionQueryResult'], + [15, 'PermissionToken'], + [16, 'Hash'], + [17, 'Block'], + [18, 'BlockHeader'], + [19, 'Ipv4Addr'], + [20, 'Ipv6Addr'] ]) // Type: ValueOfKey @@ -4091,14 +4284,6 @@ interface VecHash extends Opaque {} const VecHash: ArrayCodecAndFactory = createVecCodec('VecHash', __dyn_Hash) -// Type: VecHashOfVersionedValidBlock - -type VecHashOfVersionedValidBlock__actual = HashOfVersionedValidBlock[] - -interface VecHashOfVersionedValidBlock extends Opaque {} - -const VecHashOfVersionedValidBlock: ArrayCodecAndFactory = createVecCodec('VecHashOfVersionedValidBlock', __dyn_HashOfVersionedValidBlock) - // Type: VecInstruction type VecInstruction__actual = Instruction[] @@ -4115,14 +4300,6 @@ interface VecPeerId extends Opaque {} const VecPeerId: ArrayCodecAndFactory = createVecCodec('VecPeerId', __dyn_PeerId) -// Type: VecPermissionToken - -type VecPermissionToken__actual = PermissionToken[] - -interface VecPermissionToken extends Opaque {} - -const VecPermissionToken: ArrayCodecAndFactory = createVecCodec('VecPermissionToken', __dyn_PermissionToken) - // Type: VecPredicateBox type VecPredicateBox__actual = PredicateBox[] @@ -4131,14 +4308,6 @@ interface VecPredicateBox extends Opaque = createVecCodec('VecPredicateBox', __dyn_PredicateBox) -// Type: VecProof - -type VecProof__actual = Proof[] - -interface VecProof extends Opaque {} - -const VecProof: ArrayCodecAndFactory = createVecCodec('VecProof', __dyn_Proof) - // Type: VecPublicKey type VecPublicKey__actual = PublicKey[] @@ -4171,6 +4340,14 @@ interface VecSignatureOfValidBlock extends Opaque = createVecCodec('VecSignatureOfValidBlock', __dyn_SignatureOfValidBlock) +// Type: VecToken + +type VecToken__actual = Token[] + +interface VecToken extends Opaque {} + +const VecToken: ArrayCodecAndFactory = createVecCodec('VecToken', __dyn_Token) + // Type: VecValue type VecValue__actual = Value[] @@ -4319,16 +4496,16 @@ const VersionedSignedQueryRequest: EnumCodecAndFactory -interface VersionedTransaction extends Opaque {} +interface VersionedSignedTransaction extends Opaque {} -const VersionedTransaction: EnumCodecAndFactory = createEnumCodec('VersionedTransaction', [ - [1, 'V1', __dyn_Transaction] +const VersionedSignedTransaction: EnumCodecAndFactory = createEnumCodec('VersionedSignedTransaction', [ + [1, 'V1', __dyn_SignedTransaction] ]) // Type: VersionedValidBlock @@ -4395,4 +4572,4 @@ const Where: StructCodecAndFactory = createStructCodec { await cleanConfiguration() }) -cli.command('clean:effects').action(async () => { - await cleanSideEffects() +cli.command('clean:effects ').action(async (kuraBlockStorePath: string) => { + await cleanSideEffects(kuraBlockStorePath) }) cli .command('start') .option('--api-url ', 'Torii API_URL, needed for health check') - .action(async (opts) => { - consola.info('Starting peer. Opts: %o', opts) + .action(async (opts: { apiUrl?: string }) => { + invariant(opts.apiUrl, '`api-url` option is required') + consola.info('Starting peer') await startPeer({ toriiApiURL: opts.apiUrl }) consola.info('Started! Kill this process to kill the peer') }) diff --git a/packages/test-peer/package.json b/packages/test-peer/package.json index 0eb987ef..71f572b7 100644 --- a/packages/test-peer/package.json +++ b/packages/test-peer/package.json @@ -8,7 +8,7 @@ "cli:config": "pnpm cli -- config:set-from-client-tests" }, "devDependencies": { - "@iroha2/client": "workspace:^3.0.0", + "@iroha2/client": "workspace:^4.0.0", "@iroha2/dev-iroha-bins": "workspace:^0.0.0", "@koa/router": "^10.1.1", "@types/debug": "^4.1.7", @@ -28,6 +28,7 @@ "koa-morgan": "^1.0.1", "make-dir": "^3.1.0", "node-fetch": "^3.2.4", + "tiny-invariant": "^1.3.1", "typescript": "^4.8.3", "zx": "^4.2.0" } diff --git a/packages/test-peer/src/api/client.ts b/packages/test-peer/src/api/client.ts index 97dd5b22..1c9ebd56 100644 --- a/packages/test-peer/src/api/client.ts +++ b/packages/test-peer/src/api/client.ts @@ -15,14 +15,14 @@ export async function cleanConfiguration() { await axios.delete('/configuration') } -export async function cleanSideEffects() { - await axios.delete('/side-effects') +export async function cleanSideEffects(kuraBlockStorePath: string) { + await axios.delete('/side-effects', { params: { kura_block_store_path: kuraBlockStorePath } }) } export async function startPeer({ genesis, toriiApiURL }: { genesis?: boolean; toriiApiURL: string }) { await axios.post('/peer/start', null, { params: { genesis: genesis ?? true, torii_api_url: toriiApiURL } }) } -export async function killPeer(cleanSideEffects = false) { - await axios.post('/peer/kill', null, { params: { clean: cleanSideEffects } }) +export async function killPeer() { + await axios.post('/peer/kill', null) } diff --git a/packages/test-peer/src/api/server.ts b/packages/test-peer/src/api/server.ts index b285ab74..e7c85b94 100644 --- a/packages/test-peer/src/api/server.ts +++ b/packages/test-peer/src/api/server.ts @@ -4,6 +4,7 @@ import Morgan from 'koa-morgan' import BodyParser from 'koa-bodyparser' import consola from 'consola' import chalk from 'chalk' +import invariant from 'tiny-invariant' import * as lib from '../lib' @@ -23,7 +24,10 @@ export async function run(port = 8765) { ctx.status = 204 }) .delete('/side-effects', async (ctx) => { - await lib.cleanSideEffects() + const store = ctx.query.kura_block_store_path + invariant(typeof store === 'string', `add 'kura_block_store_path' param`) + + await lib.cleanSideEffects(store) ctx.status = 204 }) .post('/peer/start', async (ctx) => { @@ -48,9 +52,7 @@ export async function run(port = 8765) { return } - const clean = ctx.query.clean === 'true' ?? false - - await peer!.kill({ cleanSideEffects: clean }) + await peer.kill() peer = null ctx.status = 204 diff --git a/packages/test-peer/src/lib.ts b/packages/test-peer/src/lib.ts index 84c962ac..fce95dbc 100644 --- a/packages/test-peer/src/lib.ts +++ b/packages/test-peer/src/lib.ts @@ -41,7 +41,7 @@ export interface StartPeerReturn { /** * Kill peer's process */ - kill: (params?: KillPeerParams) => Promise + kill: () => Promise /** * Check for alive status @@ -54,6 +54,10 @@ export interface IrohaConfiguration { config: unknown } +function resolveTempJsonConfigFile(key: keyof IrohaConfiguration): string { + return path.resolve(TMP_DIR, `${key}.json`) +} + /** * Installs binary (if not installed) and copies it from `@iroha2/dev-iroha-bins` */ @@ -81,6 +85,10 @@ export async function startPeer(params: StartPeerParams): Promise { - debug('setting configuration: %o', configs) - - const asKeyValue = Object.entries(configs) - - await Promise.all( - asKeyValue.map(async ([configName, data]: [unknown, string]) => { - await saveDataAsJSON(data, path.resolve(TMP_DIR, `${configName}.json`)) - }), - ) + for (const key of ['genesis', 'config'] as const) { + const data = configs[key] + const path = resolveTempJsonConfigFile(key) + await saveDataAsJSON(data, path) + } - debug('configuration is set') + debug('configuration is set: %o', configs) } /** @@ -152,11 +155,9 @@ export async function cleanConfiguration(): Promise { /** * Clear all side-effects from last peer startup. Use it before each peer startup if you want to isolate states. - * - * (Remove `blocks` dir) */ -export async function cleanSideEffects() { - const rmTarget = path.resolve(TMP_DIR, 'blocks') +export async function cleanSideEffects(kuraBlockStorePath: string) { + const rmTarget = path.resolve(TMP_DIR, kuraBlockStorePath) await rmForce(rmTarget) - debug('Blocks are cleaned') + debug('Blocks are cleaned at %o', kuraBlockStorePath) } diff --git a/packages/test-peer/src/util.ts b/packages/test-peer/src/util.ts index 3fed37dc..1b19d90a 100644 --- a/packages/test-peer/src/util.ts +++ b/packages/test-peer/src/util.ts @@ -5,7 +5,7 @@ import nodeFetch from 'node-fetch' import debug from './dbg' export async function saveDataAsJSON(data: unknown, destination: string): Promise { - await fs.writeFile(destination, JSON.stringify(data), { encoding: 'utf-8' }) + await fs.writeFile(destination, JSON.stringify(data, null, 2), { encoding: 'utf-8' }) } export async function rmForce(target: string | string[]): Promise { @@ -17,13 +17,7 @@ export async function waitUntilPeerIsHealthy( checkInterval: number, checkTimeout: number, ): Promise { - const torii = new Torii({ - apiURL, - fetch: nodeFetch as typeof fetch, - // FIXME - telemetryURL: null as any, - ws: null as any, - }) + const toriiPre = { apiURL, fetch: nodeFetch as typeof fetch } let now = Date.now() const endAt = now + checkTimeout @@ -32,7 +26,7 @@ export async function waitUntilPeerIsHealthy( now = Date.now() if (now > endAt) throw new Error(`Peer is still not alive even after ${checkTimeout}ms`) - const health = await torii.getHealth() + const health = await Torii.getHealth(toriiPre) if (health.is('Ok')) return debug('not yet healthy') diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6abf8651..6c4cf146 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,7 +63,7 @@ importers: packages/client: specifiers: '@iroha2/crypto-core': workspace:^0.1.1 - '@iroha2/data-model': workspace:3.0.0 + '@iroha2/data-model': workspace:4.0.0 '@types/debug': ^4.1.7 '@types/ws': ^8.2.2 consola: ^2.15.3 @@ -113,7 +113,7 @@ importers: packages/client/test/integration/test-node: specifiers: - '@iroha2/client': workspace:^3.0.0 + '@iroha2/client': workspace:^4.0.0 '@iroha2/crypto-target-node': workspace:^0.4.0 '@iroha2/test-peer': workspace:^0.0.1 consola: ^2.15.3 @@ -138,10 +138,10 @@ importers: packages/client/test/integration/test-web: specifiers: '@bahmutov/cypress-esbuild-preprocessor': ^2.1.3 - '@iroha2/client': workspace:^3.0.0 + '@iroha2/client': workspace:^4.0.0 '@iroha2/crypto-core': workspace:^0.1.1 '@iroha2/crypto-target-web': workspace:^0.4.0 - '@iroha2/data-model': workspace:^3.0.0 + '@iroha2/data-model': workspace:^4.0.0 '@iroha2/test-peer': workspace:^0.0.1 '@scale-codec/util': ^1.1.1 '@vitejs/plugin-vue': ^3.1.0 @@ -287,7 +287,7 @@ importers: packages/data-model: specifiers: - '@iroha2/data-model-schema': workspace:3.0.0 + '@iroha2/data-model-schema': workspace:4.0.0 '@iroha2/dev-iroha-bins': workspace:^0.0.0 '@iroha2/i64-fixnum': workspace:^0.4.2 '@scale-codec/definition-compiler': ^2.2.2 @@ -361,12 +361,12 @@ importers: packages/docs-recipes: specifiers: - '@iroha2/client': workspace:^3.0.0 + '@iroha2/client': workspace:^4.0.0 '@iroha2/crypto-core': workspace:^0.1.1 '@iroha2/crypto-target-bundler': workspace:^0.4.0 '@iroha2/crypto-target-node': workspace:^0.4.0 '@iroha2/crypto-target-web': workspace:^0.4.0 - '@iroha2/data-model': workspace:^3.0.0 + '@iroha2/data-model': workspace:^4.0.0 hada: ^0.0.8 node-fetch: ^3.2.4 undici: ^5.8.1 @@ -389,7 +389,7 @@ importers: packages/test-peer: specifiers: - '@iroha2/client': workspace:^3.0.0 + '@iroha2/client': workspace:^4.0.0 '@iroha2/dev-iroha-bins': workspace:^0.0.0 '@koa/router': ^10.1.1 '@types/debug': ^4.1.7 @@ -409,6 +409,7 @@ importers: koa-morgan: ^1.0.1 make-dir: ^3.1.0 node-fetch: ^3.2.4 + tiny-invariant: ^1.3.1 typescript: ^4.8.3 zx: ^4.2.0 devDependencies: @@ -432,6 +433,7 @@ importers: koa-morgan: 1.0.1 make-dir: 3.1.0 node-fetch: 3.2.10 + tiny-invariant: 1.3.1 typescript: 4.8.3 zx: 4.3.0 @@ -5505,6 +5507,10 @@ packages: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} dev: true + /tiny-invariant/1.3.1: + resolution: {integrity: sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==} + dev: true + /tinybench/2.1.5: resolution: {integrity: sha512-ak+PZZEuH3mw6CCFOgf5S90YH0MARnZNhxjhjguAmoJimEMAJuNip/rJRd6/wyylHItomVpKTzZk9zrhTrQCoQ==} dev: true