You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 1, 2026. It is now read-only.
Repository navigation
Commit cf9872f
Browse filesBrowse the repository at this point in the historyBrowse files
- Source pending from delegatorSummary instead of delegatorHistory, drop countdown
- Model staking amounts as String to avoid f64 round-trip
- Drop no-op serde rename_all and inline balance parsing
let native_decimals = Asset::from_chain(chain).decimalsasu32;
50
-
let available_biguint = BigNumberFormatter::value_from_amount_biguint(&balance.delegated.to_string(), native_decimals).unwrap_or_default();
51
-
let pending_biguint = BigNumberFormatter::value_from_amount_biguint(&balance.total_pending_withdrawal.to_string(), native_decimals).unwrap_or_default();
50
+
let available_biguint = BigNumberFormatter::value_from_amount_biguint(&balance.delegated, native_decimals).unwrap_or_default();
51
+
let pending_biguint = BigNumberFormatter::value_from_amount_biguint(&balance.total_pending_withdrawal, native_decimals).unwrap_or_default();
52
52
53
53
Ok(AssetBalance::new_balance(
54
54
chain.as_asset_id(),
@@ -138,9 +138,9 @@ mod tests {
138
138
#[test]
139
139
fntest_map_balance_staking(){
140
140
let stake_balance = StakeBalance{
141
-
delegated:100.0,
142
-
undelegated:0.0,
143
-
total_pending_withdrawal:10.0,
141
+
delegated:"100.0".to_string(),
142
+
undelegated:"0.0".to_string(),
143
+
total_pending_withdrawal:"10.0".to_string(),
144
144
};
145
145
let result = map_balance_staking(&stake_balance,Chain::HyperCore).unwrap();
0 commit comments