Skip to content

Commit

Permalink
change: use new_if_pallet_present to create native token IDP
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaos Dymitriadis <[email protected]>
  • Loading branch information
AmbientTea committed Dec 15, 2024
1 parent 8cbb7e0 commit 503411b
Showing 1 changed file with 19 additions and 0 deletions.
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

0 comments on commit 503411b

Please sign in to comment.