Grandpa visualization optimizations + improvements (#150)

* Prefix CSS rules properly
* Fix Jdenticon placeholder
* Implement shouldComponentUpdate()
* Force casting of block numbers in backend
* Ensure array is properly sorted
* Fix backfilling and hold only limited blocks in memory
* Use proper ellipsis
* Display note if no grandpa data available yet
* Apply flexing only when two blocks are displayed
* Display consensus icons above all other elements
* Type authoritySetId properly
* Display loading screen only when necessary
* Only measure when necessary
* Reset state on tab change
* Remove tooltips and add keys
* fix: Remove some `any` types, fix list view CSS
* Fix updateState type
* Add keys to more elements
* Limit number of authorities for which vis works
This commit is contained in:
Michael Müller
2019-05-27 17:08:21 +02:00
committed by Maciej Hirsz
parent 26000f3e8a
commit 7add77137a
14 changed files with 527 additions and 322 deletions
+8 -4
View File
@@ -321,7 +321,8 @@ export default class Node {
target_hash: targetHash,
} = message;
const voter = this.extractVoter(message.voter);
this.events.emit('afg-received-precommit', targetNumber, targetHash, voter);
const number = parseInt(String(targetNumber), 10) as Types.BlockNumber;
this.events.emit('afg-received-precommit', number, targetHash, voter);
}
private onAfgReceivedPrevote(message: AfgReceivedPrevote) {
@@ -330,7 +331,8 @@ export default class Node {
target_hash: targetHash,
} = message;
const voter = this.extractVoter(message.voter);
this.events.emit('afg-received-prevote', targetNumber, targetHash, voter);
const number = parseInt(String(targetNumber), 10) as Types.BlockNumber;
this.events.emit('afg-received-prevote', number, targetHash, voter);
}
private onAfgAuthoritySet(message: AfgAuthoritySet) {
@@ -346,7 +348,8 @@ export default class Node {
if (JSON.stringify(this.authorities) !== String(message.authorities) ||
this.authoritySetId !== authoritySetId) {
this.events.emit('authority-set-changed', authorities, authoritySetId, number, hash);
const no = parseInt(String(number), 10) as Types.BlockNumber;
this.events.emit('authority-set-changed', authorities, authoritySetId, no, hash);
}
}
@@ -355,7 +358,8 @@ export default class Node {
finalized_number: finalizedNumber,
finalized_hash: finalizedHash,
} = message;
this.events.emit('afg-finalized', finalizedNumber, finalizedHash);
const number = parseInt(String(finalizedNumber), 10) as Types.BlockNumber;
this.events.emit('afg-finalized', number, finalizedHash);
}
private extractVoter(message_voter: String): Types.Address {