Skip to content

Commit

Permalink
fix(satp-hermes): fix build bugs and hanging tests
Browse files Browse the repository at this point in the history
Co-authored-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
Co-authored-by: Peter Somogyvari <peter.somogyvari@accenture.com>
Co-authored-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

test(satp-hermes): fix hanging tests

Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

refactor(SATP-Hermes): fix cspell and lint

Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
  • Loading branch information
AndreAugusto11 authored and eduv09 committed Sep 27, 2024
1 parent dc33d0c commit 8dcb451
Show file tree
Hide file tree
Showing 47 changed files with 778 additions and 619 deletions.
4 changes: 2 additions & 2 deletions packages/cactus-plugin-satp-hermes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"scripts": {
"build": "run-p tsc codegen",
"build-proto": "buf build --path src/main/proto --verbose",
"build:dev:backend:postbuild": "mkdir -p ./dist/lib/main/knex && cp -r ./knex/* ./dist/lib/main/knex",
"codegen": "yarn run --top-level run-s 'codegen:*'",
"build:dev:backend:postbuild": "mkdir -p ./dist/lib/knex && cp -r ./src/knex/* ./dist/lib/knex",
"codegen": "run-p 'codegen:*'",
"codegen:openapi": "npm run generate-sdk",
"codegen:proto": "npm run generate-proto",
"generate-proto": "cd src/main/proto && buf generate --template buf.gen.yaml --config buf.yaml --verbose",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
development: {
client: "sqlite3",
connection: {
filename: path.resolve(__dirname, ".dev-remote.sqlite3"),
filename: path.resolve(__dirname, ".dev.remote-" + uuidv4() + ".sqlite3"),
},
migrations: {
directory: path.resolve(__dirname, "migrations"),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const DEFAULT_PORT_GATEWAY_SERVER = 3010;
export const DEFAULT_PORT_GATEWAY_CLIENT = DEFAULT_PORT_GATEWAY_SERVER + 1;
export const DEFAULT_PORT_GATEWAY_UI = DEFAULT_PORT_GATEWAY_SERVER + 2;
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConnectRouter } from "@connectrpc/connect";
import { Message } from "../../generated/proto/test/message_pb";
// import { Message } from "../../generated/proto/test/message_pb";
import { TestService } from "../../generated/proto/test/message_connect";

export const testRouter = (router: ConnectRouter) =>
Expand All @@ -8,8 +8,7 @@ export const testRouter = (router: ConnectRouter) =>
// implements rpc Say
async sendMessage(req) {
return {
sentence: `You said: ${req}`
}
sentence: `You said: ${req}`,
};
},
});

Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import {
Secp256k1Keys,
Logger,
Checks,
LoggerProvider,
JsObjectSigner,
IJsObjectSignerOptions,
LogLevelDesc,
} from "@hyperledger/cactus-common";
import { Secp256k1Keys, LogLevelDesc } from "@hyperledger/cactus-common";
import { ValidatorOptions } from "class-validator";

export enum CurrentDrafts {
Expand All @@ -18,7 +10,11 @@ export enum CurrentDrafts {
export type DraftVersions = {
[K in CurrentDrafts]: string;
};
export type ShutdownHook = () => Promise<void>;

export type ShutdownHook = {
name: string;
hook: () => Promise<void>;
};

export enum SupportedGatewayImplementations {
FABRIC = "FabricSATPGateway",
Expand All @@ -35,7 +31,8 @@ export type GatewayIdentity = {
version: DraftVersions[];
supportedChains: SupportedGatewayImplementations[];
proofID?: string;
port?: number;
gatewayServerPort?: number;
gatewayClientPort?: number;
address?:
| `http://${string}`
| `https://${string}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,15 @@ import {
IPluginFactoryOptions,
PluginFactory,
} from "@hyperledger/cactus-core-api";
import {
SATPGateway,
SATPGatewayConfig,
} from "../gateway-refactor";
import { SATPGateway, SATPGatewayConfig } from "../gateway-refactor";
import { validateOrReject } from "class-validator";

export class PluginFactorySATPGateway extends PluginFactory<
SATPGateway,
SATPGatewayConfig,
IPluginFactoryOptions
> {
async create(
pluginOptions: SATPGatewayConfig,
): Promise<SATPGateway> {
async create(pluginOptions: SATPGatewayConfig): Promise<SATPGateway> {
const coordinator = new SATPGateway(pluginOptions);

try {
Expand Down
Loading

0 comments on commit 8dcb451

Please sign in to comment.