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:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user