Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change: use new_if_pallet_present to create native token IDP #333

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions node/node/src/inherent_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ where
"SIDECHAIN_BLOCK_BENEFICIARY",
)?;

// Mock runtime provided by Substrate doesn't implement Runtime version API used by `new_if_pallet_present`
#[cfg(not(test))]
let native_token = NativeTokenIDP::new_if_pallet_present(
client.clone(),
native_token_data_source.as_ref(),
mc_hash.mc_hash(),
parent_hash,
)
.await?;
#[cfg(test)]
let native_token = NativeTokenIDP::new(
client.clone(),
native_token_data_source.as_ref(),
Expand Down Expand Up @@ -191,6 +201,15 @@ where
)
.await?;

#[cfg(not(test))]
let native_token = NativeTokenIDP::new_if_pallet_present(
client.clone(),
native_token_data_source.as_ref(),
mc_hash,
parent_hash,
)
.await?;
#[cfg(test)]
let native_token = NativeTokenIDP::new(
client.clone(),
native_token_data_source.as_ref(),
Expand Down
Loading