Skip to content

Commit

Permalink
Merge pull request #90 from Concordium/fix-cis2balane
Browse files Browse the repository at this point in the history
Fix CIS2TokenBalance overflow.
  • Loading branch information
abizjak authored May 17, 2023
2 parents a823e92 + 34a4d6f commit e8d3bcb
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 e8d3bcb

Please sign in to comment.