naive: l2 csv first data collation
collects block number, gas prices, and timestamps into one structure.
not finished.
=/ block-jar=(jar @ud @ux) (block-tx-jar l2-logs)
;< timestamps=(map @ud @da) bind:m (get-timestamps blocks)
;< gas-prices=(map @ux @ud) bind:m (get-gas-prices tx-hashes)
- (pure:m !>(block-jar))
- :: ++ collate-roll-data
- :: |= $: blocks=(list @ud)
+ =/ rolling (collate-roll-data blocks block-jar timestamps gas-prices)
+ (pure:m !>(rolling))
+ ::
+ ++ collate-roll-data
+ |= $: blocks=(list @ud)
+ block-jar=(jar @ud @ux)
::l2-logs=events
- :: timestamps=(list [block=@ud timestamp=@da])
- :: gas-prices=(list [@ux @ud])
- :: ==
- :: =| block-map=(map @ud [timestamp=@da (list roll-data)])
- :: |-
- :: ?~ blocks block-map
- :: =/ block=@ud i.block
+ timestamps=(map @ud @da)
+ gas-prices=(map @ux @ud)
+ ==
+ =| block-map=(map @ud [timestamp=@da gas=(map @ux @ud)])
+ |-
+ ?~ blocks block-map
+ =/ block i.blocks
+ =/ tx-hashes (~(get ja block-jar) block)
+ =/ tx-gas=(map @ux @ud)
+ %- ~(gas by *(map @ux @ud))
+ %+ turn tx-hashes
+ |= txh=@ux
+ [txh (~(got by gas-prices) txh)]
+ %= $
+ blocks t.blocks
+ block-map (~(put by block-map) block [(~(got by timestamps) block) tx-gas])
+ ==
::
++ get-gas-prices
|= tx-hashes=(list @ux)
