dione/types/bigint.go

21 lines
320 B
Go
Raw Normal View History

package types
import (
"math/big"
big2 "github.com/filecoin-project/go-state-types/big"
)
var EmptyInt = BigInt{}
type BigInt = big2.Int
func NewInt(i uint64) BigInt {
return BigInt{Int: big.NewInt(0).SetUint64(i)}
}
func BigFromBytes(b []byte) BigInt {
i := big.NewInt(0).SetBytes(b)
return BigInt{Int: i}
}