Skip to content

Commit

Permalink
fix(connector-polkadot): use dynamic import calls for ESM dependencies
Browse files Browse the repository at this point in the history
1. The polkadot libraries are all ESM-only so we have to import them
in a specific way in order to avoid runtime crashes.
2. This was not done in the original implementation of the polkadot
connector and because of that all the tests were failing.
3. Refactoring the code so that all polkadot related dependencies are
imported dynamically fixes the issue.
4. Also fixed the issue where the getRawTransaction HTTP REST handler
was not `await` ing for the result of the connector's method which broke
the run-transaction test case (now also fixed)

Fixes #3077

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed Jul 17, 2024
1 parent 5660c4e commit 76adf12
Show file tree
Hide file tree
Showing 5 changed files with 208 additions and 147 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"express-openapi-validator": "4.13.1",
"form-data": "4.0.0",
"fs-extra": "11.2.0",
"http-errors": "2.0.0",
"http-errors-enhanced-cjs": "2.0.1",
"http-status-codes": "2.1.4",
"joi": "17.13.3",
"multer": "1.4.2",
Expand All @@ -94,7 +94,6 @@
"@hyperledger/cactus-plugin-keychain-memory": "2.0.0-rc.2",
"@hyperledger/cactus-test-tooling": "2.0.0-rc.2",
"@types/express": "4.17.21",
"@types/http-errors": "2.0.4",
"@types/joi": "17.2.3",
"@types/multer": "1.4.7",
"@types/ssh2": "0.5.44",
Expand Down
Loading

0 comments on commit 76adf12

Please sign in to comment.