-
Notifications
You must be signed in to change notification settings - Fork 286
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(cmd-socketio-server): remove code duplication #2047
refactor(cmd-socketio-server): remove code duplication #2047
Conversation
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
Thanks @outSH for your contribution. |
@jagpreetsinghsasan Sure, there are bunch of depndencies awaiting to be merged first, no hurry ;) Just remember to look only at the last commit. |
Note to myself: Fix sample apps dockerfiles to use only npm packages |
- Add functional test of all functions from go-ethereum-socketio validator. - Refactor go-ethereum validator to allow importing as a module, to simplify the functional test. - Fix sendRawTransaction to work with Verifier protocol. It couldn't be reached by any client library until now, so I consider this as "private" interface. - Add common web3 client object in openethereum test ledger helper class. - Add few new functions to ethereum test ledger helper class: newEthPersonalAccount, transferAssetFromCoinbase, deployContract. Depends on hyperledger-cacti#2051 Depends on hyperledger-cacti#2047 Closes: hyperledger-cacti#2052 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@petermetz @jagpreetsinghsasan (cc: @izuru0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks all good to me.
packages/cactus-common/src/main/typescript/verifier/jwt-message-authentication.ts
Outdated
Show resolved
Hide resolved
packages/cactus-common/src/main/typescript/verifier/jwt-message-authentication.ts
Outdated
Show resolved
Hide resolved
packages/cactus-common/src/main/typescript/verifier/jwt-message-authentication.ts
Outdated
Show resolved
Hide resolved
- Add functional test of all functions from sawtooth-socketio validator. - Refactor sawtooth validator to allow importing as a module, to simplify the functional test. - Add stopMonitor to terminate tests easily. - Allow multiple clients to monitor for blocks. - Fix parsing of URL from config so that it doesn't depend on trailing slash anymore. Closes: hyperledger-cacti#2107 Depends on: hyperledger-cacti#2109 Depends on: hyperledger-cacti#2110 Depends on: hyperledger-cacti#2047 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
e14caa0
to
4fb5d7b
Compare
@petermetz Can you also publish cmd-sockio package from this branch to npm after #2129 is merged? It is needed by the connectors in this PR. // Note to myself: Test the dockerized sample apps manually after cmd-socketio package is published |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@outSH LGTM, thank you!
This PR/issue depends on: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@outSH Please resolve the conflict and then pass it back for review!
4fb5d7b
to
343f6ff
Compare
@petermetz I've rebased to the current main branch status, went through example apps startup (both docker and dockerless scenarios), fixed all errors and connector dockerfiles. Additionally, I've removed the dependency on Indy-SDK for main cactus build since it was tricky to install and sometimes their repo was not available. Updated the ci.sh and readme files. For better understanding of changes I've done since review, you can check this commit: outSH@de5dfef // EDIT Will fix the tests soon |
343f6ff
to
74d336e
Compare
74d336e
to
3ff0636
Compare
@petermetz OK, the tests are fixed, please merge when possible. Changes since your last review: outSH@083d91b |
@outSH Yes, sorry for not responding earlier, we now have the packages published to npm for v1.1.0 and v1.1.1 and v1.1.2 as well so you can use them with the new package names! |
@outSH Thank you that commit link and the squash+rebase helped a lot with the re-review! LGTM
Extra thanks for this because it was causing problems for people in ways that I could not reliably reproduce so it's much better that it is not an optional part of the build. Thank you! |
3ff0636
to
dc48415
Compare
- Move config-reading and signMessageJwt helper functions from validators to cmd-socketio-server to remove code duplication. Refactor validators to use these common instead of own implementation. - Remove ValidatorAuthentication.ts that is not used anymore (not part of public interface, it was copied by validators during before couple commits ago). - Updated readme with instructions of how to start asset-trade and electricity-trade samples without docker-compose (to be used during development). Added helper script for patching the config. - Remove dependency on Indy SDK for the main build (it's needed only for running dockerless discounted-cartrade sample now) - Update legacy-socketio-connector Dockerfiles to work after updates. Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
dc48415
to
c2d9e4c
Compare
- Add functional test of all functions from sawtooth-socketio validator. - Refactor sawtooth validator to allow importing as a module, to simplify the functional test. - Add stopMonitor to terminate tests easily. - Allow multiple clients to monitor for blocks. - Fix parsing of URL from config so that it doesn't depend on trailing slash anymore. Closes: hyperledger-cacti#2107 Depends on: hyperledger-cacti#2109 Depends on: hyperledger-cacti#2110 Depends on: hyperledger-cacti#2047 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
- Add functional test of all functions from go-ethereum-socketio validator. - Refactor go-ethereum validator to allow importing as a module, to simplify the functional test. - Fix sendRawTransaction to work with Verifier protocol. It couldn't be reached by any client library until now, so I consider this as "private" interface. - Add common web3 client object in openethereum test ledger helper class. - Add few new functions to ethereum test ledger helper class: newEthPersonalAccount, transferAssetFromCoinbase, deployContract. Depends on hyperledger-cacti#2051 Depends on hyperledger-cacti#2047 Closes: hyperledger-cacti#2052 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
- Add functional test of all functions from go-ethereum-socketio validator. - Refactor go-ethereum validator to allow importing as a module, to simplify the functional test. - Fix sendRawTransaction to work with Verifier protocol. It couldn't be reached by any client library until now, so I consider this as "private" interface. - Add common web3 client object in openethereum test ledger helper class. - Add few new functions to ethereum test ledger helper class: newEthPersonalAccount, transferAssetFromCoinbase, deployContract. Depends on hyperledger-cacti#2051 Depends on hyperledger-cacti#2047 Closes: hyperledger-cacti#2052 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
- Add functional test of all functions from go-ethereum-socketio validator. - Refactor go-ethereum validator to allow importing as a module, to simplify the functional test. - Fix sendRawTransaction to work with Verifier protocol. It couldn't be reached by any client library until now, so I consider this as "private" interface. - Add common web3 client object in openethereum test ledger helper class. - Add few new functions to ethereum test ledger helper class: newEthPersonalAccount, transferAssetFromCoinbase, deployContract. Depends on hyperledger-cacti#2051 Depends on hyperledger-cacti#2047 Closes: hyperledger-cacti#2052 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
- Add functional test of all functions from sawtooth-socketio validator. - Refactor sawtooth validator to allow importing as a module, to simplify the functional test. - Add stopMonitor to terminate tests easily. - Allow multiple clients to monitor for blocks. - Fix parsing of URL from config so that it doesn't depend on trailing slash anymore. Closes: hyperledger-cacti#2107 Depends on: hyperledger-cacti#2109 Depends on: hyperledger-cacti#2110 Depends on: hyperledger-cacti#2047 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
- Add functional test of all functions from go-ethereum-socketio validator. - Refactor go-ethereum validator to allow importing as a module, to simplify the functional test. - Fix sendRawTransaction to work with Verifier protocol. It couldn't be reached by any client library until now, so I consider this as "private" interface. - Add common web3 client object in openethereum test ledger helper class. - Add few new functions to ethereum test ledger helper class: newEthPersonalAccount, transferAssetFromCoinbase, deployContract. Depends on #2051 Depends on #2047 Closes: #2052 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
- Add functional test of all functions from sawtooth-socketio validator. - Refactor sawtooth validator to allow importing as a module, to simplify the functional test. - Add stopMonitor to terminate tests easily. - Allow multiple clients to monitor for blocks. - Fix parsing of URL from config so that it doesn't depend on trailing slash anymore. Closes: hyperledger-cacti#2107 Depends on: hyperledger-cacti#2109 Depends on: hyperledger-cacti#2110 Depends on: hyperledger-cacti#2047 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
- Add functional test of all functions from sawtooth-socketio validator. - Refactor sawtooth validator to allow importing as a module, to simplify the functional test. - Add stopMonitor to terminate tests easily. - Allow multiple clients to monitor for blocks. - Fix parsing of URL from config so that it doesn't depend on trailing slash anymore. Closes: hyperledger-cacti#2107 Depends on: hyperledger-cacti#2109 Depends on: hyperledger-cacti#2110 Depends on: hyperledger-cacti#2047 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
- Add functional test of all functions from sawtooth-socketio validator. - Refactor sawtooth validator to allow importing as a module, to simplify the functional test. - Add stopMonitor to terminate tests easily. - Allow multiple clients to monitor for blocks. - Fix parsing of URL from config so that it doesn't depend on trailing slash anymore. Closes: #2107 Depends on: #2109 Depends on: #2110 Depends on: #2047 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
cactus-common
to keep encrypt/decrypt logicof socketio-based validators in one, common location.
to remove code duplication.
Refactor validators to use these common instead of own implementation.
(not part of public interface, it was copied by validators during before couple commits ago).
without docker-compose (to be used during development).
Added helper script for patching the config.
Signed-off-by: Michal Bajer michal.bajer@fujitsu.com
This PR is for the last commit only - refactor(cmd-socketio-server): remove code duplication. Please ignore previous one (dependencies) which will be removed before the merge.
Depends on #2033
Depends on #2129