Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Proper test
  • Loading branch information
arkpar committed Jul 26, 2018
commit 0e17e47f375625146af501b1bc1efa501a9c0add
5 changes: 2 additions & 3 deletions substrate/runtime/executive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,12 @@ mod tests {
}

#[test]
#[should_panic]
fn bad_extrinsic_not_inserted() {
let mut t = new_test_ext();
let xt = primitives::testing::TestXt((1, 0, Call::transfer(2.into(), 69)));
let xt = primitives::testing::TestXt((1, 42, Call::transfer(33.into(), 69)));
with_externalities(&mut t, || {
Executive::initialise_block(&Header::new(1, H256::default(), H256::default(), [69u8; 32].into(), Digest::default()));
Executive::apply_extrinsic(xt).unwrap();
assert!(Executive::apply_extrinsic(xt).is_err());
assert_eq!(<system::Module<Test>>::extrinsic_index(), 0);
});
}
Expand Down
1 change: 0 additions & 1 deletion substrate/runtime/system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ impl<T: Trait> Module<T> {

/// Remove all extrinsics data and save the extrinsics trie root.
pub fn derive_extrinsics() {
println!("INDEX: {:?}", Self::extrinsic_index());
let extrinsics = (0..Self::extrinsic_index()).map(<ExtrinsicData<T>>::take).collect();
let xts_root = extrinsics_data_root::<T::Hashing>(extrinsics);
<ExtrinsicsRoot<T>>::put(xts_root);
Expand Down