Documentation ¶
Index ¶
- Variables
- func AliasIDFromAliasOutput(out *iotago.AliasOutput, outID iotago.OutputID) iotago.AliasID
- func AllDifferentStrings(lst ...string) bool
- func Bytes(obj interface{ ... }) ([]byte, error)
- func CloneMap[K comparable, T Cloneable[T]](base map[K]T) map[K]T
- func CloneSlice[T Cloneable[T]](base []T) []T
- func CreateDirectoryForFilePath(filePath string, perm os.FileMode) error
- func CustomTokensDecimalsToEthereumDecimals(value *big.Int, customTokenDecimals uint32) *big.Int
- func DecodeHexBinaryMarshaled(dataHex string, value encoding.BinaryUnmarshaler) error
- func DecodeSliceHexBinaryMarshaled[M encoding.BinaryUnmarshaler](dataHex []string, values []M) error
- func EncodeHexBinaryMarshaled(value encoding.BinaryMarshaler) (string, error)
- func EncodeSliceHexBinaryMarshaled[M encoding.BinaryMarshaler](values []M) ([]string, error)
- func EthereumDecimalsToCustomTokenDecimals(value *big.Int, customTokenDecimals uint32) *big.Int
- func ExistsFilePath(filePath string) (bool, error)
- func GentleTruncate(s string, length int) string
- func GetHashValue(obj interface{ ... }) hashing.HashValue
- func Int32To4Bytes(val int32) []byte
- func Int64From8Bytes(b []byte) (int64, error)
- func Int64To8Bytes(val int64) []byte
- func IsSlug(s string) bool
- func IsSubset(sub, super []string) bool
- func IsZeroBigInt(bi *big.Int) bool
- func MakeRange(from, to int) []int
- func MinUint64(a, b uint64) uint64
- func MustBytes(obj interface{ ... }) []byte
- func MustTokenScheme(tokenScheme iotago.TokenScheme) *iotago.SimpleTokenScheme
- func MustUint16From2Bytes(b []byte) uint16
- func MustUint32From4Bytes(b []byte) uint32
- func MustUint64From8Bytes(b []byte) uint64
- func MustUint8From1Bytes(b []byte) uint8
- func NFTIDFromNFTOutput(nftOutput *iotago.NFTOutput, outputID iotago.OutputID) iotago.NFTID
- func PrefixHex(data []byte, prefixLen int) string
- func ReadBoolByte(r io.Reader, cond *bool) error
- func ReadByte(r io.Reader) (byte, error)
- func ReadBytes16(r io.Reader) ([]byte, error)
- func ReadBytes16FromMarshalUtil(mu *marshalutil.MarshalUtil) ([]byte, error)
- func ReadBytes32(r io.Reader) ([]byte, error)
- func ReadBytes8(r io.Reader) ([]byte, error)
- func ReadBytes8FromMarshalUtil(mu *marshalutil.MarshalUtil) ([]byte, error)
- func ReadHashValue(r io.Reader, h *hashing.HashValue) error
- func ReadInt32(r io.Reader, pval *int32) error
- func ReadInt64(r io.Reader, pval *int64) error
- func ReadIntsAsBits(r io.Reader) ([]int, error)
- func ReadMarshaled(r io.Reader, val encoding.BinaryUnmarshaler) error
- func ReadOutputID(r io.Reader) (iotago.OutputID, error)
- func ReadString16(r io.Reader) (string, error)
- func ReadStrings16(r io.Reader) ([]string, error)
- func ReadTime(r io.Reader, ts *time.Time) error
- func ReadTransactionID(r io.Reader, txid *iotago.TransactionID) error
- func ReadUint16(r io.Reader, pval *uint16) error
- func ReadUint32(r io.Reader, pval *uint32) error
- func ReadUint64(r io.Reader, pval *uint64) error
- func ReadUint8(r io.Reader, pval *uint8) error
- func Same[V Equated[V]](a, b []V) bool
- func SelectDeterministicRandomUint16(selectFrom []uint16, seed int64) uint16
- func SliceShortString[E ShortStringable](slice []E) string
- func StringInList(s string, lst []string) bool
- func TerminateCmdWhenTestStops(cmd *exec.Cmd)
- func TimeOrNever(t time.Time) string
- func TimeOrNever2(t time.Time, never string) string
- func ToBigInt(i interface{}) *big.Int
- func Uint16From2Bytes(b []byte) (uint16, error)
- func Uint16To2Bytes(val uint16) []byte
- func Uint32From4Bytes(b []byte) (uint32, error)
- func Uint32To4Bytes(val uint32) []byte
- func Uint64From8Bytes(b []byte) (uint64, error)
- func Uint64To8Bytes(val uint64) []byte
- func Uint8From1Bytes(b []byte) (uint8, error)
- func Uint8To1Bytes(val uint8) []byte
- func ValidPermutation(perm []uint16) bool
- func WriteBoolByte(w io.Writer, cond bool) error
- func WriteByte(w io.Writer, val byte) error
- func WriteBytes16(w io.Writer, data []byte) error
- func WriteBytes16ToMarshalUtil(data []byte, mu *marshalutil.MarshalUtil)
- func WriteBytes32(w io.Writer, data []byte) error
- func WriteBytes8(w io.Writer, data []byte) error
- func WriteBytes8ToMarshalUtil(data []byte, mu *marshalutil.MarshalUtil)
- func WriteInt64(w io.Writer, val int64) error
- func WriteIntsAsBits(w io.Writer, ints []int) error
- func WriteMarshaled(w io.Writer, val encoding.BinaryMarshaler) error
- func WriteOutputID(w io.Writer, outputID iotago.OutputID) error
- func WriteString16(w io.Writer, str string) error
- func WriteStrings16(w io.Writer, strs []string) error
- func WriteTime(w io.Writer, ts time.Time) error
- func WriteUint16(w io.Writer, val uint16) error
- func WriteUint32(w io.Writer, val uint32) error
- func WriteUint64(w io.Writer, val uint64) error
- func WriteUint8(w io.Writer, val uint8) error
- type BitVector
- type Cloneable
- type ComparableAddress
- type ComparableString
- type Equated
- type Permutation16
- type Ratio32
- func (r Ratio32) Bytes() []byte
- func (r Ratio32) HasZeroComponent() bool
- func (r *Ratio32) Set(s string) error
- func (r Ratio32) String() string
- func (r Ratio32) Type() string
- func (r Ratio32) XCeil64(y uint64) uint64
- func (r Ratio32) XFloor64(y uint64) uint64
- func (r Ratio32) YCeil64(x uint64) uint64
- func (r Ratio32) YFloor64(x uint64) uint64
- type ShortStringable
- type Timer
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AliasIDFromAliasOutput ¶ added in v0.3.0
func AllDifferentStrings ¶ added in v0.2.0
func CloneMap ¶ added in v1.0.3
func CloneMap[K comparable, T Cloneable[T]](base map[K]T) map[K]T
CloneMap clones every element in the the map into cloned and returns the cloned map.
func CloneSlice ¶ added in v1.0.3
func CloneSlice[T Cloneable[T]](base []T) []T
CloneSlice clones every element in the the slice into cloned and returns the cloned slice.
func CreateDirectoryForFilePath ¶ added in v1.0.3
func CustomTokensDecimalsToEthereumDecimals ¶ added in v0.3.8
custom token => wei
func DecodeHexBinaryMarshaled ¶ added in v1.0.3
func DecodeHexBinaryMarshaled(dataHex string, value encoding.BinaryUnmarshaler) error
func DecodeSliceHexBinaryMarshaled ¶ added in v1.0.3
func DecodeSliceHexBinaryMarshaled[M encoding.BinaryUnmarshaler](dataHex []string, values []M) error
func EncodeHexBinaryMarshaled ¶ added in v1.0.3
func EncodeHexBinaryMarshaled(value encoding.BinaryMarshaler) (string, error)
func EncodeSliceHexBinaryMarshaled ¶ added in v1.0.3
func EncodeSliceHexBinaryMarshaled[M encoding.BinaryMarshaler](values []M) ([]string, error)
func EthereumDecimalsToCustomTokenDecimals ¶ added in v0.3.8
wei => custom token
func ExistsFilePath ¶ added in v0.1.0
ExistsFilePath returns whether the given file or directory exists.
func GentleTruncate ¶ added in v0.1.0
func GetHashValue ¶
func Int32To4Bytes ¶ added in v0.2.0
func Int64From8Bytes ¶ added in v0.1.0
func Int64To8Bytes ¶ added in v0.2.0
func IsZeroBigInt ¶ added in v0.3.0
func MakeRange ¶ added in v0.2.0
MakeRange returns slice with a range of elements starting from to up to-1, inclusive
func MustTokenScheme ¶ added in v0.3.0
func MustTokenScheme(tokenScheme iotago.TokenScheme) *iotago.SimpleTokenScheme
func MustUint16From2Bytes ¶ added in v0.1.0
func MustUint32From4Bytes ¶ added in v0.1.0
func MustUint64From8Bytes ¶ added in v0.1.0
func MustUint8From1Bytes ¶ added in v0.2.3
func NFTIDFromNFTOutput ¶ added in v0.3.0
func ReadBytes16FromMarshalUtil ¶ added in v0.3.0
func ReadBytes16FromMarshalUtil(mu *marshalutil.MarshalUtil) ([]byte, error)
func ReadBytes8FromMarshalUtil ¶ added in v0.3.0
func ReadBytes8FromMarshalUtil(mu *marshalutil.MarshalUtil) ([]byte, error)
func ReadMarshaled ¶ added in v0.1.0
func ReadMarshaled(r io.Reader, val encoding.BinaryUnmarshaler) error
ReadMarshaled supports kyber.Point, kyber.Scalar and similar.
func ReadTransactionID ¶ added in v0.3.0
func ReadTransactionID(r io.Reader, txid *iotago.TransactionID) error
func Same ¶ added in v1.0.3
Checks two slices, if they represent the same sets (same elements, maybe a different order).
func SelectDeterministicRandomUint16 ¶ added in v0.2.0
func SliceShortString ¶ added in v1.0.3
func SliceShortString[E ShortStringable](slice []E) string
func StringInList ¶ added in v0.2.0
func TerminateCmdWhenTestStops ¶ added in v0.3.0
func TimeOrNever ¶ added in v1.0.3
func Uint16From2Bytes ¶
func Uint16To2Bytes ¶
func Uint32From4Bytes ¶
func Uint32To4Bytes ¶
func Uint64From8Bytes ¶
func Uint64To8Bytes ¶
func Uint8From1Bytes ¶ added in v0.2.3
func Uint8To1Bytes ¶ added in v0.2.3
func ValidPermutation ¶
func WriteBytes16ToMarshalUtil ¶ added in v0.3.0
func WriteBytes16ToMarshalUtil(data []byte, mu *marshalutil.MarshalUtil)
func WriteBytes8ToMarshalUtil ¶ added in v0.3.0
func WriteBytes8ToMarshalUtil(data []byte, mu *marshalutil.MarshalUtil)
func WriteMarshaled ¶ added in v0.1.0
func WriteMarshaled(w io.Writer, val encoding.BinaryMarshaler) error
WriteMarshaled supports kyber.Point, kyber.Scalar and similar.
func WriteOutputID ¶ added in v0.3.0
Types ¶
type BitVector ¶ added in v0.3.0
func NewFixedSizeBitVector ¶ added in v0.3.0
func NewFixedSizeBitVectorFromMarshalUtil ¶ added in v0.3.0
func NewFixedSizeBitVectorFromMarshalUtil(mu *marshalutil.MarshalUtil) (BitVector, error)
type ComparableAddress ¶ added in v1.0.3
type ComparableAddress struct {
// contains filtered or unexported fields
}
func NewComparableAddress ¶ added in v1.0.3
func NewComparableAddress(address iotago.Address) *ComparableAddress
func (*ComparableAddress) Address ¶ added in v1.0.3
func (c *ComparableAddress) Address() iotago.Address
func (*ComparableAddress) Key ¶ added in v1.0.3
func (c *ComparableAddress) Key() string
func (*ComparableAddress) String ¶ added in v1.0.3
func (c *ComparableAddress) String() string
type ComparableString ¶ added in v1.0.3
type ComparableString string
func (ComparableString) Key ¶ added in v1.0.3
func (c ComparableString) Key() string
func (ComparableString) String ¶ added in v1.0.3
func (c ComparableString) String() string
type Permutation16 ¶
type Permutation16 struct {
// contains filtered or unexported fields
}
Permutation16 deterministic permutation of integers from 0 to size-1
func NewPermutation16 ¶
func NewPermutation16(size uint16, seedOptional ...int64) (*Permutation16, error)
Seed should be provided in tests only to obtain predicted test results. If used in production, the seed should not be set, because it will be generated using cryptographically secure random number generator. Unless the permutations must be exactly the same between different calls (probable from different nodes). In the latter case, the seed should be the same for all the calls which expect the same permutation. This function allways returns a permutation; error should be considered as a warning that permutation was seeded incorrectly.
func (*Permutation16) Current ¶
func (perm *Permutation16) Current() uint16
func (*Permutation16) ForEach ¶ added in v0.3.0
func (perm *Permutation16) ForEach(f func(i uint16) bool)
func (*Permutation16) GetArray ¶
func (perm *Permutation16) GetArray() []uint16
func (*Permutation16) Next ¶
func (perm *Permutation16) Next() uint16
func (*Permutation16) NextNoCycles ¶ added in v0.3.0
func (perm *Permutation16) NextNoCycles() uint16
If the whole permutation is obtained, reshuffles it to avoid cycles
func (*Permutation16) Shuffle ¶
func (perm *Permutation16) Shuffle() *Permutation16
type Ratio32 ¶ added in v0.3.0
type Ratio32 struct { A uint32 `json:"a" swagger:"min(0),required"` B uint32 `json:"b" swagger:"min(0),required"` }
Ratio32 represents a ratio (a:b) between two quantities, expressed as two uint32 values.
func Ratio32FromBytes ¶ added in v0.3.0
func Ratio32FromString ¶ added in v1.0.3
func (Ratio32) HasZeroComponent ¶ added in v1.0.3
func (*Ratio32) Set ¶ added in v0.3.0
Set is part of the pflag.Value interface. It accepts a string in the form "a:b".
type ShortStringable ¶ added in v1.0.3
type ShortStringable interface {
ShortString() string
}