Skip to content

Commit

Permalink
Merge branch 'main' into indy-validator
Browse files Browse the repository at this point in the history
  • Loading branch information
izuru0 authored Jul 9, 2021
2 parents fe99da9 + c037ec5 commit d6d5b11
Show file tree
Hide file tree
Showing 117 changed files with 3,045 additions and 1,339 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ cactus-openapi-spec.json
cactus-openapi-spec-*.json
.npmrc
*.log

examples/*/Dockerfile
2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ For example you can *run a ledger contract deployment test* via the
REST API with this command:

```sh
npx tap --timeout=600 packages/cactus-test-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/deploy-contract-via-web-service.ts
npx tap --ts --timeout=600 packages/cactus-test-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/deploy-contract-via-web-service.ts
```

*You can also start the API server* and verify more complex scenarios with an
Expand Down
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Further reading:


## PR Checklist - Contributor/Developer
### To avoid issues in the future, do not install dependencies globally. Ensure all dependencies are kept self-contained.
**To avoid issues in the future, do not install dependencies globally. Ensure all dependencies are kept self-contained.**

1. Fork [hyperledger/cactus](https://github.com/hyperledger/cactus) via Github UI
- If you are using the Git client on the Windows operating system, you will need to enable long paths for git
Expand Down Expand Up @@ -356,13 +356,13 @@ for both them separately anyway:
- An integration test:
```sh
npx tap --timeout=600 packages/cactus-test-plugin-consortium-manual/src/test/typescript/integration/plugin-consortium-manual/security-isolation-via-api-server-ports.ts
npx tap --ts --timeout=600 packages/cactus-test-plugin-consortium-manual/src/test/typescript/integration/plugin-consortium-manual/security-isolation-via-api-server-ports.ts
```
- A unit test:
```sh
npx tap --timeout=600 packages/cactus-common/src/test/typescript/unit/objects/get-all-method-names.ts
npx tap --ts --timeout=600 packages/cactus-common/src/test/typescript/unit/objects/get-all-method-names.ts
```
#### Running all test cases (unit+integration)
Expand Down Expand Up @@ -462,17 +462,17 @@ chmod +x ./packages/cactus-cmd-api-server/dist/lib/main/typescript/cmd/cactus-ap
You can run this test case the same way you would run any other test case (which is also a requirement in itself for each test case):
```sh
npx tap --timeout=600 packages/cactus-test-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/deploy-contract-via-web-service.ts
npx tap --ts --timeout=600 packages/cactus-test-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/deploy-contract-via-web-service.ts
```
You can specify an arbitrary set of test cases to run in a single execution via glob patterns. Examples of these glob
patterns can be observed in the root directory's `package.json` file which has npm scripts for executing all tests with
a single command (the CI script uses these):

```json
"test:all": "tap --jobs=1 --timeout=600 \"packages/cactus-*/src/test/typescript/{unit,integration}/\"",
"test:unit": "tap --timeout=600 \"packages/cactus-*/src/test/typescript/unit/\"",
"test:integration": "tap --jobs=1 --timeout=600 \"packages/cactus-*/src/test/typescript/integration/\""
"test:all": "tap --ts --jobs=1 --timeout=600 \"packages/cactus-*/src/test/typescript/{unit,integration}/\"",
"test:unit": "tap --ts --timeout=600 \"packages/cactus-*/src/test/typescript/unit/\"",
"test:integration": "tap --ts --jobs=1 --timeout=600 \"packages/cactus-*/src/test/typescript/integration/\""
```

Following a similar pattern if you have a specific folder where your test cases are, you can run everything in that
Expand All @@ -484,7 +484,7 @@ For example this can work as well:
```sh
# Starting from the project root
cd packages/cactus-test-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum
npx tap --jobs=1 --timeout=600 \"./\"
npx tap --ts --jobs=1 --timeout=600 \"./\"
```

> Be aware that glob patterns need quoting in some operating system's shell environments and not necessarily on others.
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Hyperledger Cactus

![license](https://img.shields.io/github/license/hyperledger/cactus) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4089/badge)](https://bestpractices.coreinfrastructure.org/projects/4089) ![GitHub issues](https://img.shields.io/github/issues/hyperledger/cactus) ![Travis (.org)](https://img.shields.io/travis/hyperledger/cactus)
![license](https://img.shields.io/github/license/hyperledger/cactus) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4089/badge)](https://bestpractices.coreinfrastructure.org/projects/4089) [![codecov](https://codecov.io/gh/hyperledger/cactus/branch/master/graph/badge.svg?token=BJklIsqf1S)](https://codecov.io/gh/hyperledger/cactus)
![GitHub issues](https://img.shields.io/github/issues/hyperledger/cactus) ![Travis (.org)](https://img.shields.io/travis/hyperledger/cactus)

This project is an _Incubation_ Hyperledger project. For more information on the history of this project see the [Cactus wiki page](https://wiki.hyperledger.org/display/cactus). Information on what _Active_ entails can be found in
the [Hyperledger Project Lifecycle document](https://wiki.hyperledger.org/display/TSC/Project+Lifecycle).
Expand All @@ -29,7 +30,7 @@ As blockchain technology proliferates, blockchain integration will become an inc
-p 4000:4000 \
-p 4100:4100 \
-p 4200:4200 \
hyperledger/cactus-example-supply-chain-app:2021-03-24-feat-362
ghcr.io/hyperledger/cactus-example-supply-chain-app:2021-07-01--fix-1063-v2
```
2. Wait for the output to show the message `INFO (api-server): Cactus Cockpit reachable http://0.0.0.0:3100`
3. Visit http://localhost:3100 in a web browser with Javascript enabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class CarbonAccountingAppDummyInfrastructure {
});
this.fabric = new FabricTestLedgerV1({
publishAllPorts: true,
imageName: "hyperledger/cactus-fabric2-all-in-one",
imageName: "ghcr.io/hyperledger/cactus-fabric2-all-in-one",
imageVersion: "2021-04-20-nodejs",
envVars: new Map([["FABRIC_VERSION", "2.2.0"]]),
logLevel: this.options.logLevel || "INFO",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ test(testCase, async (t: Test) => {
const carbonAccountingApp = new CarbonAccountingApp(appOptions);
test.onFinish(async () => {
await carbonAccountingApp.stop();
await pruneDockerAllIfGithubAction({ logLevel });
});

try {
Expand Down Expand Up @@ -167,9 +168,3 @@ test(testCase, async (t: Test) => {

t.end();
});

test("AFTER " + testCase, async (t: Test) => {
const pruning = pruneDockerAllIfGithubAction({ logLevel });
await t.doesNotReject(pruning, "Pruning didn't throw OK");
t.end();
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface IEthContractDeployment {
address: string;
abi: any;
abi: unknown;
bytecode: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class SupplyChainAppDummyInfrastructure {
this.quorum = new QuorumTestLedger();
this.fabric = new FabricTestLedgerV1({
publishAllPorts: true,
imageName: "hyperledger/cactus-fabric-all-in-one",
imageName: "ghcr.io/hyperledger/cactus-fabric-all-in-one",
imageVersion: "2021-03-02-ssh-hotfix",
logLevel: level,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ test("Supply chain backend API calls can be executed", async (t: Test) => {
disableSignalHandlers: true,
};
const app = new SupplyChainApp(appOptions);
test.onFinish(() => app.stop());
test.onFinish(async () => {
await app.stop();
await pruneDockerAllIfGithubAction({ logLevel });
});

// Node A => Besu
// Node B => Quorum
Expand Down Expand Up @@ -129,9 +132,3 @@ test("Supply chain backend API calls can be executed", async (t: Test) => {

t.end();
});

test("AFTER " + testCase, async (t: Test) => {
const pruning = pruneDockerAllIfGithubAction({ logLevel });
await t.doesNotReject(pruning, "Pruning did not throw OK");
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ test("BEFORE " + testCase, async (t: Test) => {

test("Supply chain backend API calls can be executed", async (t: Test) => {
t.ok(publicApi, "Public API of the package imported OK");
test.onFinish(async () => await pruneDockerAllIfGithubAction({ logLevel }));

const projectRoot = path.join(__dirname, "../../../../../../");

Expand Down Expand Up @@ -63,9 +64,3 @@ test("Supply chain backend API calls can be executed", async (t: Test) => {

t.end();
});

test("AFTER " + testCase, async (t: Test) => {
const pruning = pruneDockerAllIfGithubAction({ logLevel });
await t.doesNotReject(pruning, "Pruning did not throw OK");
t.end();
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export interface IEthContractDeployment {
address: string;
abi: any;
abi: unknown;
bytecode: string;
contractName: string;
keychainId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class AppComponent {
this.initializeApp();
}

initializeApp() {
initializeApp(): void {
this.platform.ready().then(() => {
this.statusBar.styleDefault();
this.splashScreen.hide();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class BambooHarvestDetailPage implements OnInit {
this.log = LoggerProvider.getOrCreate({ label: "BambooHarvestDetailPage" });
}

async ngOnInit() {
async ngOnInit(): Promise<void> {
this.log.debug("component initialized.", this.bambooHarvest);

if (!this.bambooHarvest) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class BambooHarvestListPage implements OnInit {
this.log.debug(`Fetched BambooHarvest data: %o`, bambooHarvests);
}

async clickShowDetail(bambooHarvest: BambooHarvest) {
async clickShowDetail(bambooHarvest: BambooHarvest): Promise<void> {
this.log.debug("clickShowDetail()", bambooHarvest);

const modal = await this.modalController.create({
Expand All @@ -73,7 +73,7 @@ export class BambooHarvestListPage implements OnInit {
}
}

async clickAddNew() {
async clickAddNew(): Promise<void> {
this.log.debug(`clickAddNew()`);
const modal = await this.modalController.create({
component: BambooHarvestDetailPage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class BookshelfDetailPage implements OnInit {
}
}

async ngOnInit() {
async ngOnInit(): Promise<void> {
this.log.debug("component initialized.", this.bookshelf);

this._supplyChainApi = await this.baseClient.ofLedger(
Expand Down Expand Up @@ -79,13 +79,13 @@ export class BookshelfDetailPage implements OnInit {
this.log.debug(`BambooHarvest IDs: %o`, this.bambooHarvestIds);
}

onClickFormSubmit(value: any) {
onClickFormSubmit(value: any): void {
this.log.debug("form submitted", value);
this.bookshelf = value;
this.modalController.dismiss(this.bookshelf);
}

onClickBtnCancel() {
onClickBtnCancel(): void {
this.log.debug("form submission cancelled by user");
this.modalController.dismiss();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class BookshelfListPage implements OnInit {
this.log.debug(`Fetched Bookshelf data: %o`, bookshelves);
}

async clickShowDetail(bookshelf: Bookshelf) {
async clickShowDetail(bookshelf: Bookshelf): Promise<void> {
this.log.debug("clickShowDetail()", bookshelf);

const modal = await this.modalController.create({
Expand All @@ -73,7 +73,7 @@ export class BookshelfListPage implements OnInit {
}
}

async clickAddNew() {
async clickAddNew(): Promise<void> {
this.log.debug(`clickAddNew()`);
const modal = await this.modalController.create({
component: BookshelfDetailPage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ export class ShipmentDetailPage implements OnInit {
this.log.debug(`BambooHarvest IDs: %o`, this.bookshelfIds);
}

onClickFormSubmit(value: any) {
onClickFormSubmit(value: any): void {
this.log.debug("form submitted", value);
this.shipment = value;
this.modalController.dismiss(this.shipment);
}

onClickBtnCancel() {
onClickBtnCancel(): void {
this.log.debug("form submission cancelled by user");
this.modalController.dismiss();
}
Expand Down
Loading

0 comments on commit d6d5b11

Please sign in to comment.