diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/math/big.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/math/big.go b/common/math/big.go index 9d2e7946d..d31c59af1 100644 --- a/common/math/big.go +++ b/common/math/big.go @@ -42,6 +42,13 @@ const ( // HexOrDecimal256 marshals big.Int as hex or decimal. type HexOrDecimal256 big.Int +// NewHexOrDecimal256 creates a new HexOrDecimal256 +func NewHexOrDecimal256(x int64) *HexOrDecimal256 { + b := big.NewInt(x) + h := HexOrDecimal256(*b) + return &h +} + // UnmarshalText implements encoding.TextUnmarshaler. func (i *HexOrDecimal256) UnmarshalText(input []byte) error { bigint, ok := ParseBig256(string(input)) |