Skip to content
This repository was archived by the owner on Jul 4, 2022. It is now read-only.

Commit 94086b4

Browse files
authored
Fix test build and 1.46.0 build (#132)
1 parent 93690e4 commit 94086b4

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

Cargo.lock

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

frame/executive/tests/doughnut_integration.rs

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -547,11 +547,11 @@ fn delegated_dispatch_fails_with_bad_argument() {
547547

548548
#[test]
549549
fn plug_extrinsic_decodes_with_doughnut() {
550-
// Integrationt test for doughnut + extrinsic codec, not Executive specific
550+
// Integration test for doughnut + extrinsic codec, not Executive specific
551551
let issuer_alice: AccountId = AccountKeyring::Alice.into();
552552
let holder_bob: AccountId = AccountKeyring::Bob.into();
553553

554-
// The doughnut proof is wrapped for embeddeding in extrinsic
554+
// The doughnut proof is wrapped for embedding in extrinsic
555555
let doughnut = PlugDoughnut::<Runtime>::new(
556556
make_doughnut(
557557
issuer_alice.clone(),
@@ -562,17 +562,21 @@ fn plug_extrinsic_decodes_with_doughnut() {
562562
)
563563
);
564564

565-
// Setup extrinsic
566-
let xt = CheckedExtrinsic {
567-
signed: Some((
568-
holder_bob.clone(),
569-
signed_extra(0, 0, Some(doughnut)),
570-
)),
571-
function: Call::Balances(BalancesCall::transfer(holder_bob.clone().into(), 69)),
572-
};
573-
let uxt = sign_extrinsic(xt);
574-
let encoded_extrinsic = uxt.encode();
575-
let decoded: UncheckedExtrinsic = Decode::decode(&mut &encoded_extrinsic[..]).expect("plug extrinsic with doughnut decodes ok");
565+
let default_genesis_config = frame_system::GenesisConfig::default().build_storage::<Runtime>().unwrap();
566+
let mut t = sp_io::TestExternalities::new(default_genesis_config);
567+
t.execute_with(|| {
568+
// Setup extrinsic
569+
let xt = CheckedExtrinsic {
570+
signed: Some((
571+
holder_bob.clone(),
572+
signed_extra(0, 0, Some(doughnut)),
573+
)),
574+
function: Call::Balances(BalancesCall::transfer(holder_bob.clone().into(), 69)),
575+
};
576+
let uxt = sign_extrinsic(xt);
577+
let encoded_extrinsic = uxt.encode();
578+
let decoded: UncheckedExtrinsic = Decode::decode(&mut &encoded_extrinsic[..]).expect("plug extrinsic with doughnut decodes ok");
576579

577-
assert_eq!(decoded, uxt);
580+
assert_eq!(decoded, uxt);
581+
});
578582
}

0 commit comments

Comments
 (0)