tpkg

package
v3.0.0-...-305da2a Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Must

func Must(err error)

Must panics if the given error is not nil.

func MyNewFun

func MyNewFun()

func OneInputOutputTransaction

func OneInputOutputTransaction() *iotago.Transaction

OneInputOutputTransaction generates a random transaction with one input and output.

func Rand12ByteArray

func Rand12ByteArray() [12]byte

Rand12ByteArray returns an array with 12 random bytes.

func Rand20ByteArray

func Rand20ByteArray() [20]byte

Rand20ByteArray returns an array with 20 random bytes.

func Rand32ByteArray

func Rand32ByteArray() [32]byte

Rand32ByteArray returns an array with 32 random bytes.

func Rand38ByteArray

func Rand38ByteArray() [38]byte

Rand38ByteArray returns an array with 38 random bytes.

func Rand49ByteArray

func Rand49ByteArray() [49]byte

Rand49ByteArray returns an array with 49 random bytes.

func Rand64ByteArray

func Rand64ByteArray() [64]byte

Rand64ByteArray returns an array with 64 random bytes.

func RandAliasAddress

func RandAliasAddress() *iotago.AliasAddress

RandAliasAddress returns a random AliasAddress.

func RandAliasUnlockBlock

func RandAliasUnlockBlock() *iotago.AliasUnlockBlock

RandAliasUnlockBlock returns a random alias unlock block.

func RandBytes

func RandBytes(length int) []byte

RandBytes returns length amount random bytes.

func RandEd25519Address

func RandEd25519Address() *iotago.Ed25519Address

RandEd25519Address returns a random Ed25519 address.

func RandEd25519Identity

func RandEd25519Identity() (ed25519.PrivateKey, *iotago.Ed25519Address, iotago.AddressKeys)

RandEd25519Identity produces a random Ed25519 identity.

func RandEd25519PrivateKey

func RandEd25519PrivateKey() ed25519.PrivateKey

RandEd25519PrivateKey returns a random Ed25519 private key.

func RandEd25519Seed

func RandEd25519Seed() [ed25519.SeedSize]byte

RandEd25519Seed returns a random Ed25519 seed.

func RandEd25519Signature

func RandEd25519Signature() *iotago.Ed25519Signature

RandEd25519Signature returns a random Ed25519 signature.

func RandEd25519SignatureUnlockBlock

func RandEd25519SignatureUnlockBlock() *iotago.SignatureUnlockBlock

RandEd25519SignatureUnlockBlock returns a random Ed25519 signature unlock block.

func RandExtendedOutput

func RandExtendedOutput(addrType iotago.AddressType) *iotago.ExtendedOutput

RandExtendedOutput returns a random extended output (with no feature blocks).

func RandIndexation

func RandIndexation(dataLength ...int) *iotago.Indexation

RandIndexation returns a random indexation payload.

func RandMessage

func RandMessage(withPayloadType iotago.PayloadType) *iotago.Message

RandMessage returns a random message with the given inner payload.

func RandMigratedFundsEntry

func RandMigratedFundsEntry() *iotago.MigratedFundsEntry

RandMigratedFundsEntry returns a random migrated funds entry.

func RandMilestone

func RandMilestone(parents iotago.MessageIDs) *iotago.Milestone

RandMilestone returns a random milestone with the given parent messages.

func RandMilestoneSig

func RandMilestoneSig() [iotago.MilestoneSignatureLength]byte

RandMilestoneSig returns a random milestone signature.

func RandNFTAddress

func RandNFTAddress() *iotago.NFTAddress

RandNFTAddress returns a random NFTAddress.

func RandNFTUnlockBlock

func RandNFTUnlockBlock() *iotago.NFTUnlockBlock

RandNFTUnlockBlock returns a random alias unlock block.

func RandNativeToken

func RandNativeToken() *iotago.NativeToken

RandNativeToken returns a random NativeToken.

func RandOutputID

func RandOutputID(index uint16) iotago.OutputID

func RandOutputIDs

func RandOutputIDs(count uint16) iotago.OutputIDs

func RandReceipt

func RandReceipt() *iotago.Receipt

RandReceipt returns a random receipt.

func RandReferenceUnlockBlock

func RandReferenceUnlockBlock() *iotago.ReferenceUnlockBlock

RandReferenceUnlockBlock returns a random reference unlock block.

func RandSortNativeTokens

func RandSortNativeTokens(count int) iotago.NativeTokens

RandSortNativeTokens returns count sorted NativeToken.

func RandTransaction

func RandTransaction() *iotago.Transaction

RandTransaction returns a random transaction.

func RandTransactionEssence

func RandTransactionEssence() *iotago.TransactionEssence

RandTransactionEssence returns a random transaction essence.

func RandTreasuryInput

func RandTreasuryInput() *iotago.TreasuryInput

RandTreasuryInput returns a random treasury input.

func RandTreasuryOutput

func RandTreasuryOutput() *iotago.TreasuryOutput

RandTreasuryOutput returns a random treasury output.

func RandTreasuryTransaction

func RandTreasuryTransaction() *iotago.TreasuryTransaction

RandTreasuryTransaction returns a random treasury transaction.

func RandTrytes

func RandTrytes(length int) trinary.Trytes

RandTrytes returns length amount of random trytes.

func RandUTXOInput

func RandUTXOInput() *iotago.UTXOInput

RandUTXOInput returns a random UTXO input.

func RandUint256

func RandUint256() *big.Int

func ReferenceUnlockBlock

func ReferenceUnlockBlock(index uint16) *iotago.ReferenceUnlockBlock

ReferenceUnlockBlock returns a reference unlock block with the given index.

func SortedRand32BytArray

func SortedRand32BytArray(count int) [][32]byte

SortedRand32BytArray returns a count length slice of sorted 32 byte arrays.

Types

type HexBytes

type HexBytes []byte

HexBytes is a slice of bytes that marshals/unmarshals as a string in hexadecimal encoding. It is a simple utility to parse hex encoded test vectors.

func (HexBytes) MarshalText

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

MarshalText implements the encoding.TextMarshaler interface.

func (HexBytes) String

func (b HexBytes) String() string

String returns the hex encoding of b.

func (*HexBytes) UnmarshalText

func (b *HexBytes) UnmarshalText(text []byte) (err error)

UnmarshalText implements the encoding.TextUnmarshaler interface.

Jump to

Keyboard shortcuts

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