-
Notifications
You must be signed in to change notification settings - Fork 33
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
[Utility] Refactor and rename some existing functions related to handling transactions #771
Conversation
@h5law @dylanlott @adshmh I marked this as ready for review because all the core business logic changes I intend to have in this PR is complete. This touches some code that all of us are working on, so I want to get this in and avoid more complex merge conflicts in the future. I left a few |
52dc6f4
to
6a4330a
Compare
@h5law @dylanlott @adshmh I haven't added an E2E test that leverages Otherwise, this is ready to go. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #771 +/- ##
==========================================
+ Coverage 30.12% 31.24% +1.11%
==========================================
Files 103 106 +3
Lines 8836 8958 +122
==========================================
+ Hits 2662 2799 +137
+ Misses 5857 5824 -33
- Partials 317 335 +18
☔ View full report in Codecov by Sentry. |
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.
LGTM I think the GetIndexedTransaction
simplification is spot on, everything else looks in order,
func ErrSignatureVerificationFailed() Error { | ||
return NewError(CodeSignatureVerificationFailedError, SignatureVerificationFailedError) | ||
} | ||
|
||
func ErrRetrievingSignableBytes(err error) Error { | ||
return NewError(CodeRetrievingSignableBytesError, fmt.Sprintf("%s: %s", RetrievingSignableBytesError, err.Error())) |
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.
Wrapping errors in general makes more sense IMO (although I understand it would not be very consistent with current codebase)
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.
I'm not a fan of error.go
myself (didn't create it), but we're just staying consistent with this approach we work on #556 to standardize it.
Description
Summary generated by Reviewpad on 02 Jun 23 18:33 UTC
This pull request includes various changes across multiple files. These changes involve adding new interfaces and methods, renaming functions, refactoring code, improving error handling, updating documentation, and making modifications to the mempool and transaction validation logic.
Issue
NA
Type of change
Please mark the relevant option(s):
List of changes
utilityUnitOfWork
in therpc
module because we do not want to have it run utility's business logicGetIndexedTransaction
to theUtilityModule
interface to be able to retrieve an indexed transaction without running the underlying business logicHydrateIdxTx
toHandleTransaction
in theUtilityUnitOfWork
interface so its more descriptive of what the function doesanteHandleMessage
tobasicValidateTransaction
basicValidateTransaction
into multiple smaller functions for readability and so adding new business logic will be clearerTODO_IN_THIS_COMMIT:
txProtoBytesToRPCIdxTxs
in the RPC moduleGetIndexedTransaction
in the utility modulebasicValidateTransaction
Testing
make develop_test
; if any code changes were mademake test_e2e
on k8s LocalNet; if any code changes were madee2e-devnet-test
passes tests on DevNet; if any code was changedRequired Checklist
godoc
format comments on touched members (see: tip.golang.org/doc/comment)If Applicable Checklist
shared/docs/*
if I updatedshared/*
README(s)