tpkg

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 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 OneInputOutputTransaction

func OneInputOutputTransaction() *iotago.Transaction

OneInputOutputTransaction generates a random transaction with one input and output.

func Rand32ByteArray

func Rand32ByteArray() [32]byte

Rand32ByteArray returns an array with 32 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 RandBytes

func RandBytes(length int) []byte

RandBytes returns length amount random bytes.

func RandEd25519Address

func RandEd25519Address() (*iotago.Ed25519Address, []byte)

RandEd25519Address returns a random Ed25519 address.

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, []byte)

RandEd25519Signature returns a random Ed25519 signature.

func RandEd25519SignatureUnlockBlock

func RandEd25519SignatureUnlockBlock() (*iotago.SignatureUnlockBlock, []byte)

RandEd25519SignatureUnlockBlock returns a random Ed25519 signature unlock block.

func RandIndexation

func RandIndexation(dataLength ...int) (*iotago.Indexation, []byte)

RandIndexation returns a random indexation payload.

func RandMessage

func RandMessage(withPayloadType uint32) (*iotago.Message, []byte)

RandMessage returns a random message with the given inner payload.

func RandMigratedFundsEntry

func RandMigratedFundsEntry() (*iotago.MigratedFundsEntry, []byte)

RandMigratedFundsEntry returns a random migrated funds entry.

func RandMilestone

func RandMilestone(parents iotago.MessageIDs) (*iotago.Milestone, []byte)

RandMilestone returns a random milestone with the given parent messages.

func RandMilestoneSig

func RandMilestoneSig() [iotago.MilestoneSignatureLength]byte

RandMilestoneSig returns a random milestone signature.

func RandReceipt

func RandReceipt() (*iotago.Receipt, []byte)

RandReceipt returns a random receipt.

func RandReferenceUnlockBlock

func RandReferenceUnlockBlock() (*iotago.ReferenceUnlockBlock, []byte)

RandReferenceUnlockBlock returns a random reference unlock block.

func RandSigLockedSingleOutput

func RandSigLockedSingleOutput(addrType iotago.AddressType) (*iotago.SigLockedSingleOutput, []byte)

RandSigLockedSingleOutput returns a random signature locked single output.

func RandTransaction

func RandTransaction() (*iotago.Transaction, []byte)

RandTransaction returns a random transaction.

func RandTransactionEssence

func RandTransactionEssence() (*iotago.TransactionEssence, []byte)

RandTransactionEssence returns a random transaction essence.

func RandTreasuryInput

func RandTreasuryInput() (*iotago.TreasuryInput, []byte)

RandTreasuryInput returns a random treasury input.

func RandTreasuryOutput

func RandTreasuryOutput() (*iotago.TreasuryOutput, []byte)

RandTreasuryOutput returns a random treasury output.

func RandTreasuryTransaction

func RandTreasuryTransaction() (*iotago.TreasuryTransaction, []byte)

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, []byte)

RandUTXOInput returns a random UTXO input.

func ReferenceUnlockBlock

func ReferenceUnlockBlock(index uint16) (*iotago.ReferenceUnlockBlock, []byte)

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 added in v2.0.1

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 added in v2.0.1

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

MarshalText implements the encoding.TextMarshaler interface.

func (HexBytes) String added in v2.0.1

func (b HexBytes) String() string

String returns the hex encoding of b.

func (*HexBytes) UnmarshalText added in v2.0.1

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