|
@@ -9,7 +9,7 @@ import {
|
|
|
OpeningId,
|
|
|
RationaleText,
|
|
|
RewardPolicy,
|
|
|
- WorkerId
|
|
|
+ WorkerId,
|
|
|
} from "@joystream/types/augment";
|
|
|
import { Bytes, Option, bool } from "@polkadot/types";
|
|
|
|
|
@@ -50,13 +50,13 @@ export namespace GatewayWorkingGroup {
|
|
|
|
|
|
get workerId(): WorkerId {
|
|
|
return createTypeUnsafe<WorkerId & Codec>(typeRegistry, "WorkerId", [
|
|
|
- this.ctx.params[0].value
|
|
|
+ this.ctx.params[0].value,
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
get bytes(): Bytes {
|
|
|
return createTypeUnsafe<Bytes & Codec>(typeRegistry, "Bytes", [
|
|
|
- this.ctx.params[1].value
|
|
|
+ this.ctx.params[1].value,
|
|
|
]);
|
|
|
}
|
|
|
}
|
|
@@ -71,7 +71,7 @@ export namespace GatewayWorkingGroup {
|
|
|
export class OpeningFilledEvent {
|
|
|
public readonly expectedParamTypes = [
|
|
|
"OpeningId",
|
|
|
- "ApplicationIdToWorkerIdMap"
|
|
|
+ "ApplicationIdToWorkerIdMap",
|
|
|
];
|
|
|
|
|
|
constructor(public readonly ctx: SubstrateEvent) {}
|
|
@@ -99,7 +99,7 @@ export namespace GatewayWorkingGroup {
|
|
|
|
|
|
get openingId(): OpeningId {
|
|
|
return createTypeUnsafe<OpeningId & Codec>(typeRegistry, "OpeningId", [
|
|
|
- this.ctx.params[0].value
|
|
|
+ this.ctx.params[0].value,
|
|
|
]);
|
|
|
}
|
|
|
|
|
@@ -147,7 +147,7 @@ export namespace GatewayWorkingGroup {
|
|
|
|
|
|
get workerId(): WorkerId {
|
|
|
return createTypeUnsafe<WorkerId & Codec>(typeRegistry, "WorkerId", [
|
|
|
- this.ctx.params[0].value
|
|
|
+ this.ctx.params[0].value,
|
|
|
]);
|
|
|
}
|
|
|
|
|
@@ -195,7 +195,55 @@ export namespace GatewayWorkingGroup {
|
|
|
|
|
|
get workerId(): WorkerId {
|
|
|
return createTypeUnsafe<WorkerId & Codec>(typeRegistry, "WorkerId", [
|
|
|
- this.ctx.params[0].value
|
|
|
+ this.ctx.params[0].value,
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+
|
|
|
+ get rationaleText(): RationaleText {
|
|
|
+ return createTypeUnsafe<RationaleText & Codec>(
|
|
|
+ typeRegistry,
|
|
|
+ "RationaleText",
|
|
|
+ [this.ctx.params[1].value]
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Emits on terminating the leader.
|
|
|
+ * Params:
|
|
|
+ * - leader worker id.
|
|
|
+ * - termination rationale text
|
|
|
+ *
|
|
|
+ * Event parameters: [WorkerId, RationaleText, ]
|
|
|
+ */
|
|
|
+ export class TerminatedLeaderEvent {
|
|
|
+ public readonly expectedParamTypes = ["WorkerId", "RationaleText"];
|
|
|
+
|
|
|
+ constructor(public readonly ctx: SubstrateEvent) {}
|
|
|
+
|
|
|
+ get data(): TerminatedLeader_Params {
|
|
|
+ return new TerminatedLeader_Params(this.ctx);
|
|
|
+ }
|
|
|
+
|
|
|
+ validateParams(): boolean {
|
|
|
+ if (this.expectedParamTypes.length !== this.ctx.params.length) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ let valid = true;
|
|
|
+ this.expectedParamTypes.forEach((type, i) => {
|
|
|
+ if (type !== this.ctx.params[i].type) {
|
|
|
+ valid = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return valid;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ class TerminatedLeader_Params {
|
|
|
+ constructor(public readonly ctx: SubstrateEvent) {}
|
|
|
+
|
|
|
+ get workerId(): WorkerId {
|
|
|
+ return createTypeUnsafe<WorkerId & Codec>(typeRegistry, "WorkerId", [
|
|
|
+ this.ctx.params[0].value,
|
|
|
]);
|
|
|
}
|
|
|
|
|
@@ -245,13 +293,13 @@ export namespace GatewayWorkingGroup {
|
|
|
|
|
|
get workerId(): WorkerId {
|
|
|
return createTypeUnsafe<WorkerId & Codec>(typeRegistry, "WorkerId", [
|
|
|
- this.extrinsic.args[0].value
|
|
|
+ this.extrinsic.args[0].value,
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
get storage(): Bytes {
|
|
|
return createTypeUnsafe<Bytes & Codec>(typeRegistry, "Bytes", [
|
|
|
- this.extrinsic.args[1].value
|
|
|
+ this.extrinsic.args[1].value,
|
|
|
]);
|
|
|
}
|
|
|
}
|
|
@@ -264,7 +312,7 @@ export namespace GatewayWorkingGroup {
|
|
|
public readonly expectedArgTypes = [
|
|
|
"OpeningId",
|
|
|
"ApplicationIdSet",
|
|
|
- "Option<RewardPolicy>"
|
|
|
+ "Option<RewardPolicy>",
|
|
|
];
|
|
|
|
|
|
constructor(public readonly ctx: SubstrateEvent) {
|
|
@@ -297,7 +345,7 @@ export namespace GatewayWorkingGroup {
|
|
|
|
|
|
get openingId(): OpeningId {
|
|
|
return createTypeUnsafe<OpeningId & Codec>(typeRegistry, "OpeningId", [
|
|
|
- this.extrinsic.args[0].value
|
|
|
+ this.extrinsic.args[0].value,
|
|
|
]);
|
|
|
}
|
|
|
|
|
@@ -354,13 +402,13 @@ export namespace GatewayWorkingGroup {
|
|
|
|
|
|
get workerId(): WorkerId {
|
|
|
return createTypeUnsafe<WorkerId & Codec>(typeRegistry, "WorkerId", [
|
|
|
- this.extrinsic.args[0].value
|
|
|
+ this.extrinsic.args[0].value,
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
get rationaleText(): Bytes {
|
|
|
return createTypeUnsafe<Bytes & Codec>(typeRegistry, "Bytes", [
|
|
|
- this.extrinsic.args[1].value
|
|
|
+ this.extrinsic.args[1].value,
|
|
|
]);
|
|
|
}
|
|
|
}
|
|
@@ -402,19 +450,19 @@ export namespace GatewayWorkingGroup {
|
|
|
|
|
|
get workerId(): WorkerId {
|
|
|
return createTypeUnsafe<WorkerId & Codec>(typeRegistry, "WorkerId", [
|
|
|
- this.extrinsic.args[0].value
|
|
|
+ this.extrinsic.args[0].value,
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
get rationaleText(): Bytes {
|
|
|
return createTypeUnsafe<Bytes & Codec>(typeRegistry, "Bytes", [
|
|
|
- this.extrinsic.args[1].value
|
|
|
+ this.extrinsic.args[1].value,
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
get slashStake(): bool {
|
|
|
return createTypeUnsafe<bool & Codec>(typeRegistry, "bool", [
|
|
|
- this.extrinsic.args[2].value
|
|
|
+ this.extrinsic.args[2].value,
|
|
|
]);
|
|
|
}
|
|
|
}
|