diff --git a/Dockerfile b/Dockerfile index f5809275..8da40dc6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,12 +10,13 @@ RUN npm run build FROM node:14 AS processor WORKDIR /hydra-project -COPY --from=builder /hydra-build/package.json . -COPY --from=builder /hydra-build/package-lock.json . -RUN npm ci --production +ADD package.json . +ADD package-lock.json . +RUN npm ci # TODO: --production COPY --from=builder /hydra-build/lib lib ADD db db ADD manifest.yml . +ADD schema.graphql . ADD .env . CMD ["npm", "run", "processor:start"] diff --git a/manifest.yml b/manifest.yml index 220b8548..dff5c297 100644 --- a/manifest.yml +++ b/manifest.yml @@ -6,7 +6,7 @@ typegen: source: wss://kusama-rpc.polkadot.io/ outDir: src/types calls: - - utility.batchAll + - utility.batch_all - utility.batch - system.remark diff --git a/src/types/Utility.ts b/src/types/Utility.ts index 89b0ced3..0c623781 100644 --- a/src/types/Utility.ts +++ b/src/types/Utility.ts @@ -32,6 +32,33 @@ export namespace Utility { this._extrinsic = extrinsic } + get calls(): Vec { + return create('Vec', this._extrinsic.args[0].value) + } + } + /** + * Send a batch of dispatch calls and atomically execute them. + * The whole transaction will rollback and fail if any of the calls failed. + * + * May be called from any origin. + * + * - `calls`: The calls to be dispatched from the same origin. The number of call must not + * exceed the constant: `batched_calls_limit` (available in constant metadata). + * + * If origin is root then call are dispatch without checking origin filter. (This includes + * bypassing `frame_system::Config::BaseCallFilter`). + * + * # + * - Complexity: O(C) where C is the number of calls to be batched. + * # + */ + export class Batch_allCall { + private _extrinsic: SubstrateExtrinsic + + constructor(extrinsic: SubstrateExtrinsic) { + this._extrinsic = extrinsic + } + get calls(): Vec { return create('Vec', this._extrinsic.args[0].value) } diff --git a/src/types/balances.ts b/src/types/balances.ts deleted file mode 100644 index 6aaaab46..00000000 --- a/src/types/balances.ts +++ /dev/null @@ -1,18 +0,0 @@ -import {create} from './_registry' -import {AccountId32} from '@polkadot/types/interfaces' -import {u128} from '@polkadot/types' -import {SubstrateEvent} from '@subsquid/hydra-common' - -export namespace Balances { - /** - * Transfer succeeded. - */ - export class TransferEvent { - constructor(private event: SubstrateEvent) {} - - get params(): [AccountId32, AccountId32, u128] { - return [create('AccountId32', this.event.params[0].value), create('AccountId32', this.event.params[1].value), create('u128', this.event.params[2].value)] - } - } - -}