Skip to content

Commit

Permalink
fix(light-client): according to the rfc change (nervosnetwork/rfcs#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
yangby-cryptape committed Dec 8, 2022
1 parent 76a0f16 commit fad50d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
3 changes: 1 addition & 2 deletions util/launcher/src/migrations/add_chain_root_mmr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ use std::sync::Arc;

pub struct AddChainRootMMR;

// TODO(light-client) update the version number of this db migration.
const VERSION: &str = "20220214100000";
const VERSION: &str = "20221208151540";

impl Migration for AddChainRootMMR {
fn migrate(
Expand Down
10 changes: 2 additions & 8 deletions util/types/src/utilities/merkle_mountain_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,9 @@ impl core::BlockView {
impl core::HeaderView {
/// Get the MMR header digest of the header
pub fn digest(&self) -> packed::HeaderDigest {
self.data().digest()
}
}

impl packed::Header {
/// Get the MMR header digest of the header
pub fn digest(&self) -> packed::HeaderDigest {
let raw = self.raw();
let raw = self.data().raw();
packed::HeaderDigest::new_builder()
.children_hash(self.hash())
.total_difficulty(self.difficulty().pack())
.start_number(raw.number())
.end_number(raw.number())
Expand Down

0 comments on commit fad50d1

Please sign in to comment.