bigint

package
v0.180.29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const FixedLength = 32 // u256 -> 32 bytes

Variables

This section is empty.

Functions

This section is empty.

Types

type BigInt

type BigInt struct {
	*big.Int
}

func (BigInt) MarshalJSON

func (b BigInt) MarshalJSON() ([]byte, error)

func (*BigInt) UnmarshalJSON

func (b *BigInt) UnmarshalJSON(p []byte) error

type HexBigInt added in v0.146.3

type HexBigInt struct {
	*big.Int
}

Unmarshals a u256 as a fixed-length hex string with 0x prefix and leading zeros

func (*HexBigInt) UnmarshalJSON added in v0.146.3

func (b *HexBigInt) UnmarshalJSON(input []byte) error

type NilableSQLBigInt added in v0.175.3

type NilableSQLBigInt struct {
	big.Int
	// contains filtered or unexported fields
}

func (*NilableSQLBigInt) IsNil added in v0.175.3

func (i *NilableSQLBigInt) IsNil() bool

func (*NilableSQLBigInt) Scan added in v0.175.3

func (i *NilableSQLBigInt) Scan(value interface{}) error

Scan implements interface.

func (*NilableSQLBigInt) SetNil added in v0.175.3

func (i *NilableSQLBigInt) SetNil()

func (*NilableSQLBigInt) Value added in v0.175.3

func (i *NilableSQLBigInt) Value() (driver.Value, error)

Not implemented, used only for scanning

type SQLBigInt

type SQLBigInt big.Int

SQLBigInt type for storing uint256 in the databse. FIXME(dshulyak) SQL big int is max 64 bits. Maybe store as bytes in big endian and hope that lexographical sorting will work.

func (*SQLBigInt) Scan

func (i *SQLBigInt) Scan(value interface{}) error

Scan implements interface.

func (*SQLBigInt) Value

func (i *SQLBigInt) Value() (driver.Value, error)

Value implements interface.

type SQLBigIntBytes

type SQLBigIntBytes big.Int

SQLBigIntBytes type for storing big.Int as BLOB in the databse.

func (*SQLBigIntBytes) Scan

func (i *SQLBigIntBytes) Scan(value interface{}) error

func (*SQLBigIntBytes) Value

func (i *SQLBigIntBytes) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL