-
Notifications
You must be signed in to change notification settings - Fork 2
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
ZK-559: Remove "/crypto" package from shielder-sdk #81
base: main
Are you sure you want to change the base?
Conversation
|
@@ -46,18 +45,12 @@ jobs: | |||
uses: ./.github/workflows/_ts-checks.yml | |||
secrets: inherit | |||
|
|||
ts-sdk-playwright-tests: |
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.
Why are we removing the workflow entirely? Playwright is needed for testing the smaller shielder-sdk-crypto-wasm
package.
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.
we can add it later
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.
after browsing through ts files (with partial understanding) I had a feeling that this PR makes more changes than necessary, so it's a bit hard to follow everything at once; anyway, looks good to me
ts/shielder-sdk/README.md
Outdated
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.
very nice readme
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 up to some small comments to resolve. The true verification will come with tests.
|
||
## Usage | ||
|
||
In order to use most of the modules, WASM needs to be loaded. This package starts loading WASM automatically. User should await the published promise `wasmClientWorkerReady()`. | ||
The main entry point is the `createShielderClient` function which provides methods for interacting with the Shielder protocol. |
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.
Forgive my focusing on a tiny language nitpick, but please add a comma before "which":P Not having a comma means there is many createShielderClient
functions and we're choosing the one which provides methods for interacting with the Shielder protocol.
@@ -119,7 +85,6 @@ jobs: | |||
NO_FORMATTING=true TESTNET=true ./tooling-e2e-tests/full_scenario.sh | |||
NO_FORMATTING=true TESTNET=true ./tooling-e2e-tests/recovery_scenario.sh | |||
NO_FORMATTING=true TESTNET=true ./tooling-e2e-tests/many_actors.sh | |||
NO_FORMATTING=true TESTNET=true ./tooling-e2e-tests/ts_sdk_tests.sh |
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.
Consider removing shielder-sdk-tests
code entirely. We have repo history, not having dead code seems preferrable.
|
||
// Initialize the client | ||
const shielderClient = createShielderClient( |
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.
Consider replacing fake variables with literal fake values like 0xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
. This would improve readability as the reader then sees the formatting of the expected arguments.
}; | ||
} | ||
|
||
async merklePathAndRoot( |
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.
Could you move this helper out of NoteAction
? An isolated stateless helper is simpler than keeping it inside an abstract base class. It seems unnecessary to require the user to create an object like DepositAction
for a Merkle path query. The tests will have to create the Merkle path, it seems simpler to have this call decoupled.
This PR introduces changes to
shielder-sdk
, effectively making it independent of native cryptography implementation../src/crypto
package and all configuration of WASM, includingshielder-wasm
bindings.shielder-sdk-crypto
interfaceCryptoClient
interface for calling cryptographic functions where needed.shielder-sdk-tests
a dead code, as we intend to rewrite them into simpler framework soon. Disabling CI forshielder-sdk-tests
package