-
Notifications
You must be signed in to change notification settings - Fork 98
feat!: breaking out readState into signed and unsigned #1000
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
Conversation
Co-authored-by: Luca Bertelli <luca.bertelli@dfinity.org>
packages/agent/src/polling/index.ts
Outdated
function isSignedReadStateRequestWithExpiry( | ||
value: unknown, | ||
): value is SignedReadStateRequestWithExpiry { | ||
function isObjectWithProperty<O extends object, P extends string>( |
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 is much better now, thanks! I would just now rather move isObjectWithProperty
and hasFunction
outside the isSignedReadStateRequestWithExpiry
function, especially because they are so generic and could be used elsewhere.
Co-authored-by: Nathan Mc Grath <contact@nathanos.dev>
Co-authored-by: Luca Bertelli <luca.bertelli@dfinity.org>
* refactor: use new error system and error codes * test: update throw assertions to use the new error classes * feat: cbor error * test: assert error kind * test: fix e2e and mitm tests for certificate errors * test: remove console logs * fix: remove code and kind props from AgentErrorV2 * feat: der errors * feat: der error on public key * feat: hex decode error * feat: timeout errors * feat: polling errors * feat: canister status errors * feat: hash value errors * refactor: use error kind constructors * refactor: extend class instead of implementing abstract
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.
There are still some comments not resolved, so @krpeacock feel free to fix and/or resolve them.
Approving in the meantime.
Co-authored-by: Luca Bertelli <luca.bertelli@dfinity.org> Co-authored-by: Nathan Mc Grath <contact@nathanos.dev>
Description
In order to distinguish between requests which must be retried using the same payload and requests that can be reconstructed each time during polling, we have broken out the read state method into two separate "signed" and "unsigned" methods. This accommodates signatures made with a hardware wallet for, say, the nns dapp, but as a default, new signatures and Ingress experies will be calculated automatically during polling
This matches the strategies available in the rust agent.
Fixes # SDK-1992
How Has This Been Tested?
New unit and e2e tests.
Checklist: