Unverified Commit 6b9a95f9 authored by Michael Müller's avatar Michael Müller
Browse files

Get rid of `allow(dead_code)`

parent 42ab18be
Pipeline #157626 failed with stages
in 7 minutes and 16 seconds
......@@ -30,7 +30,6 @@ use core::marker::PhantomData;
/// The final parameters to the cross-contract call.
#[derive(Debug)]
#[allow(dead_code)]
pub struct CallParams<E, Args, R>
where
E: Environment,
......@@ -47,39 +46,39 @@ where
exec_input: ExecutionInput<Args>,
}
#[cfg(
// We do not currently support cross-contract calling in the off-chain
// environment so we do not have to provide these getters in case of
// off-chain environment compilation.
all(not(feature = "std"), target_arch = "wasm32")
)]
impl<E, Args, R> CallParams<E, Args, R>
where
E: Environment,
{
/// Returns the account ID of the called contract instance.
#[inline]
pub(crate) fn callee(&self) -> &E::AccountId {
pub fn callee(&self) -> &E::AccountId {
&self.callee
}
/// Returns the chosen gas limit for the called contract execution.
#[inline]
pub(crate) fn gas_limit(&self) -> u64 {
pub fn gas_limit(&self) -> u64 {
self.gas_limit
}
/// Returns the transferred value for the called contract.
#[inline]
pub(crate) fn transferred_value(&self) -> &E::Balance {
pub fn transferred_value(&self) -> &E::Balance {
&self.transferred_value
}
/// Returns the execution input.
#[inline]
pub(crate) fn exec_input(&self) -> &ExecutionInput<Args> {
pub fn exec_input(&self) -> &ExecutionInput<Args> {
&self.exec_input
}
/// The expected return type.
#[inline]
pub fn return_type(&self) -> &ReturnType<R> {
&self.return_type
}
}
impl<E, Args> CallParams<E, Args, ()>
......
......@@ -52,7 +52,6 @@ where
/// Builds up contract instantiations.
#[derive(Debug)]
#[allow(dead_code)]
pub struct CreateParams<E, Args, Salt, R>
where
E: Environment,
......@@ -71,51 +70,50 @@ where
return_type: ReturnType<R>,
}
cfg_if::cfg_if! {
// We do not currently support cross-contract instantiation in the off-chain
// environment so we do not have to provide these getters in case of
// off-chain environment compilation.
if #[cfg(all(not(feature = "std"), target_arch = "wasm32"))] {
impl<E, Args, Salt, R> CreateParams<E, Args, Salt, R>
where
E: Environment,
{
/// The code hash of the contract.
#[inline]
pub(crate) fn code_hash(&self) -> &E::Hash {
&self.code_hash
}
impl<E, Args, Salt, R> CreateParams<E, Args, Salt, R>
where
E: Environment,
{
/// The code hash of the contract.
#[inline]
pub fn code_hash(&self) -> &E::Hash {
&self.code_hash
}
/// The gas limit for the contract instantiation.
#[inline]
pub(crate) fn gas_limit(&self) -> u64 {
self.gas_limit
}
/// The gas limit for the contract instantiation.
#[inline]
pub fn gas_limit(&self) -> u64 {
self.gas_limit
}
/// The endowment for the instantiated contract.
#[inline]
pub(crate) fn endowment(&self) -> &E::Balance {
&self.endowment
}
/// The endowment for the instantiated contract.
#[inline]
pub fn endowment(&self) -> &E::Balance {
&self.endowment
}
/// The raw encoded input data.
#[inline]
pub(crate) fn exec_input(&self) -> &ExecutionInput<Args> {
&self.exec_input
}
}
/// The raw encoded input data.
#[inline]
pub fn exec_input(&self) -> &ExecutionInput<Args> {
&self.exec_input
}
impl<E, Args, Salt, R> CreateParams<E, Args, Salt, R>
where
E: Environment,
Salt: AsRef<[u8]>,
{
/// The salt for determining the hash for the contract account ID.
#[inline]
pub(crate) fn salt_bytes(&self) -> &Salt {
&self.salt_bytes
}
}
/// The type of the instantiated contract.
#[inline]
pub fn return_type(&self) -> &ReturnType<R> {
&self.return_type
}
}
impl<E, Args, Salt, R> CreateParams<E, Args, Salt, R>
where
E: Environment,
Salt: AsRef<[u8]>,
{
/// The salt for determining the hash for the contract account ID.
#[inline]
pub fn salt_bytes(&self) -> &Salt {
&self.salt_bytes
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment