Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Fix 16bit func_id
Browse files Browse the repository at this point in the history
  • Loading branch information
kvinwang committed Aug 5, 2022
1 parent 84cc128 commit d8722d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frame/contracts/src/chain_extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//!
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit d8722d8

Please sign in to comment.