Fix 16bit func_id (#11985)

This commit is contained in:
Kevin Wang
2022-08-08 17:46:57 +08:00
committed by GitHub
parent 20c49b20a7
commit 266fa8516a
2 changed files with 17 additions and 16 deletions
@@ -38,7 +38,7 @@
//!
//! However, only extensions implementing [`RegisteredChainExtension`] can be put into a tuple.
//! This is because the [`RegisteredChainExtension::ID`] is used to decide which of those extensions
//! should should be used when the contract calls a chain extensions. Extensions which are generally
//! should be used when the contract calls a chain extensions. Extensions which are generally
//! useful should claim their `ID` with [the registry](https://github.com/paritytech/chainextension-registry)
//! so that no collisions with other vendors will occur.
//!
@@ -215,7 +215,7 @@ where
/// It returns the two least significant bytes of the `id` passed by a contract as the other
/// two bytes represent the chain extension itself (the code which is calling this function).
pub fn func_id(&self) -> u16 {
(self.inner.id & 0x00FF) as u16
(self.inner.id & 0x0000FFFF) as u16
}
/// The chain extension id within the `id` passed by a contract.