Subscribe to chains by genesis hash (#395)

* Handle subscription by hash in the frontend

* Forward-ported backend changes

* Fix unit tests

* Remove unused `chains_by_label`

* fmt

* Updated but failing E2E tests

* subscribe by genesis hash in tests

* fmt

* Copy `BlockHash` instead of returning a ref

* Pin chains by genesisHash

Co-authored-by: James Wilson <james@jsdw.me>
This commit is contained in:
Maciej Hirsz
2021-09-02 17:54:19 +02:00
committed by GitHub
parent ec5db0fbbf
commit a4069e4b3d
16 changed files with 156 additions and 140 deletions
+2 -2
View File
@@ -88,7 +88,7 @@ export function secondsWithPrecision(num: number): string {
export interface HashData {
tab?: string;
chain?: Types.ChainLabel;
chain?: Types.GenesisHash;
}
export function getHashData(): HashData {
@@ -99,7 +99,7 @@ export function getHashData(): HashData {
}
const [tab, rawChain] = hash.substr(1).split('/');
const chain = decodeURIComponent(rawChain) as Types.ChainLabel;
const chain = decodeURIComponent(rawChain) as Types.GenesisHash;
return { tab, chain };
}