-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: expandMetadata for historic runtimes #692
Conversation
@@ -558,9 +558,10 @@ export class BlocksService extends AbstractService { | |||
blockHash: BlockHash | |||
): Promise<WeightValue> { | |||
const metadata = await api.rpc.state.getMetadata(blockHash); | |||
const historicApi = (await api.at(blockHash)) as ApiPromise; |
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.
@TarikGul I suppose the registry contains metadata, chain info and other stuff that is required for that data to match for historical 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.
Yup exactly!
Example: The specific error that brought up this issue too was a type error where Westend has a Lookup36
type in its Metadata, but it didnt match the registry. So when trying to expand the metadata, types didn't align.
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.
LGTM
closes: #690
This fixes a bug where when expanding metadata in order to capture the weights used in calculating we dont use the correct registry per historic block. This changes that to have a historicApi return the correct registry for the block.