From a4428c505e84aaa1982d4cc522e0c0ffe608890a Mon Sep 17 00:00:00 2001 From: Eugene Valeyev Date: Thu, 29 Nov 2018 13:02:31 +0300 Subject: [PATCH] mobile: added constructor for BigInts (#17828) --- mobile/big.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mobile/big.go b/mobile/big.go index dd7b15878..86ea93245 100644 --- a/mobile/big.go +++ b/mobile/big.go @@ -84,6 +84,13 @@ func (bi *BigInt) SetString(x string, base int) { // BigInts represents a slice of big ints. type BigInts struct{ bigints []*big.Int } +// NewBigInts creates a slice of uninitialized big numbers. +func NewBigInts(size int) *BigInts { + return &BigInts{ + bigints: make([]*big.Int, size), + } +} + // Size returns the number of big ints in the slice. func (bi *BigInts) Size() int { return len(bi.bigints)