Skip to content

Conversation

@chris124567
Copy link
Member

Re: #133

@github-project-automation github-project-automation bot moved this to In Progress in Sia Dec 22, 2025
@chris124567 chris124567 marked this pull request as ready for review December 22, 2025 21:08
Copilot AI review requested due to automatic review settings December 22, 2025 21:08
Copy link

Copilot AI left a comment

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 refactors wallet tests to reduce boilerplate code by introducing a testNode helper struct and newTestNode function. The refactoring improves test maintainability by consolidating common setup logic for test nodes that include consensus chain, store, and wallet manager initialization.

Key Changes:

  • Introduced testNode struct and newTestNode helper function to encapsulate test node setup
  • Added import alias ctestutil for go.sia.tech/coreutils/testutil to avoid naming conflict with internal testutil package
  • Replaced repetitive test setup code across 18+ test functions with the new helper

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
wallet/wallet_test.go Added testNode struct and newTestNode helper; refactored 18 test functions to use the new helper; replaced direct testutil.MineBlocks calls with ctestutil.MineBlocks
wallet/manager_test.go Refactored TestHealth to use newTestNode helper and removed redundant setup code
wallet/addresses_test.go Refactored 4 test functions and 1 benchmark to use newTestNode helper, eliminating duplicated setup code

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chris124567 chris124567 merged commit 4c270e7 into master Jan 5, 2026
12 checks passed
@chris124567 chris124567 deleted the christopher/clean-up-wallet-testing branch January 5, 2026 16:41
@github-project-automation github-project-automation bot moved this from In Progress to Done in Sia Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants