Merge pull request #788 from nspcc-dev/fix/vmbigint

vm: make NewBigInteger accept int64
This commit is contained in:
Roman Khimov 2020-03-24 12:38:22 +03:00 committed by GitHub
commit f84008437e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -434,7 +434,7 @@ func parseArgs(args []string) ([]vm.StackItem, error) {
return nil, errors.New("failed to parse bool parameter") return nil, errors.New("failed to parse bool parameter")
} }
case intType: case intType:
val, err := strconv.Atoi(value) val, err := strconv.ParseInt(value, 10, 64)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View file

@ -191,9 +191,9 @@ type BigIntegerItem struct {
} }
// NewBigIntegerItem returns an new BigIntegerItem object. // NewBigIntegerItem returns an new BigIntegerItem object.
func NewBigIntegerItem(value int) *BigIntegerItem { func NewBigIntegerItem(value int64) *BigIntegerItem {
return &BigIntegerItem{ return &BigIntegerItem{
value: big.NewInt(int64(value)), value: big.NewInt(value),
} }
} }