refactor(juno): obsolete the PendingData interface#3512
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3512 +/- ##
==========================================
+ Coverage 75.10% 75.46% +0.36%
==========================================
Files 386 385 -1
Lines 34923 34823 -100
==========================================
+ Hits 26228 26279 +51
+ Misses 6736 6708 -28
+ Partials 1959 1836 -123 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
0c3775c to
531e909
Compare
02da98b to
22c736c
Compare
06916cd to
3bffac0
Compare
1af841f to
77b412e
Compare
EgeCaner
left a comment
There was a problem hiding this comment.
Dropped some comments, rest looks good to me
8261a14 to
1374738
Compare
rodrodros
left a comment
There was a problem hiding this comment.
blocking until I do a full review
rodrodros
left a comment
There was a problem hiding this comment.
It seems rebase was not correctly done?
fdd32ed to
dd125fc
Compare
002d6a1 to
d277bb1
Compare
|
|
||
| mockReader.EXPECT().TransactionByHash(txHash).Return(nil, db.ErrKeyNotFound) | ||
| mockSyncReader.EXPECT().PendingData().Return(nil, core.ErrPendingDataNotFound) | ||
| mockReader.EXPECT().HeadsHeader().Return(nil, db.ErrKeyNotFound) |
There was a problem hiding this comment.
The removal of the pending_data_wrapper.go allowed me to reduce the number of HeadsHeader() from 2 to 1 (called only once by the syncReader.PendingData(). No need to mock rn
| block, err = h.bcReader.BlockByNumber(id.Number) | ||
| } | ||
| if err != nil { | ||
| if errors.Is(err, db.ErrKeyNotFound) || errors.Is(err, core.ErrPendingDataNotFound) { |
There was a problem hiding this comment.
PendingData() for v6 now always returns an empty PendingBlock - core.ErrPendingDataNotFound is never emitted
| return nil, core.ErrPendingDataNotFound | ||
| } | ||
|
|
||
| func (s *Synchronizer) PendingBlock() *core.Block { |
There was a problem hiding this comment.
this was only used with tests and could simply be replaced by GetBlock() method of the preconfirmed
fcb6d74 to
c4109a3
Compare
This PR is the follow-up to
Pendingblock deprecation. Previously, thePendingDatainterface was used through-out the project, so that both Pending and PreConfirmed blocks were accepted depending on protocol version. They were differentiated by aVariant()method . After deprecating thePendingblock, thePendingDatabecame a single-implementation interface an can be removed.Since both rpcv6 and v8 return an empty
Pendingblock forPendingData, which has no transactions, receipts and events - a no-op function is used for backward compatibility.The scope of this PR is solely to get rid of
PendingDatainterface. There will be a follow-up PR, where the naming through-out the project will be cleaned (e.g. rpc/v9/subscriptions.go -onPendingData- >onPreConfirmed). Reviewers should focus purely on correctness, as cosmetic changes were separated into another PR to reduce the noise.NOTES:
core.Pending(which is deprecated) was used in the rpcv6/v8instead ofPendingDatainterface