Skip to content

Commit

Permalink
Update mod.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
chungquantin committed Jul 24, 2024
1 parent 69b7f5b commit 733e7f0
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions pop-api/src/v0/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ impl From<StatusCode> for Error {

/// Helper method to build `ChainExtensionMethod` for version `v0`
///
/// - `function`: The ID of the function
/// - `module`: The index of the runtime module
/// - `dispatchable`: The index of the module dispatchable functions
/// Parameters:
/// - 'function': The ID of the function
/// - 'module': The index of the runtime module
/// - 'dispatchable': The index of the module dispatchable functions
fn build_extension_method_v0(
function: u8,
module: u8,
Expand All @@ -38,16 +39,18 @@ fn build_extension_method_v0(

/// Helper method to build a dispatch call `ChainExtensionMethod`
///
/// - `module`: The index of the runtime module
/// - `dispatchable`: The index of the module dispatchable functions
/// Parameters:
/// - 'module': The index of the runtime module
/// - 'dispatchable': The index of the module dispatchable functions
fn build_dispatch(module: u8, dispatchable: u8) -> ChainExtensionMethod<(), (), (), false> {
build_extension_method_v0(DISPATCH, module, dispatchable)
}

/// Helper method to build a dispatch call `ChainExtensionMethod`
///
/// - `module`: The index of the runtime module
/// - `state_query`: The index of the runtime state query
/// Parameters:
/// - 'module': The index of the runtime module
/// - 'state_query': The index of the runtime state query
fn build_read_state(module: u8, state_query: u8) -> ChainExtensionMethod<(), (), (), false> {
build_extension_method_v0(READ_STATE, module, state_query)
}

0 comments on commit 733e7f0

Please sign in to comment.