-
Notifications
You must be signed in to change notification settings - Fork 121
fix: add miner stats pagination by block range #232
Conversation
5ce89c6
to
d9bb26c
Compare
@@ -88,6 +88,10 @@ function App(props: any) { | |||
useEffect(() => { | |||
if (selectedNetwork && selectedNetwork.name !== query.network) { | |||
setQuery({ network: selectedNetwork.name }); | |||
history.push({ | |||
pathname: history.location.pathname, | |||
search: `?network=${selectedNetwork.name}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work if there are other parameters in the search pattern of the URI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it does for certain keys, see here: https://github.com/etclabscore/expedition/blob/master/src/App.tsx#L38
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, thanks. Maybe the supported params should be parts of a config object and standardized/globalized then too, toward fewer magic strings.
Would suggest new ticket for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... Or modify the handrolled History
logic to use either a library (there must be one...?) and/or/thereby support arbitrary URI path/parameter/hash updates. So that this feature itself becomes some background "just works" magic.
)}> | ||
{authorHashShort} | ||
</Link> | ||
<sup>{hexToString(b.extraData).substring(0, 20)}</sup> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually we might want to refactor this address/+extradata format out to a configurable/standard, eg. substring length, abbreviations, sanitization, ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed. lets make a ticket for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const blockMapHashRate = (block: any) => { | ||
return { | ||
x: hexToNumber(block.number), | ||
y: hashesToGH(new BigNumber(block.difficulty, 16).dividedBy(config.blockTime)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmmm.. Using a hardcoded block time is a liiiitleee stretchy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea would be nice to calculate the block time for the list of blocks you are looking at. maybe a helper getBlockTimeFromBlocks(blocks)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits, can be handled or not in later change sets.
🎉 This PR is included in version 1.8.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
fixes #223