Skip to content

Update onchain config + tests#756

Merged
Agusx1211 merged 14 commits into
masterfrom
test-wdk
May 20, 2025
Merged

Update onchain config + tests#756
Agusx1211 merged 14 commits into
masterfrom
test-wdk

Conversation

@Agusx1211

Copy link
Copy Markdown
Member
  • Update onchain config during transactions
  • Transaction tests

@Agusx1211 Agusx1211 requested a review from Copilot May 19, 2025 18:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates onchain configuration logic and enhances transaction tests to validate wallet state transitions. Key changes include updating configuration retrieval and signature logic in transactions, refactoring getConfiguration to accept a wallet address directly, and adding new tests for error conditions and state updates.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/wallet/wdk/vitest.config.ts Set fixed worker counts for test environment
packages/wallet/wdk/test/wallets.test.ts Added assertions to check wallet existence after state changes
packages/wallet/wdk/test/setup.ts Updated import list from 'ox'
packages/wallet/wdk/test/sessions.test.ts Pass noConfigUpdate flag to avoid unintended config updates
packages/wallet/wdk/test/recovery.test.ts Propagated noConfigUpdate flag in recovery tests
packages/wallet/wdk/src/sequence/wallets.ts Updated getConfiguration signature to accept Address directly and adjusted signer resolution calls
packages/wallet/wdk/src/sequence/transactions.ts Forwarded noConfigUpdate option and added cancellation of signature requests in deletions
packages/wallet/wdk/src/sequence/recovery.ts Updated getConfiguration call to match the new signature
packages/wallet/wdk/src/sequence/manager.ts Exposed onchain configuration methods and updated options interface in transaction requests
packages/wallet/primitives/src/constants.ts Introduced a constant for updating image hash
packages/wallet/core/src/wallet.ts Upgraded getStatus and prepareTransaction methods to support onchain config update logic
Comments suppressed due to low confidence (1)

packages/wallet/core/src/wallet.ts:252

  • [nitpick] The injection of a configuration update call into the transaction envelope is a critical side-effect. Please ensure that this behavior is clearly documented for API consumers so that its implications and usage are well understood.
if (!options?.noConfigUpdate) {

imageHash,
pendingUpdates: [...updates].reverse(),
chainId,
onChainImageHash: onChainImageHash!,

Copilot AI May 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a non-null assertion for onChainImageHash may hide potential runtime issues if the value is unexpectedly undefined. Consider adding an explicit check or error handling to ensure it is valid before using it.

Suggested change
onChainImageHash: onChainImageHash!,
onChainImageHash: (() => {
if (onChainImageHash === undefined) {
throw new Error(`onChainImageHash is undefined for ${this.address}`);
}
return onChainImageHash;
})(),

Copilot uses AI. Check for mistakes.
@Agusx1211 Agusx1211 marked this pull request as ready for review May 20, 2025 16:26
@Agusx1211 Agusx1211 requested review from a team as code owners May 20, 2025 16:26
@Agusx1211 Agusx1211 merged commit c85ba5a into master May 20, 2025
1 check passed
@Agusx1211 Agusx1211 deleted the test-wdk branch May 20, 2025 16:26
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