Skip to content

Commit

Permalink
Fix CIS2TokenBalance overflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
abizjak committed May 16, 2023
1 parent a823e92 commit 34a4d6f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Unreleased changes

## 0.26.3

- Fix bug in CIS2TokenBalance endpoint where it sometimes returned an incorrect
amount due to overflow.

## 0.26.2

- Revert behaviour in case when accounts are not found. Now, again, a status
Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: wallet-proxy
version: 0.26.2
version: 0.26.3
github: "Concordium/concordium-wallet-proxy"
author: "Concordium"
maintainer: "developers@concordium.com"
Expand Down
2 changes: 1 addition & 1 deletion src/Proxy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ getTokenBalance = TokenBalance <$> go 0 0
n <- S.getWord8
if testBit n 7
then go (acc + (toInteger (clearBit n 7) `shiftL` (s * 7))) (s + 1)
else return $! (acc + toInteger (n `shiftL` (s * 7)))
else return $! (acc + toInteger n `shiftL` (s * 7))

newtype Checksum = Checksum Hash
deriving (Show, AE.ToJSON, AE.FromJSON, S.Serialize)
Expand Down

0 comments on commit 34a4d6f

Please sign in to comment.