Skip to content

Commit

Permalink
add tower height to v5 snapshot parse
Browse files Browse the repository at this point in the history
  • Loading branch information
Vale MacCony committed Jan 21, 2025
1 parent c872568 commit 09111f5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/extract_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use anyhow::Result;
use diem_types::account_view::AccountView;
use libra_backwards_compatibility::version_five::{
balance_v5::BalanceResourceV5,
ol_tower_state::TowerStateResource,
ol_wallet::SlowWalletResourceV5,
state_snapshot_v5::{v5_accounts_from_manifest_path, v5_read_from_snapshot_manifest},
};
Expand Down Expand Up @@ -61,6 +62,10 @@ pub async fn extract_v5_snapshot(v5_manifest_path: &Path) -> Result<Vec<Warehous
s.slow_wallet_transferred = sw.transferred;
}

if let Ok(tower) = acc.get_resource::<TowerStateResource>() {
s.miner_height = Some(tower.verified_tower_height);
}

warehouse_state.push(s);
}
Err(e) => {
Expand Down

0 comments on commit 09111f5

Please sign in to comment.