Skip to content

feat(sdk-core): update decrypt calls to use decryptAsync#8760

Merged
bdesoky merged 1 commit into
masterfrom
WCN-269
May 13, 2026
Merged

feat(sdk-core): update decrypt calls to use decryptAsync#8760
bdesoky merged 1 commit into
masterfrom
WCN-269

Conversation

@bdesoky
Copy link
Copy Markdown
Contributor

@bdesoky bdesoky commented May 12, 2026

Ticket: WCN-269

This pull request updates the wallet sharing logic and tests to support v2-encrypted envelopes for both ECDH keychains and wallet private keys, and ensures all decryption operations are performed asynchronously using decryptAsync. The changes include new and updated tests to cover v2 envelope scenarios, and refactorings in the main wallet sharing code to use decryptAsync for better compatibility and future-proofing.

Support for v2-encrypted envelopes and async decryption:

  • Added comprehensive test cases to wallets.ts to verify that both acceptShare and bulkAcceptShare work correctly when ECDH keychains and wallet keychains use v2-encrypted envelopes. These tests cover scenarios where either or both keychains are v2-encrypted, ensuring robust support for new encryption formats. [1] [2] [3]
  • Updated all relevant test stubs and assertions to use decryptAsync instead of the synchronous decrypt, reflecting the new async decryption flow and ensuring tests accurately simulate real usage. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Refactoring wallet sharing logic to use async decryption:

  • Refactored all decryption calls in wallets.ts to use await this.bitgo.decryptAsync instead of the synchronous decrypt method. This affects both individual and bulk share acceptance, as well as internal processing for wallet share updates. [1] [2] [3] [4] [5] [6]
  • Updated the logic for processing wallet shares in bulk to use Promise.all for parallel asynchronous decryption, improving performance and ensuring correct handling of async operations. [1] [2]

These changes ensure the SDK is compatible with both legacy and v2-encrypted keychains, and that all cryptographic operations are performed asynchronously, which is a requirement for future encryption envelope support and for better scalability.

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 12, 2026

WCN-269

@bdesoky bdesoky marked this pull request as ready for review May 13, 2026 20:51
@bdesoky bdesoky requested review from a team as code owners May 13, 2026 20:51
@bdesoky bdesoky requested review from Marzooqa and mrdanish26 May 13, 2026 20:51
@bdesoky bdesoky merged commit 3745bf4 into master May 13, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants