Skip to content

Commit 0ec8ac9

Browse files
committed
Fix remove zero stake pools from new stake distribution computation
1 parent e064336 commit 0ec8ac9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

mithril-common/src/chain_observer/cli_observer.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,9 @@ impl CardanoCliChainObserver {
382382
.ok_or(ChainObserverError::InvalidContent(
383383
format!("Stake could not be converted to integer for {pool_id_bech32}").into(),
384384
))?;
385-
stake_distribution.insert(pool_id_bech32, stakes);
385+
if stakes > 0 {
386+
stake_distribution.insert(pool_id_bech32, stakes);
387+
}
386388
}
387389

388390
Ok(Some(stake_distribution))
@@ -605,6 +607,11 @@ pool1qz2vzszautc2c8mljnqre2857dpmheq7kgt6vav0s38tvvhxm6w 1.051e-6
605607
"stakeGo": 1200000000000,
606608
"stakeMark": 1200000000001,
607609
"stakeSet": 1200000000002
610+
},
611+
"00000ffff93effbf3ce788aebd3e7506b80322bd3995ad432e61fad5": {
612+
"stakeGo": 0,
613+
"stakeMark": 0,
614+
"stakeSet": 1300000000002
608615
}
609616
},
610617
"total": {

0 commit comments

Comments
 (0)