Skip to content

Instantly share code, notes, and snippets.

@michaelsbradleyjr
Last active March 14, 2019 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelsbradleyjr/937bc8702a2926f61787a3a20895439f to your computer and use it in GitHub Desktop.
Save michaelsbradleyjr/937bc8702a2926f61787a3a20895439f to your computer and use it in GitHub Desktop.
Navigated to the Transactions Explorer
Also applies to transactions widget in the Explorers Overview
21 blocks on the chain
have blocks #21 to #12 inclusive because fetched 10 blocks
#21 has 7 txs, #20 to #12 inclusive have 1 tx each
auto estimate #11 - #1 inclusive have 1 tx each and #0 has 0 tx
this.numberOfTxs should be 27
-----------------------------
getCurrentTransactions - page 1
-------------------------------
txs will have length 7 + 9 = 16
txNumber of 1st trans in block #21 = (16 - 0) + 11 = 27 // numberOfTxs - length = 11
index = 27 - 0 - 27 + 1 = 1
txNumber of 2nd trans in block #21 = (16 - 1) + 11 = 26
index = 27 - 0 - 26 + 1 = 2
...
txNumber of 7th trans in block #21 = (16 - 6) + 11 = 21
index = 27 - 0 - 21 + 1 = 7
txNumber of 1st trans in block #20 = (16 - 7) + 11 = 20
index = 27 - 0 - 20 + 1 = 8
txNumber of 1st trans in block #19 = (16 - 8) + 11 = 19
index = 27 - 0 - 19 + 1 = 9
txNumber of 1st trans in block #18 = (16 - 9) + 11 = 18
index = 27 - 0 - 18 + 1 = 10
txNumber of 1st trans in block #17 = (16 - 10) + 11 = 17
index = 27 - 0 - 17 + 1 = 11
================================================================================
Naivgated to page 2
21 blocks on the chain
have blocks #21 to #2 inclusive because fetched 10 more
#21 has 7 txs, #20 to #12 inclusive have 1 tx each
#11 has 3 txs, #10 - #4 inclusive have 1 tx each, #3 has 2 txs, and #2 has 1 tx
auto estimate #1 has 1 tx and #0 has 0 tx
this.numberOfTxs should be 30
-----------------------------
getCurrentTransactions - page 2
-------------------------------
txs will have length 7 + 9 + 3 + 7 + 2 + 1 = 29
txNumber of 1st trans in block #21 = (29 - 0) + 1 = 30 // numberOfTxs - length = 1
index = 30 - 10 - 30 + 1 = -9
txNumber of 2nd trans in block #21 = (29 - 1) + 1 = 29
index = 30 - 10 - 29 + 1 = -8
...
txNumber of 7th trans in block #21 = (29 - 6) + 1 = 24
index = 30 - 10 - 24 + 1 = -3
txNumber of 1st trans in block #20 = (29 - 7) + 1 = 23
index = 30 - 10 - 23 + 1 = -2
txNumber of 1st trans in block #19 = (29 - 8) + 1 = 22
index = 30 - 10 - 22 + 1 = -1
txNumber of 1st trans in block #18 = (29 - 9) + 1 = 21
index = 30 - 10 - 21 + 1 = 0
txNumber of 1st trans in block #17 = (29 - 10) + 1 = 20
index = 30 - 10 - 20 + 1 = 1
================================================================================
Naivgated back to page 1 from page 2, haven't navigated to page 3
21 blocks on the chain
have blocks #21 to #2 inclusive
#21 has 7 txs, #20 to #12 inclusive have 1 tx each
#11 has 3 txs, #10 - #4 inclusive have 1 tx each, #3 has 2 txs, and #2 has 1 tx
auto estimate #1 has 1 tx and #0 has 0 tx
this.numberOfTxs should be 30
-----------------------------
getCurrentTransactions - page 2
-------------------------------
txs will have length 7 + 9 + 3 + 7 + 2 + 1 = 29
txNumber of 1st trans in block #21 = (29 - 0) + 1 = 30 // numberOfTxs - length = 1
index = 30 - 0 - 30 + 1 = 1
txNumber of 2nd trans in block #21 = (29 - 1) + 1 = 29
index = 30 - 0 - 29 + 1 = 2
...
txNumber of 7th trans in block #21 = (29 - 6) + 1 = 24
index = 30 - 0 - 24 + 1 = 7
txNumber of 1st trans in block #20 = (29 - 7) + 1 = 23
index = 30 - 0 - 23 + 1 = 8
txNumber of 1st trans in block #19 = (29 - 8) + 1 = 22
index = 30 - 0 - 22 + 1 = 9
txNumber of 1st trans in block #18 = (29 - 9) + 1 = 21
index = 30 - 0 - 21 + 1 = 10
txNumber of 1st trans in block #17 = (29 - 10) + 1 = 20
index = 30 - 0 - 20 + 1 = 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment