types

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: AGPL-3.0 Imports: 4 Imported by: 10

README

package types

This package is used by other packages in this repository. It contains the generic types that are used by the other packages. Specific types are defined in the packages that use them.

This package must not import any other package from this repository in order to avoid circular dependencies. If you need to import another package, you should move the type to that package.

Documentation

Index

Constants

View Source
const (

	// ModeMiner starts vocdoninode as a miner.
	ModeMiner = "miner"
	// ModeSeed starts vocdoninode as a seed node.
	ModeSeed = "seed"
	// ModeGateway starts the vocdoninode as a gateway.
	ModeGateway = "gateway"
	// ModeCensus starts the vocdoninode as a census only service.
	ModeCensus = "census"

	// ProcessIDsize is the size of a process id.
	ProcessIDsize = 32

	// EthereumAddressSize is the size of an ethereum address.
	EthereumAddressSize = 20

	// EntityIDsize is the size of an entity id (ethereum address).
	EntityIDsize = EthereumAddressSize

	// ArchiveURL is the default URL where the archive is retrieved from.
	ArchiveURL = "/ipns/k2k4r8otxrf176h1i08txap0ep6ynr1jac0vymozi068eedml7gk1595"

	// DefaultBlockTime is the default block time in seconds.
	DefaultBlockTime = 12 * time.Second

	// KeyKeeperMaxKeyIndex is the maxim number of allowed encryption keys.
	KeyKeeperMaxKeyIndex = 16

	// ProcessesContractMaxEnvelopeType represents the max value that a uint8 can have
	// with the current smart contract bitmask describing the supported envelope types.
	ProcessesContractMaxEnvelopeType = 31

	// MaxURLLength is the maximum length of a URL string used in the protocol.
	MaxURLLength = 2083
)

Variables

View Source
var (
	False = Bool(false)
	True  = Bool(true)
)

These exported variables should be treated as constants, to be used in API responses which require *bool fields.

Functions

func Bool

func Bool(b bool) *bool

Types

type AccountID added in v1.4.0

type AccountID = HexBytes

type BigInt added in v1.3.0

type BigInt big.Int

BigInt is a big.Int wrapper which marshals JSON to a string representation of the big number. Note that a nil pointer value marshals as the empty string.

func (*BigInt) Add added in v1.3.0

func (i *BigInt) Add(x, y *BigInt) *BigInt

Add sum x+y

func (*BigInt) Bytes added in v1.3.0

func (i *BigInt) Bytes() []byte

Bytes returns the bytes representation of the big number

func (*BigInt) Equal added in v1.3.0

func (i *BigInt) Equal(j *BigInt) bool

Equal helps us with go-cmp.

func (*BigInt) GobDecode added in v1.3.0

func (i *BigInt) GobDecode(buf []byte) error

func (*BigInt) GobEncode added in v1.3.0

func (i *BigInt) GobEncode() ([]byte, error)

func (*BigInt) MarshalText added in v1.3.0

func (i *BigInt) MarshalText() ([]byte, error)

func (*BigInt) MathBigInt added in v1.4.0

func (i *BigInt) MathBigInt() *big.Int

MathBigInt converts b to a math/big *Int.

func (*BigInt) Mul added in v1.3.0

func (i *BigInt) Mul(x, y *BigInt) *BigInt

Mul multiplies x*y

func (*BigInt) SetBytes added in v1.3.0

func (i *BigInt) SetBytes(buf []byte) *BigInt

SetBytes interprets buf as big-endian unsigned integer

func (*BigInt) SetUint64 added in v1.3.0

func (i *BigInt) SetUint64(x uint64) *BigInt

SetUint64 sets the value of x to the big number

func (*BigInt) String added in v1.3.0

func (i *BigInt) String() string

String returns the string representation of the big number

func (*BigInt) Sub added in v1.4.0

func (i *BigInt) Sub(x, y *BigInt) *BigInt

Sub subs x-y

func (*BigInt) UnmarshalText added in v1.3.0

func (i *BigInt) UnmarshalText(data []byte) error

type CensusRoot added in v1.3.0

type CensusRoot = []byte

type DataStore

type DataStore struct {
	Datadir string
}

type EntityID added in v1.3.0

type EntityID = []byte

type Hash added in v1.4.0

type Hash = []byte

type HexBytes

type HexBytes []byte

HexBytes is a []byte which encodes as hexadecimal in json, as opposed to the base64 default.

func HexStringToHexBytes added in v1.6.0

func HexStringToHexBytes(hexString string) HexBytes

HexStringToHexBytes converts a hex string to a HexBytes. It strips a leading '0x' or '0X' if found, for backwards compatibility. Panics if the string is not a valid hex string.

func (HexBytes) MarshalJSON

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

func (*HexBytes) String added in v1.4.0

func (b *HexBytes) String() string

func (*HexBytes) UnmarshalJSON

func (b *HexBytes) UnmarshalJSON(data []byte) error

type Nullifier added in v1.3.0

type Nullifier = []byte

type ProcessID added in v1.3.0

type ProcessID = []byte

Jump to

Keyboard shortcuts

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