Skip to content

Commit

Permalink
fix(namada): epoch: handle option bit
Browse files Browse the repository at this point in the history
  • Loading branch information
egasimus committed Jul 22, 2024
1 parent bd9e4e2 commit 21e2c14
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/namada/NamadaEpoch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export async function fetchEpoch (
height?: number|bigint
) {
if (height !== undefined) {
return decode(u64, await connection.abciQuery(`/shell/epoch_at_height/${height}`))
const binary = await connection.abciQuery(`/shell/epoch_at_height/${height}`)
return binary[0] ? decode(u64, binary.slice(1)) : null
} else {
return decode(u64, await connection.abciQuery("/shell/epoch"))
}
Expand Down

0 comments on commit 21e2c14

Please sign in to comment.