Skip to content

Commit ae15187

Browse files
authored
Reactivate extrinsic creation unit tests (#805)
* enable unit tests for metadata hash check * add runtime.wasm * remove extra spacing
1 parent c12b735 commit ae15187

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

primitives/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pallet-contracts = { optional = true, git = "https://github.com/paritytech/polka
3737
pallet-staking = { optional = true, git = "https://github.com/paritytech/polkadot-sdk.git", branch = "master" }
3838

3939
[dev-dependencies]
40+
frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "master" }
4041
solochain-template-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "master" }
4142
sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "master" }
4243
pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "master" }

primitives/src/extrinsics/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ mod tests {
250250
use super::*;
251251
use crate::AssetRuntimeConfig;
252252
use extrinsic_params::{GenericAdditionalParams, GenericExtrinsicParams, PlainTip};
253+
use frame_metadata_hash_extension::CheckMetadataHash;
253254
use frame_system::{
254255
CheckEra, CheckGenesis, CheckNonZeroSender, CheckNonce, CheckSpecVersion, CheckTxVersion,
255256
CheckWeight,
@@ -325,8 +326,6 @@ mod tests {
325326
assert_eq!(call, call1);
326327
}
327328

328-
// Currently does not with available version of substrate extrinsic
329-
#[cfg(not(feature = "disable-metadata-hash-check"))]
330329
#[test]
331330
fn xt_hash_matches_substrate_impl() {
332331
// Define extrinsic params.
@@ -353,6 +352,7 @@ mod tests {
353352
CheckNonce::<Runtime>::from(nonce),
354353
CheckWeight::<Runtime>::new(),
355354
ChargeTransactionPayment::<Runtime>::from(fee),
355+
CheckMetadataHash::<Runtime>::new(false),
356356
);
357357

358358
let substrate_extrinsic = UncheckedExtrinsic::new_signed(
@@ -386,13 +386,11 @@ mod tests {
386386
)
387387
}
388388

389-
// Currently does not work with stored bytes. Need to create a new version
390-
#[cfg(not(feature = "disable-metadata-hash-check"))]
391389
#[test]
392390
fn xt_hash_matches_substrate_impl_large_xt() {
393391
// Define xt parameters,
394392
let alice = MultiAddress::Id(AccountKeyring::Alice.to_account_id());
395-
let code: Vec<u8> = include_bytes!("test-runtime.compact.wasm").to_vec();
393+
let code: Vec<u8> = include_bytes!("solochain_template_runtime.wasm").to_vec();
396394
let call = RuntimeCall::System(SystemCall::set_code { code });
397395

398396
let msg = &b"test-message"[..];
@@ -412,6 +410,7 @@ mod tests {
412410
CheckNonce::<Runtime>::from(nonce),
413411
CheckWeight::<Runtime>::new(),
414412
ChargeTransactionPayment::<Runtime>::from(fee),
413+
CheckMetadataHash::<Runtime>::new(false),
415414
);
416415
let substrate_extrinsic = UncheckedExtrinsic::new_signed(
417416
call.clone(),
1.02 MB
Binary file not shown.
-2.04 MB
Binary file not shown.

src/api/api_client.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,7 @@ mod tests {
268268
use super::*;
269269
use crate::rpc::mocks::RpcClientMock;
270270
use ac_primitives::{
271-
AssetRuntimeConfig, DefaultRuntimeConfig, GenericAdditionalParams, GenericExtrinsicParams,
272-
PlainTip,
271+
DefaultRuntimeConfig, GenericAdditionalParams, GenericExtrinsicParams, PlainTip,
273272
};
274273
use frame_metadata::{v14::ExtrinsicMetadata, RuntimeMetadata};
275274
use scale_info::form::PortableForm;

0 commit comments

Comments
 (0)