Uh oh!
There was an error while loading. Please reload this page.
Get rid of reflect in mempool code - #39
Conversation
| v := reflect.Indirect(reflect.ValueOf(next.Value)) | ||
| f := v.FieldByName("tx") | ||
| tx := f.Bytes() | ||
| memTx := next.Value.(*mempool.MempoolTx) |
There was a problem hiding this comment.
What happens if the cast fails?
There was a problem hiding this comment.
We will see a panic in tests and will be able to fix the issue.
Initially I created idiomatic error handling for this cast... But in this particular case I think we should just panic.
There was a problem hiding this comment.
I see, I briefly thought this was the other way around: you could send a Tx and crash the process / node but in this case the process is in control.
liamsi
left a comment
There was a problem hiding this comment.
It would be helpful for reviewers to highlight which files were and how they were modified in github comments.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
6d91a8c to
a33ee44Comparecodecov-io
commented
Apr 16, 2021
Codecov Report
@@ Coverage Diff @@## main #39 +/- ##
==========================================
+ Coverage 51.68% 59.54% +7.86%
==========================================
Files 6 10 +4 Lines 416 749 +333 ==========================================
+ Hits 215 446 +231 - Misses 168 251 +83 - Partials 33 52 +19
Continue to review full report at Codecov.
|
This PR copies the mempool dependency into code tree and integrate the changes, to avoid using
reflectin mempool related code.Depends on #34.
Relates to #37.
Resolves#38.