Skip to content

Commit

Permalink
feat(core-api): plugin interface async initializer
Browse files Browse the repository at this point in the history
Signed-off-by: TonyRowntree <[email protected]>
  • Loading branch information
TonyRowntree authored and petermetz committed Jun 26, 2021
1 parent 9678c2e commit d40f68b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ export class CarbonAccountingPlugin
return "@hyperledger/cactus-example-carbon-accounting-backend";
}

public async onPluginInit(): Promise<unknown> {
return;
}

public async enrollAdminV1(
req: EnrollAdminV1Request,
): Promise<EnrollAdminV1Response> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,8 @@ export class SupplyChainCactusPlugin
public getPackageName(): string {
return "@hyperledger/cactus-example-supply-chain-backend";
}

public async onPluginInit(): Promise<unknown> {
return;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export class PluginLedgerConnectorStub
return Optional.empty();
}

public async onPluginInit(): Promise<unknown> {
return;
}

public async shutdown(): Promise<void> {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ test("PluginRegistry", (tMain: Test) => {
throw new Error("This is a mock. Not implemented.");
},
getPackageName: () => "@hyperledger/cactus-plugin-keychain-mock",

onPluginInit: async () => {
throw new Error("not sure how this works");
},
};

const pluginRegistry = new PluginRegistry({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,8 @@ export class PluginKeychainVaultRemoteAdapter
public getPackageName(): string {
return `@hyperledger/cactus-plugin-keychain-vault`;
}

public async onPluginInit(): Promise<unknown> {
return;
}
}

0 comments on commit d40f68b

Please sign in to comment.