mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-21 09:05:10 +00:00
ERC1155: subtraction overflow issue resolved
Signed-off-by: Rajat Sharma <connecttorajat@outlook.com>
This commit is contained in:
parent
fc2494aebd
commit
dc015eb3eb
1 changed files with 2 additions and 2 deletions
|
|
@ -1151,9 +1151,9 @@ func sub(b uint64, q uint64) (uint64, error) {
|
||||||
|
|
||||||
// Check overflow
|
// Check overflow
|
||||||
var diff uint64
|
var diff uint64
|
||||||
diff = q - b
|
diff = b - q
|
||||||
|
|
||||||
if diff > q {
|
if diff > b {
|
||||||
return 0, fmt.Errorf("Math: subtraction overflow occurred %d - %d", b, q)
|
return 0, fmt.Errorf("Math: subtraction overflow occurred %d - %d", b, q)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue