refactor: dry up the body of the indexing#69
refactor: dry up the body of the indexing#69tansanDOTeth wants to merge 1 commit intome-foundation:mainfrom
Conversation
| } | ||
| const block = blockResult.result; | ||
|
|
||
| const runeUpdater = new RuneUpdater(this._network, block, true, this._storage, this._rpc); |
There was a problem hiding this comment.
@summraznboi gm
I noticed this reorg parameter isn't being used in the RuneUpdater. Do you have plans for it? If not, I can greatly simplify this function here.
Currently, it will process all the reorg hashes first in the loop here:
runestone-lib/src/indexer/index.ts
Lines 116 to 118 in ff1a10d
However, I don't think the code needs to do this here. Instead, we can just set the block height further back for the latter loop, so it will start processing from the last known synced block height.
Ex, here
runestone-lib/src/indexer/index.ts
Lines 122 to 132 in ff1a10d
What do you think?
There was a problem hiding this comment.
Can you provide some unit tests to ensure no regressions are occurring with this refactor?
Small QOL improvement