Skip to content

Commit 3927d8a

Browse files
bkchrMTDK1
authored andcommitted
Use storage_root of newly calculated header (paritytech#2216)
Instead of calculating the `storage_root` a second time, we just can take the `storage_root` from the new header.
1 parent 5a10574 commit 3927d8a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

node/runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
6060
impl_name: create_runtime_str!("substrate-node"),
6161
authoring_version: 10,
6262
spec_version: 57,
63-
impl_version: 58,
63+
impl_version: 59,
6464
apis: RUNTIME_API_VERSIONS,
6565
};
6666

srml/executive/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use rstd::marker::PhantomData;
2323
use rstd::result;
2424
use primitives::traits::{
2525
self, Header, Zero, One, Checkable, Applyable, CheckEqual, OnFinalize,
26-
OnInitialize, Hash, As, Digest, NumberFor, Block as BlockT, OffchainWorker
26+
OnInitialize, As, Digest, NumberFor, Block as BlockT, OffchainWorker
2727
};
2828
use srml_support::{Dispatchable, traits::MakePayment};
2929
use parity_codec::{Codec, Encode};
@@ -238,9 +238,9 @@ impl<
238238
}
239239

240240
// check storage root.
241-
let storage_root = System::Hashing::storage_root();
241+
let storage_root = new_header.state_root();
242242
header.state_root().check_equal(&storage_root);
243-
assert!(header.state_root() == &storage_root, "Storage root must match that calculated.");
243+
assert!(header.state_root() == storage_root, "Storage root must match that calculated.");
244244
}
245245

246246
/// Check a given transaction for validity. This doesn't execute any

0 commit comments

Comments
 (0)