Skip to content

Commit

Permalink
fix(plugin-bungee-hermes): use ledger type from core-api OpenAPI spec
Browse files Browse the repository at this point in the history
Also fixing a few other bugs which were all necessary to make it work
after a rebase onto upstream/main as of 2024-10-10.

1. The tsconfig.json file in the root did not contain a reference to the
package at `packages/cactus-plugin-ccmodel-hephaestus` so it was being
excluded from the compilation.
2. express version was not up to date with the rest of the monorepo which

Signed-off-by: Peter Somogyvari <[email protected]>
  • Loading branch information
petermetz committed Oct 11, 2024
1 parent 426ede8 commit 39feb14
Show file tree
Hide file tree
Showing 37 changed files with 8,021 additions and 234 deletions.
4 changes: 2 additions & 2 deletions examples/cactus-example-cbdc-bridging-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"scripts": {
"build:dev:backend:postbuild": "mkdir -p ./dist/lib/fabric-contracts && cp -r ./src/fabric-contracts/* ./dist/lib/fabric-contracts/",
"forge": "forge build ./src/solidity/main/*.sol --out ./src/solidity/main/generated",
"forge:all": "run-s 'forge' 'forge:test'",
"forge:all": "yarn run --top-level run-s 'forge' 'forge:test'",
"forge:test": "forge build ./src/solidity/test/*.sol --out ./src/solidity/test/generated",
"solidity": "hardhat compile",
"start": "node dist/lib/main/typescript/cbdc-bridging-app-cli.js dotenv_config_path=./process.env",
Expand Down Expand Up @@ -97,7 +97,7 @@
"devDependencies": {
"@types/crypto-js": "4.1.1",
"@types/cucumber": "4.0.4",
"@types/express": "4.17.21",
"@types/express": "5.0.0",
"@types/express-jwt": "6.0.2",
"@types/fs-extra": "9.0.13",
"@types/node": "18.11.9",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id":"cc32f19d615fffc1949510db91badd48","source_id_to_path":{"0":"node_modules/@openzeppelin/contracts/access/AccessControl.sol","1":"node_modules/@openzeppelin/contracts/access/IAccessControl.sol","2":"node_modules/@openzeppelin/contracts/access/Ownable.sol","3":"node_modules/@openzeppelin/contracts/interfaces/draft-IERC6093.sol","4":"node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol","5":"node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol","6":"node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol","7":"node_modules/@openzeppelin/contracts/utils/Context.sol","8":"node_modules/@openzeppelin/contracts/utils/Strings.sol","9":"node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol","10":"node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol","11":"node_modules/@openzeppelin/contracts/utils/math/Math.sol","12":"node_modules/@openzeppelin/contracts/utils/math/SignedMath.sol","13":"src/solidity/main/ITraceableContract.sol","14":"src/solidity/main/satp-contract-interface.sol","15":"src/solidity/main/satp-erc20.sol","16":"src/solidity/main/satp-wrapper.sol"},"language":"Solidity"}
6 changes: 0 additions & 6 deletions examples/cactus-example-cbdc-bridging-frontend/.eslintrc.js

This file was deleted.

28 changes: 14 additions & 14 deletions examples/cactus-example-cbdc-bridging-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,25 @@
]
},
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.14.19",
"@mui/material": "^5.14.19",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@emotion/react": "11.11.1",
"@emotion/styled": "11.11.0",
"@mui/icons-material": "5.14.19",
"@mui/material": "5.14.19",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/react": "13.4.0",
"@testing-library/user-event": "13.5.0",
"@types/jest": "27.5.2",
"@types/node": "18.11.9",
"@types/react": "^18.2.39",
"@types/react-dom": "^18.2.17",
"@types/react": "18.2.39",
"@types/react-dom": "18.2.17",
"axios": "1.7.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.2.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-router-dom": "6.2.1",
"react-scripts": "5.0.1",
"typescript": "5.5.2",
"uuid": "10.0.0",
"web-vitals": "^2.1.4"
"web-vitals": "2.1.4"
},
"devDependencies": {
"@types/uuid": "10.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/test-run-transaction/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"escape-html": "1.0.3",
"ethereumjs-common": "1.5.2",
"ethereumjs-tx": "2.1.2",
"express": "4.20.0",
"express": "4.21.0",
"fabric-ca-client": "2.2.20",
"fabric-network": "2.2.20",
"http-errors": "1.6.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"dependencies": {
"body-parser": "1.20.3",
"cors": "2.8.5",
"express": "4.20.0",
"express": "4.21.0",
"moment": "2.29.4",
"ts-node": "10.9.1",
"typescript": "5.5.2",
"helmet": "4.6.0"
},
"devDependencies": {
"@types/cors": "2.8.12",
"@types/express": "4.17.21"
"@types/express": "5.0.0"
},
"scripts": {
"start": "node app/app.js",
Expand Down
25 changes: 13 additions & 12 deletions packages/cacti-plugin-consortium-static/src/main/json/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,6 @@
}
}
},
"LedgerType": {
"description": "Enumerates the different ledger vendors and their major versions encoded within the name of the LedgerType. For example \"BESU_1X\" involves all of the [1.0.0;2.0.0) where 1.0.0 is included and anything up until, but not 2.0.0. See: https://stackoverflow.com/a/4396303/698470 for further explanation.",
"type": "string",
"enum": [
"BESU_1X",
"BESU_2X",
"BURROW_0X",
"CORDA_4X",
"FABRIC_2",
"SAWTOOTH_1X"
]
},
"CactusNodeMeta": {
"description": "A Cactus node meta information",
"type": "object",
Expand Down Expand Up @@ -333,6 +321,19 @@
}
}
}
},
"LedgerType": {
"description": "Enumerates the different ledger vendors and their major versions encoded within the name of the LedgerType. For example \"BESU_1X\" involves all of the [1.0.0;2.0.0) where 1.0.0 is included and anything up until, but not 2.0.0. See: https://stackoverflow.com/a/4396303/698470 for further explanation.",
"type": "string",
"enum": [
"BESU_1X",
"BESU_2X",
"BURROW_0X",
"CORDA_4X",
"ETHEREUM",
"FABRIC_2",
"SAWTOOTH_1X"
]
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,26 +115,14 @@
"$ref": "#/components/schemas/LedgerId"
},
"ledgerType": {
"$ref": "#/components/schemas/LedgerType",
"$ref": "../../../../../packages/cactus-core-api/src/main/json/openapi.json#/components/schemas/LedgerType",
"nullable": false
},
"consortiumMemberId": {
"$ref": "#/components/schemas/ConsortiumMemberId"
}
}
},
"LedgerType": {
"description": "Enumerates the different ledger vendors and their major versions encoded within the name of the LedgerType. For example \"BESU_1X\" involves all of the [1.0.0;2.0.0) where 1.0.0 is included and anything up until, but not 2.0.0. See: https://stackoverflow.com/a/4396303/698470 for further explanation.",
"type": "string",
"enum": [
"BESU_1X",
"BESU_2X",
"BURROW_0X",
"CORDA_4X",
"FABRIC_2",
"SAWTOOTH_1X"
]
},
"CactusNodeMeta": {
"description": "A Cactus node meta information",
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import com.squareup.moshi.JsonClass
/**
* Enumerates the different ledger vendors and their major versions encoded within the name of the LedgerType. For example \"BESU_1X\" involves all of the [1.0.0;2.0.0) where 1.0.0 is included and anything up until, but not 2.0.0. See: https://stackoverflow.com/a/4396303/698470 for further explanation.
*
* Values: bESU1X,bESU2X,bURROW0X,cORDA4X,fABRIC2,sAWTOOTH1X
* Values: bESU1X,bESU2X,bURROW0X,cORDA4X,eTHEREUM,fABRIC2,sAWTOOTH1X
*/

@JsonClass(generateAdapter = false)
Expand All @@ -40,6 +40,9 @@ enum class LedgerType(val value: kotlin.String) {
@Json(name = "CORDA_4X")
cORDA4X("CORDA_4X"),

@Json(name = "ETHEREUM")
eTHEREUM("ETHEREUM"),

@Json(name = "FABRIC_2")
fABRIC2("FABRIC_2"),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ export const LedgerType = {
Besu2X: 'BESU_2X',
Burrow0X: 'BURROW_0X',
Corda4X: 'CORDA_4X',
Ethereum: 'ETHEREUM',
Fabric2: 'FABRIC_2',
Sawtooth1X: 'SAWTOOTH_1X'
} as const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ components:
- BESU_2X
- BURROW_0X
- CORDA_4X
- ETHEREUM
- FABRIC_2
- SAWTOOTH_1X
type: string
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"PrivacyPolicyOpts": {
"description": "identifier of the policy used to process a view",
"type": "string",
"enum": ["pruneState"],
"x-enum-varnames": ["PruneState"]
"enum": ["pruneState", "singleTransaction"],
"x-enum-varnames": ["PruneState", "SingleTransaction"]
},
"MergePolicyOpts": {
"description": "identifier of the policy used to merge views (can be none)",
Expand Down
2 changes: 1 addition & 1 deletion packages/cactus-plugin-ccmodel-hephaestus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"@hyperledger/cactus-test-tooling": "2.0.0-rc.7",
"@types/express": "5.0.0",
"@types/uuid": "10.0.0",
"body-parser": "1.20.2",
"body-parser": "1.20.3",
"fabric-network": "2.2.20",
"socket.io": "4.6.2",
"uuid": "10.0.0",
Expand Down
Loading

0 comments on commit 39feb14

Please sign in to comment.