mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
Fix checking for the ParachainHost runtime api (#4594)
The function `has_api` checks that the api + version matches, which isn't true anymore after bumping the version. The fix is to just compare the runtime api version being at least `1`.
This commit is contained in:
@@ -130,7 +130,13 @@ where
|
||||
{
|
||||
fn head_supports_parachains(&self, head: &Hash) -> bool {
|
||||
let id = BlockId::Hash(*head);
|
||||
self.runtime_api().has_api::<dyn ParachainHost<Block>>(&id).unwrap_or(false)
|
||||
// Check that the `ParachainHost` runtime api is at least with version 1 present on chain.
|
||||
self.runtime_api()
|
||||
.api_version::<dyn ParachainHost<Block>>(&id)
|
||||
.ok()
|
||||
.flatten()
|
||||
.unwrap_or(0) >=
|
||||
1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user