Skip to content

Commit

Permalink
fix: remove redundant visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
chungquantin committed Aug 9, 2024
1 parent 3d6ee08 commit 12f9ef6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions extension/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub trait ReadStateHandler<T: Config> {
}

#[derive(Default)]
pub struct PopApiExtension;
pub struct ApiExtension;

/// Extract (version, function_id, pallet_index, call_index) from the payload bytes.
fn extract_env<T, E>(env: &Environment<E, BufInBufOutState>) -> (u8, u8, u8, u8)
Expand All @@ -58,15 +58,15 @@ where
(version, function_id, pallet_index, call_index)
}

impl<T> ChainExtension<T> for PopApiExtension
impl<T> ChainExtension<T> for ApiExtension
where
T: Config + pallet_contracts::Config,
T::AccountId: UncheckedFrom<T::Hash> + AsRef<[u8]>,
{
fn call<E: Ext>(&mut self, env: Environment<E, InitState>) -> Result<RetVal, DispatchError>
where
E: Ext<T = T>,
{
fn call<E: Ext<T = T>>(
&mut self,
env: Environment<E, InitState>,
) -> Result<RetVal, DispatchError> {
log::debug!(target:LOG_TARGET, " extension called ");
let mut env = env.buf_in_buf_out();
// Charge weight for making a call from a contract to the runtime.
Expand Down Expand Up @@ -106,7 +106,7 @@ where
}

/// Helper method to decode the byte data to a provided type and throws error if failed.
pub fn decode_checked<T>(params: &mut &[u8]) -> Result<T, DispatchError>
fn decode_checked<T>(params: &mut &[u8]) -> Result<T, DispatchError>
where
T: Decode,
{
Expand Down Expand Up @@ -174,7 +174,7 @@ where
}
}

pub fn dispatch_call<T, E>(
fn dispatch_call<T, E>(
env: &mut Environment<E, BufInBufOutState>,
call: T::RuntimeCall,
mut origin: T::RuntimeOrigin,
Expand Down
2 changes: 1 addition & 1 deletion runtime/devnet/src/config/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl pallet_contracts::Config for Runtime {
type CallStack = [pallet_contracts::Frame<Self>; 23];
type WeightPrice = pallet_transaction_payment::Pallet<Self>;
type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;
type ChainExtension = pop_runtime_extension::PopApiExtension;
type ChainExtension = pop_runtime_extension::ApiExtension;
type Schedule = Schedule;
type AddressGenerator = pallet_contracts::DefaultAddressGenerator;
// This node is geared towards development and testing of contracts.
Expand Down

0 comments on commit 12f9ef6

Please sign in to comment.