-
Notifications
You must be signed in to change notification settings - Fork 632
[CO-432] Add foreign transaction to input and remove updateForeign #3768
[CO-432] Add foreign transaction to input and remove updateForeign #3768
Conversation
a821260
to
30dc141
Compare
As CI stucked on a number of jobs, I squashed the commits, rebased and force pushed |
concerning integration tests: PR affects how foreign transaction is dealt and we have:
The failed test:
was present irrespective of my changes (I also checked this on my computer and corroborate this statement) |
30dc141
to
20ddb13
Compare
20ddb13
to
c93e8b8
Compare
At this moment it is double counting in an account balance - I tried also with
in |
c8c22b4
to
809c457
Compare
Added Ryan's suggestions, rebased and squashed into one commit |
a23e48c
to
5d3a71a
Compare
rebased and adopted a number of simplifications : (a) get rid of |
5757f6c
to
e25f858
Compare
[CO-432] fix applyBlockPartial [CO-432] fixing lookup and updateUtxo [CO-432] accommodating Ryan's suggestions [CO-432] Get rid of foldr in favour of maps and moving reindexing upstream [CO-432] hlint calming [CO-432] Further code cleaning
PR moved to |
Re-opening here, we still need to maintain both repository in sync during the transition (i.e. until |
Description
At this moment prefiltering comes down to filtering out the relevant inputs and so the regular call to updatePending fails to see that the foreign transaction that got removed. Up till now we were looking at the outputs instead of the inputs not because of any fundamental difference between regular and foreign pending transactions, but rather because prefiltering is removing some information that we need and so we look at the outputs as a (somewhat poor) substitute instead. As a consequence we have
updatePending
andupdateForeign
removing corresponding inputs and outputs, respectively.Here, the following changes are proposed:
(a) getters for foreign pending block are added
(b) in
prefilterTxForWallets
we searchinputs
for transactions that have the same id as the foreign transation in the respective pending set(c)
PrefilteredBlock
is extended bypfbForeignInputs
and populated if search of point 1b is successful(d) refactoring of
updatePending
in such a way that it works also withpfbForeignInputs
and service both input and foreign input checkpoint(e) update of both (wallet-new/src/Cardano/Wallet/Kernel/DB/Spec/Update.hs) -
applyBlock
andapplyBlockPartial
is done in the context of the change of point 1dupdateForeign
is removedupdateUtxo
is changed in such a way that it includes rather(Set.union pfbInputs pfbForeignInputs)
thanpfbInputs
Linked issue
https://iohk.myjetbrains.com/youtrack/issue/CO-432
Type of change
Developer checklist
Testing checklist
QA Steps