Skip to content

Commit

Permalink
[notary] Modified string to int conversion to account for values out …
Browse files Browse the repository at this point in the history
…of range for 32-bit int
  • Loading branch information
borjantrajanoski committed Nov 14, 2018
1 parent aba1933 commit e0a5d54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions keyManager/keyManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,11 @@ func (km KeyManager) SignEthTx(signer types.Signer, addresses common.Address, tx
}

// If it doesn't start with 0x we try to convert it into integer which will be formated properly
txDataShardInt, err := strconv.Atoi(txDataShard)
txDataShardInt64, err := strconv.ParseInt(txDataShard, 10, 64)
if err != nil {
return "", errors.New("[keyManager.go] " + toTransform + " " + err.Error())
}
return "0x" + strconv.FormatInt(int64(txDataShardInt), 16), nil
return "0x" + strconv.FormatInt(txDataShardInt64, 16), nil

} // switch txData[toTransform].(type)
return "", errors.New("[keyManager.go] " + toTransform + " " + "is of invalid type " + fmt.Sprintf("%T", txData[toTransform]))
Expand Down

0 comments on commit e0a5d54

Please sign in to comment.