This repository has been archived by the owner on Nov 5, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #715
Right now,
/blocks/:blocknumber
has to pull all of the block transactions before displaying them. The UI breaks it into all the different transaction types in the block, which it can't do without loading them all:This worked okay when there were <200 transactions per block, but doesn't work great now that there are 1000+. It takes a long time to load, because it probably requests way more than it should have to from the API.
This PR refactors this view to fetch the transactions progressively as you scroll, like so:
Obviously this is not ideal in terms of UX, since it doesn't allow for easily finding transactions within a given block. Below I've outlined how we can get the best of both worlds, potentially in a future PR:
Future considerations
If we want to keep the UI this way (which I think I would lean toward, since it is a very useful way to look at what is in a block), we would probably need 2 API changes:
/blocks/:height
), if we could get a breakdown of the transaction types, in addition to thetransaction_count
field, we could populate the transaction types widget at the top with that info. For example:/blocks/:height/transactions
, and acursor
query param. We would need afilter_types
param like the/activity
endpoint has.I've put the above 2 requests in helium/blockchain-http#339