Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(plugin-odap-hermes): rename package, variables ODAP -> SATP #3006

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@
"recoverupdateackmessage",
"RUSTC",
"Rwset",
"satp",
"Satp",
"sbjpubkey",
"Secp",
"shrn",
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1691,11 +1691,11 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
- run: ./tools/ci.sh
# cactus-plugin-odap-hermes:
# cactus-plugin-satp-hermes:
# continue-on-error: false
# env:
# FULL_BUILD_DISABLED: true
# JEST_TEST_PATTERN: packages/cactus-plugin-odap-hermes/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts
# JEST_TEST_PATTERN: packages/cactus-plugin-satp-hermes/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts
# JEST_TEST_RUNNER_DISABLED: false
# TAPE_TEST_RUNNER_DISABLED: true
# needs: build-dev
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ghpkg-all-kotlin-api-clients-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,19 +206,19 @@ jobs:
name: cactus-plugin-keychain-memory-wasm-kotlin-client-${{ env.GITVERSION }}.jar
path: packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar

- name: build-cactus-plugin-odap-hermes-kotlin-client
- name: build-cactus-plugin-satp-hermes-kotlin-client
run: |
WDIR=`pwd`
cd ${WDIR}/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client
cd ${WDIR}/packages/cactus-plugin-satp-hermes/src/main/kotlin/generated/openapi/kotlin-client
chmod +x gradlew
./gradlew clean
./gradlew build

- name: publish-cactus-plugin-odap-hermes-kotlin-client
- name: publish-cactus-plugin-satp-hermes-kotlin-client
uses: actions/upload-artifact@v3.0.0
with:
name: cactus-plugin-odap-hermes-kotlin-client-${{ env.GITVERSION }}.jar
path: packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar
name: cactus-plugin-satp-hermes-kotlin-client-${{ env.GITVERSION }}.jar
path: packages/cactus-plugin-satp-hermes/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar

- name: build-cactus-example-supply-chain-business-logic-plugin-kotlin-client
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@hyperledger/cactus-plugin-ledger-connector-fabric": "2.0.0-alpha.2",
"@hyperledger/cactus-plugin-ledger-connector-xdai": "2.0.0-alpha.2",
"@hyperledger/cactus-plugin-object-store-ipfs": "2.0.0-alpha.2",
"@hyperledger/cactus-plugin-odap-hermes": "2.0.0-alpha.2",
"@hyperledger/cactus-plugin-satp-hermes": "2.0.0-alpha.2",
"@hyperledger/cactus-test-tooling": "2.0.0-alpha.2",
"@openzeppelin/contracts": "4.9.3",
"@openzeppelin/contracts-upgradeable": "4.9.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ import {
import {
Configuration,
DefaultApi as OdapApi,
IOdapPluginKeyPair,
} from "@hyperledger/cactus-plugin-odap-hermes";
IKeyPair,
} from "@hyperledger/cactus-plugin-satp-hermes";
import { PluginKeychainMemory } from "@hyperledger/cactus-plugin-keychain-memory";
import { CbdcBridgingAppDummyInfrastructure } from "./infrastructure/cbdc-bridging-app-dummy-infrastructure";
import { DefaultApi as FabricApi } from "@hyperledger/cactus-plugin-ledger-connector-fabric";
import { DefaultApi as BesuApi } from "@hyperledger/cactus-plugin-ledger-connector-besu";
import { DefaultApi as IpfsApi } from "@hyperledger/cactus-plugin-object-store-ipfs";
import { FabricOdapGateway } from "./odap-extension/fabric-odap-gateway";
import { BesuOdapGateway } from "./odap-extension/besu-odap-gateway";
import { FabricSatpGateway } from "./satp-extension/fabric-satp-gateway";
import { BesuSatpGateway } from "./satp-extension/besu-satp-gateway";
import CryptoMaterial from "../../crypto-material/crypto-material.json";

export interface ICbdcBridgingApp {
apiHost: string;
apiServer1Port: number;
apiServer2Port: number;
clientGatewayKeyPair: IOdapPluginKeyPair;
serverGatewayKeyPair: IOdapPluginKeyPair;
clientGatewayKeyPair: IKeyPair;
serverGatewayKeyPair: IKeyPair;
logLevel?: LogLevelDesc;
apiServerOptions?: ICactusApiServerOptions;
disableSignalHandlers?: true;
Expand Down Expand Up @@ -236,6 +236,6 @@ export interface IStartInfo {
readonly ipfsApiClient: IpfsApi;
readonly besuApiClient: BesuApi;
readonly fabricApiClient: FabricApi;
readonly fabricOdapGateway: FabricOdapGateway;
readonly besuOdapGateway: BesuOdapGateway;
readonly fabricOdapGateway: FabricSatpGateway;
readonly besuOdapGateway: BesuSatpGateway;
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ import { PluginRegistry } from "@hyperledger/cactus-core";
import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs";
import AssetReferenceContractJson from "../../../solidity/asset-reference-contract/AssetReferenceContract.json";
import CBDCcontractJson from "../../../solidity/cbdc-erc-20/CBDCcontract.json";
import { IOdapPluginKeyPair } from "@hyperledger/cactus-plugin-odap-hermes";
import { FabricOdapGateway } from "../odap-extension/fabric-odap-gateway";
import { BesuOdapGateway } from "../odap-extension/besu-odap-gateway";
import { IKeyPair } from "@hyperledger/cactus-plugin-satp-hermes";
import { FabricSatpGateway } from "../satp-extension/fabric-satp-gateway";
import { BesuSatpGateway } from "../satp-extension/besu-satp-gateway";
import { PluginImportType } from "@hyperledger/cactus-core-api";
import CryptoMaterial from "../../../crypto-material/crypto-material.json";

Expand Down Expand Up @@ -303,12 +303,12 @@ export class CbdcBridgingAppDummyInfrastructure {

public async createClientGateway(
nodeApiHost: string,
keyPair: IOdapPluginKeyPair,
keyPair: IKeyPair,
ipfsPath: string,
): Promise<FabricOdapGateway> {
): Promise<FabricSatpGateway> {
this.log.info(`Creating Source Gateway...`);
const pluginSourceGateway = new FabricOdapGateway({
name: "cactus-plugin-source#odapGateway",
const pluginSourceGateway = new FabricSatpGateway({
name: "cactus-plugin-source#satpGateway",
dltIDs: ["DLT2"],
instanceId: uuidv4(),
keyPair: keyPair,
Expand All @@ -330,12 +330,12 @@ export class CbdcBridgingAppDummyInfrastructure {

public async createServerGateway(
nodeApiHost: string,
keyPair: IOdapPluginKeyPair,
keyPair: IKeyPair,
ipfsPath: string,
): Promise<BesuOdapGateway> {
): Promise<BesuSatpGateway> {
this.log.info(`Creating Recipient Gateway...`);
const pluginRecipientGateway = new BesuOdapGateway({
name: "cactus-plugin-recipient#odapGateway",
const pluginRecipientGateway = new BesuSatpGateway({
name: "cactus-plugin-recipient#satpGateway",
dltIDs: ["DLT1"],
instanceId: uuidv4(),
keyPair: keyPair,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ import {
InvokeContractV1Request as BesuInvokeContractV1Request,
} from "@hyperledger/cactus-plugin-ledger-connector-besu";
import {
IOdapPluginKeyPair,
PluginOdapGateway,
} from "@hyperledger/cactus-plugin-odap-hermes";
import { SessionDataRollbackActionsPerformedEnum } from "@hyperledger/cactus-plugin-odap-hermes";
IKeyPair,
PluginSatpGateway,
} from "@hyperledger/cactus-plugin-satp-hermes";
import { SessionDataRollbackActionsPerformedEnum } from "@hyperledger/cactus-plugin-satp-hermes";
import { ClientHelper } from "./client-helper";
import { ServerHelper } from "./server-helper";

export interface IBesuOdapGatewayConstructorOptions {
export interface IBesuSatpGatewayConstructorOptions {
name: string;
dltIDs: string[];
instanceId: string;
keyPair?: IOdapPluginKeyPair;
keyPair?: IKeyPair;
backupGatewaysAllowed?: string[];

ipfsPath?: string;
Expand All @@ -36,13 +36,13 @@ export interface IBesuOdapGatewayConstructorOptions {
knexConfig?: Knex.Config;
}

export class BesuOdapGateway extends PluginOdapGateway {
export class BesuSatpGateway extends PluginSatpGateway {
public besuApi?: BesuApi;
public besuContractName?: string;
public besuWeb3SigningCredential?: Web3SigningCredential;
public besuKeychainId?: string;

public constructor(options: IBesuOdapGatewayConstructorOptions) {
public constructor(options: IBesuSatpGatewayConstructorOptions) {
super({
name: options.name,
dltIDs: options.dltIDs,
Expand All @@ -58,7 +58,7 @@ export class BesuOdapGateway extends PluginOdapGateway {
}

private defineBesuConnection(
options: IBesuOdapGatewayConstructorOptions,
options: IBesuSatpGatewayConstructorOptions,
): void {
const fnTag = `${this.className}#defineBesuConnection()`;

Expand Down Expand Up @@ -124,7 +124,7 @@ export class BesuOdapGateway extends PluginOdapGateway {

let besuCreateAssetProof = "";

await this.storeOdapLog({
await this.storeLog({
sessionID: sessionID,
type: "exec",
operation: "create-asset",
Expand Down Expand Up @@ -175,14 +175,14 @@ export class BesuOdapGateway extends PluginOdapGateway {
`${fnTag}, proof of the asset creation: ${besuCreateAssetProof}`,
);

await this.storeOdapProof({
await this.storeProof({
sessionID: sessionID,
type: "proof",
operation: "create",
data: besuCreateAssetProof,
});

await this.storeOdapLog({
await this.storeLog({
sessionID: sessionID,
type: "done",
operation: "create-asset",
Expand All @@ -207,7 +207,7 @@ export class BesuOdapGateway extends PluginOdapGateway {

let besuDeleteAssetProof = "";

await this.storeOdapLog({
await this.storeLog({
sessionID: sessionID,
type: "exec",
operation: "delete-asset",
Expand Down Expand Up @@ -254,14 +254,14 @@ export class BesuOdapGateway extends PluginOdapGateway {
`${fnTag}, proof of the asset deletion: ${besuDeleteAssetProof}`,
);

await this.storeOdapProof({
await this.storeProof({
sessionID: sessionID,
type: "proof",
operation: "delete",
data: besuDeleteAssetProof,
});

await this.storeOdapLog({
await this.storeLog({
sessionID: sessionID,
type: "done",
operation: "delete-asset",
Expand All @@ -286,7 +286,7 @@ export class BesuOdapGateway extends PluginOdapGateway {

let besuLockAssetProof = "";

await this.storeOdapLog({
await this.storeLog({
sessionID: sessionID,
type: "exec",
operation: "lock-asset",
Expand Down Expand Up @@ -330,14 +330,14 @@ export class BesuOdapGateway extends PluginOdapGateway {

this.log.info(`${fnTag}, proof of the asset lock: ${besuLockAssetProof}`);

await this.storeOdapProof({
await this.storeProof({
sessionID: sessionID,
type: "proof",
operation: "lock",
data: besuLockAssetProof,
});

await this.storeOdapLog({
await this.storeLog({
sessionID: sessionID,
type: "done",
operation: "lock-asset",
Expand All @@ -362,7 +362,7 @@ export class BesuOdapGateway extends PluginOdapGateway {

let besuUnlockAssetProof = "";

await this.storeOdapLog({
await this.storeLog({
sessionID: sessionID,
type: "exec-rollback",
operation: "unlock-asset",
Expand Down Expand Up @@ -412,14 +412,14 @@ export class BesuOdapGateway extends PluginOdapGateway {
`${fnTag}, proof of the asset unlock: ${besuUnlockAssetProof}`,
);

await this.storeOdapProof({
await this.storeProof({
sessionID: sessionID,
type: "proof-rollback",
operation: "unlock",
data: besuUnlockAssetProof,
});

await this.storeOdapLog({
await this.storeLog({
sessionID: sessionID,
type: "done-rollback",
operation: "unlock-asset",
Expand Down Expand Up @@ -450,7 +450,7 @@ export class BesuOdapGateway extends PluginOdapGateway {

let besuCreateAssetProof = "";

await this.storeOdapLog({
await this.storeLog({
sessionID: sessionID,
type: "exec-rollback",
operation: "create-asset",
Expand Down Expand Up @@ -504,14 +504,14 @@ export class BesuOdapGateway extends PluginOdapGateway {
`${fnTag}, proof of the asset create: ${besuCreateAssetProof}`,
);

await this.storeOdapProof({
await this.storeProof({
sessionID: sessionID,
type: "proof-rollback",
operation: "create",
data: besuCreateAssetProof,
});

await this.storeOdapLog({
await this.storeLog({
sessionID: sessionID,
type: "done-rollback",
operation: "create-asset",
Expand Down
Loading
Loading