Use at-block registry/types for derive block/header (#3320)

* Use at-block registry/types for derive block/header

* Also apply to subscribe
This commit is contained in:
Jaco Greeff
2021-03-15 12:08:25 +01:00
committed by GitHub
parent 64de021149
commit c6785c533f
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ export function getBlock (instanceId: string, api: ApiInterfaceRx): (hash: Uint8
: of([])
]).pipe(
map(([signedBlock, events, validators]): SignedBlockExtended =>
new SignedBlockExtended(api.registry, signedBlock, events, validators)
new SignedBlockExtended(signedBlock.registry, signedBlock, events, validators)
),
catchError((): Observable<undefined> =>
// where rpc.chain.getHeader throws, we will land here - it can happen that
+1 -1
View File
@@ -33,7 +33,7 @@ export function getHeader (instanceId: string, api: ApiInterfaceRx): (hash: Uint
: of([])
]).pipe(
map(([header, validators]): HeaderExtended =>
new HeaderExtended(api.registry, header, validators)
new HeaderExtended(header.registry, header, validators)
),
catchError((): Observable<undefined> =>
// where rpc.chain.getHeader throws, we will land here - it can happen that
@@ -30,7 +30,7 @@ export function subscribeNewBlocks (instanceId: string, api: ApiInterfaceRx): ()
);
}),
map(([block, events, header]) =>
new SignedBlockExtended(api.registry, block, events, header.validators)
new SignedBlockExtended(block.registry, block, events, header.validators)
)
)
);
@@ -34,7 +34,7 @@ export function subscribeNewHeads (instanceId: string, api: ApiInterfaceRx): ()
map(([header, validators]): HeaderExtended => {
header.createdAtHash = header.hash;
return new HeaderExtended(api.registry, header, validators);
return new HeaderExtended(header.registry, header, validators);
})
)
);