Skip to content
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

remove lastErr variables from rpc_test.go #185

Merged
merged 18 commits into from
Aug 5, 2024

Conversation

ClaytonNorthey92
Copy link
Contributor

@ClaytonNorthey92 ClaytonNorthey92 commented Jul 16, 2024

Summary
lastErr was added to handle for something that likely shouldn't have been; it's an un-needed way to handle for errors. replace with simply failing the test if there are errors.

Changes
remove lastErr variables from rpc_test.go

fixes #182

@github-actions github-actions bot added the area: tbc This is a change to TBC (Tiny Bitcoin) label Jul 16, 2024
@ClaytonNorthey92 ClaytonNorthey92 force-pushed the clayton/staticcheck-lasterr branch from 79b8000 to 1703823 Compare July 16, 2024 14:49
@ClaytonNorthey92 ClaytonNorthey92 changed the title squashme remove lastErr variables from rpc_test.go Jul 16, 2024
@ClaytonNorthey92 ClaytonNorthey92 marked this pull request as ready for review July 16, 2024 14:55
@ClaytonNorthey92 ClaytonNorthey92 requested review from marcopeereboom and a team as code owners July 16, 2024 14:55
@joshuasing joshuasing added type: refactor This refactors existing functionality area: test This adds or improves test coverage labels Jul 16, 2024
service/tbc/rpc_test.go Outdated Show resolved Hide resolved
service/tbc/rpc_test.go Outdated Show resolved Hide resolved
@ClaytonNorthey92 ClaytonNorthey92 force-pushed the clayton/staticcheck-lasterr branch from 53d265f to 8f93b5e Compare July 26, 2024 21:34
t.Fatal(err)
}

if err := tbcServer.UtxoIndexer(ctx, &hash); err != nil {
if err = tbcServer.UtxoIndexer(ctx, &hash); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

When using this idiom you really should keep :=.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah yes will fix

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@joshuasing @marcopeereboom I am ok with either way; you two decide 👍

@ClaytonNorthey92 ClaytonNorthey92 dismissed marcopeereboom’s stale review August 5, 2024 15:24

OOO - addressed feedback

@ClaytonNorthey92 ClaytonNorthey92 merged commit 6e92343 into main Aug 5, 2024
6 checks passed
@ClaytonNorthey92 ClaytonNorthey92 deleted the clayton/staticcheck-lasterr branch August 5, 2024 15:24
web3cryptoguy pushed a commit to web3cryptoguy/heminetwork that referenced this pull request Nov 1, 2024
* remove lastErr variables from rpc_test.go

lastErr was added to handle for something that likely shouldn't have been; it's an un-needed way to handle for errors.  replace with simply failing the test if there are errors.

fixes hemilabs#182

* removed un-needed for loops

* bump test timeout

* re-added needed break

* surround break in else for readability

* tune timeout back to 1 minute

* lint

* Update service/tbc/rpc_test.go

Co-authored-by: Joshua Sing <[email protected]>

* Update service/tbc/rpc_test.go

Co-authored-by: Joshua Sing <[email protected]>

* cleanup from pr feedback

* fixed error checking based on feedback

* handle write errors differently in tests

* get rid of some shadowing

* more code cleanup

* fixed test

* trying larger wait

* fix byte order

* pr feedback

---------

Co-authored-by: Joshua Sing <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: tbc This is a change to TBC (Tiny Bitcoin) area: test This adds or improves test coverage type: refactor This refactors existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tbc: fix unused 'lastErr' in RPC tests
4 participants