Skip to content
Snippets Groups Projects
Commit 9cd6a674 authored by Gav's avatar Gav
Browse files

Fix misleading names.

parent 8a67a759
No related merge requests found
......@@ -786,6 +786,7 @@ name = "native-runtime"
version = "0.1.0"
dependencies = [
"hex-literal 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"runtime-std 0.1.0",
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
......
......@@ -12,3 +12,4 @@ without-std = []
runtime-std = { path = "./std", version = "0.1" }
rustc-hex = "1.0"
hex-literal = "0.1.0"
log = "0.3"
......@@ -24,6 +24,9 @@ extern crate runtime_std;
#[cfg(feature = "with-std")]
extern crate rustc_hex;
#[cfg(feature = "with-std")]
#[macro_use]
extern crate log;
#[cfg(test)]
#[macro_use]
......
......@@ -146,7 +146,7 @@ fn initial_checks(block: &Block) {
let txs = block.transactions.iter().map(Slicable::to_vec).collect::<Vec<_>>();
let txs = txs.iter().map(Vec::as_slice).collect::<Vec<_>>();
let txs_root = enumerated_trie_root(&txs);
debug_assert_hash(&header.transaction_root, &txs_root);
info_expect_equal_hash(&header.transaction_root, &txs_root);
assert!(header.transaction_root == txs_root, "Transaction trie root must be valid.");
}
......@@ -160,7 +160,7 @@ fn final_checks(block: &Block) {
// check storage root.
let storage_root = storage_root();
debug_assert_hash(&header.state_root, &storage_root);
info_expect_equal_hash(&header.state_root, &storage_root);
assert!(header.state_root == storage_root, "Storage root must match that calculated.");
}
......@@ -171,15 +171,15 @@ fn post_finalise(header: &Header) {
}
#[cfg(feature = "with-std")]
fn debug_assert_hash(given: &Hash, expected: &Hash) {
fn info_expect_equal_hash(given: &Hash, expected: &Hash) {
use support::HexDisplay;
if given != expected {
println!("Hash: given={}, expected={}", HexDisplay::from(given), HexDisplay::from(expected));
info!("Hash: given={}, expected={}", HexDisplay::from(given), HexDisplay::from(expected));
}
}
#[cfg(not(feature = "with-std"))]
fn debug_assert_hash(_given: &Hash, _expected: &Hash) {}
fn info_expect_equal_hash(_given: &Hash, _expected: &Hash) {}
#[cfg(test)]
mod tests {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment