Skip to content

Commit

Permalink
fix(namada): decode validator stake as option
Browse files Browse the repository at this point in the history
  • Loading branch information
egasimus committed Sep 27, 2024
1 parent 7c6e954 commit 20f921b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/namada/NamadaPoS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ export async function fetchValidatorStake (
let query = `/vp/pos/validator/stake/${address}`
if (epoch) query += `/${epoch}`
const totalStake = await connection.abciQuery(query)
return decode(u256, totalStake)
if (totalStake[0] === 0) return 0
return decode(u256, totalStake.slice(1))
}

/** Fetch details for a Namada validator. */
Expand Down

0 comments on commit 20f921b

Please sign in to comment.