Merge pull request #788 from nspcc-dev/fix/vmbigint
vm: make NewBigInteger accept int64
This commit is contained in:
commit
f84008437e
2 changed files with 3 additions and 3 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue