-
Notifications
You must be signed in to change notification settings - Fork 6
chore: make format golines #1008
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
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
📝 WalkthroughWalkthroughThis PR expands the test suite for Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
utxorpc/submit.go (2)
80-86: Formatting improves readability.The multi-line formatting is clearer. However, for consistency with the pattern at lines 65-71, consider simplifying this to use
fmt.Sprintfdirectly instead of wrappingfmt.Errorfinfmt.Sprint:s.utxorpc.config.Logger.Error( - fmt.Sprint( - fmt.Errorf( - "failed to decode transaction from CBOR: %w", - err, - ), - ), + fmt.Sprintf( + "failed to decode transaction from CBOR: %v", + err, + ), )
113-118: Remove unreachable error handling block.This error check is unreachable because
errcannot be non-nil at this point (it would have been caught by the previousif err != nilblock at line 100). The last assignment toerrwas at line 99, and if it's non-nil, execution continues at line 111.} - if err != nil { - resp.Ref = append(resp.Ref, placeholderRef) - errorList[i] = err - hasError = true - continue - } resp.Ref = append(resp.Ref, txHash.Bytes())
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
database/models/account_test.go(9 hunks)utxorpc/submit.go(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-10-22T20:13:35.972Z
Learnt from: wolf31o2
Repo: blinklabs-io/dingo PR: 971
File: utxorpc/sync_test.go:339-339
Timestamp: 2025-10-22T20:13:35.972Z
Learning: Unit tests under utxorpc should assert that models.Block.Decode() returns a github.com/blinklabs-io/gouroboros/ledger/common.Block, not rely on models.Block directly in protocol/ledger-facing logic.
Applied to files:
database/models/account_test.go
📚 Learning: 2025-10-22T21:28:48.396Z
Learnt from: wolf31o2
Repo: blinklabs-io/dingo PR: 971
File: utxorpc/sync_test.go:339-339
Timestamp: 2025-10-22T21:28:48.396Z
Learning: In utxorpc/sync_test.go, tests must not pass database/models.Block into chain.Chain.AddBlock. They should call models.Block.Decode() and pass the resulting github.com/blinklabs-io/gouroboros/ledger/common.Block to AddBlock.
Applied to files:
database/models/account_test.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: go-test (1.24.x, ubuntu-latest)
- GitHub Check: nilaway
- GitHub Check: Analyze (go)
🔇 Additional comments (2)
database/models/account_test.go (2)
56-95: Excellent edge case coverage!The additional test cases provide valuable coverage for boundary conditions:
- Empty and nil staking keys validate error handling
- Single-byte input tests minimal valid data
- All-zeros and all-ones keys test boundary values
These tests will help catch potential issues with edge cases in the
Account.String()implementation.
105-270: Formatting improves readability throughout.The multi-line formatting of error messages and function calls makes the test code more readable and easier to maintain.
Summary by CodeRabbit
Tests
Style
Note: This release contains internal improvements with no user-facing changes.