Documentation ¶
Index ¶
- Constants
- Variables
- func Must(err error)
- func OneInputOutputTransaction() *iotago.Transaction
- func Rand12ByteArray() [12]byte
- func Rand32ByteArray() [32]byte
- func Rand38ByteArray() [38]byte
- func Rand49ByteArray() [49]byte
- func Rand50ByteArray() [50]byte
- func Rand64ByteArray() [64]byte
- func RandAliasAddress() *iotago.AliasAddress
- func RandAliasUnlock() *iotago.AliasUnlock
- func RandBasicOutput(addrType iotago.AddressType) *iotago.BasicOutput
- func RandBlock(withPayloadType iotago.PayloadType) *iotago.Block
- func RandByte() byte
- func RandBytes(length int) []byte
- func RandEd25519Address() *iotago.Ed25519Address
- func RandEd25519Identity() (ed25519.PrivateKey, *iotago.Ed25519Address, iotago.AddressKeys)
- func RandEd25519PrivateKey() ed25519.PrivateKey
- func RandEd25519Seed() [ed25519.SeedSize]byte
- func RandEd25519Signature() *iotago.Ed25519Signature
- func RandEd25519SignatureUnlock() *iotago.SignatureUnlock
- func RandFloat64(max float64) float64
- func RandMigratedFundsEntry() *iotago.MigratedFundsEntry
- func RandMilestone(parents iotago.BlockIDs) *iotago.Milestone
- func RandMilestoneID() iotago.MilestoneID
- func RandMilestoneMerkleProof() iotago.MilestoneMerkleProof
- func RandNFTAddress() *iotago.NFTAddress
- func RandNFTUnlock() *iotago.NFTUnlock
- func RandNativeToken() *iotago.NativeToken
- func RandOutputID(index uint16) iotago.OutputID
- func RandOutputIDs(count uint16) iotago.OutputIDs
- func RandProtocolParameters() *iotago.ProtocolParameters
- func RandReceipt() *iotago.ReceiptMilestoneOpt
- func RandReferenceUnlock() *iotago.ReferenceUnlock
- func RandRentStructure() *iotago.RentStructure
- func RandSortNativeTokens(count int) iotago.NativeTokens
- func RandString(length int) string
- func RandTaggedData(tag []byte, dataLength ...int) *iotago.TaggedData
- func RandTransaction() *iotago.Transaction
- func RandTransactionEssence() *iotago.TransactionEssence
- func RandTransactionEssenceWithInputCount(inputCount int) *iotago.TransactionEssence
- func RandTransactionEssenceWithInputOutputCount(inputCount int, outputCount int) *iotago.TransactionEssence
- func RandTransactionEssenceWithInputs(inputs iotago.Inputs) *iotago.TransactionEssence
- func RandTransactionEssenceWithOutputCount(outputCount int) *iotago.TransactionEssence
- func RandTransactionID() iotago.TransactionID
- func RandTransactionWithEssence(essence *iotago.TransactionEssence) *iotago.Transaction
- func RandTransactionWithInputCount(inputCount int) *iotago.Transaction
- func RandTransactionWithInputOutputCount(inputCount int, outputCount int) *iotago.Transaction
- func RandTransactionWithOutputCount(outputCount int) *iotago.Transaction
- func RandTreasuryInput() *iotago.TreasuryInput
- func RandTreasuryOutput() *iotago.TreasuryOutput
- func RandTreasuryTransaction() *iotago.TreasuryTransaction
- func RandTrytes(length int) trinary.Trytes
- func RandUTXOInput() *iotago.UTXOInput
- func RandUTXOInputWithIndex(index uint16) *iotago.UTXOInput
- func RandUint16(max uint16) uint16
- func RandUint256() *big.Int
- func RandUint32(max uint32) uint32
- func RandUint64(max uint64) uint64
- func RandUint8(max uint8) uint8
- func ReferenceUnlock(index uint16) *iotago.ReferenceUnlock
- func SortedRand32ByteArray(count int) [][32]byte
- func SortedRandBlockIDs(count int) iotago.BlockIDs
- type HexBytes
Constants ¶
const ( // TestTokenSupply is a test token supply constant. // Do not use this constant outside of unit tests, instead, query it via a node. TestTokenSupply = 2_779_530_283_277_761 // TestProtocolVersion is a dummy protocol version. // Do not use this constant outside of unit tests, instead, query it via a node. TestProtocolVersion = 2 )
Variables ¶
var TestNetworkID = TestProtoParas.NetworkID()
TestNetworkID is a test network ID.
var TestProtoParas = &iotago.ProtocolParameters{ Version: 2, NetworkName: "TestJungle", Bech32HRP: "tgl", MinPoWScore: 0, RentStructure: iotago.RentStructure{ VByteCost: 0, VBFactorData: 0, VBFactorKey: 0, }, TokenSupply: TestTokenSupply, }
TestProtoParas is an instance of iotago.ProtocolParameters for testing purposes. It contains a zero vbyte rent cost. Only use this var in testing. Do not modify or use outside unit tests.
Functions ¶
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 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 Rand50ByteArray ¶
func Rand50ByteArray() [50]byte
Rand50ByteArray returns an array with 38 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 RandAliasUnlock ¶
func RandAliasUnlock() *iotago.AliasUnlock
RandAliasUnlock returns a random alias unlock.
func RandBasicOutput ¶
func RandBasicOutput(addrType iotago.AddressType) *iotago.BasicOutput
RandBasicOutput returns a random basic output (with no features).
func RandBlock ¶
func RandBlock(withPayloadType iotago.PayloadType) *iotago.Block
RandBlock returns a random block with the given inner payload.
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 ¶
RandEd25519Seed returns a random Ed25519 seed.
func RandEd25519Signature ¶
func RandEd25519Signature() *iotago.Ed25519Signature
RandEd25519Signature returns a random Ed25519 signature.
func RandEd25519SignatureUnlock ¶
func RandEd25519SignatureUnlock() *iotago.SignatureUnlock
RandEd25519SignatureUnlock returns a random Ed25519 signature unlock.
func RandMigratedFundsEntry ¶
func RandMigratedFundsEntry() *iotago.MigratedFundsEntry
RandMigratedFundsEntry returns a random migrated funds entry.
func RandMilestone ¶
RandMilestone returns a random milestone with the given parent blocks.
func RandMilestoneID ¶
func RandMilestoneID() iotago.MilestoneID
RandMilestoneID produces a random milestone ID.
func RandMilestoneMerkleProof ¶
func RandMilestoneMerkleProof() iotago.MilestoneMerkleProof
RandMilestoneMerkleProof produces a random milestone merkle proof.
func RandNFTAddress ¶
func RandNFTAddress() *iotago.NFTAddress
RandNFTAddress returns a random NFTAddress.
func RandNFTUnlock ¶
RandNFTUnlock returns a random alias unlock.
func RandNativeToken ¶
func RandNativeToken() *iotago.NativeToken
RandNativeToken returns a random NativeToken.
func RandOutputID ¶
func RandOutputIDs ¶
func RandProtocolParameters ¶
func RandProtocolParameters() *iotago.ProtocolParameters
RandProtocolParameters produces random protocol parameters.
func RandReceipt ¶
func RandReceipt() *iotago.ReceiptMilestoneOpt
RandReceipt returns a random receipt.
func RandReferenceUnlock ¶
func RandReferenceUnlock() *iotago.ReferenceUnlock
RandReferenceUnlock returns a random reference unlock.
func RandRentStructure ¶
func RandRentStructure() *iotago.RentStructure
RandRentStructure produces random rent structure.
func RandSortNativeTokens ¶
func RandSortNativeTokens(count int) iotago.NativeTokens
RandSortNativeTokens returns count sorted NativeToken.
func RandString ¶
func RandTaggedData ¶
func RandTaggedData(tag []byte, dataLength ...int) *iotago.TaggedData
RandTaggedData returns a random tagged data payload.
func RandTransaction ¶
func RandTransaction() *iotago.Transaction
RandTransaction returns a random transaction.
func RandTransactionEssence ¶
func RandTransactionEssence() *iotago.TransactionEssence
RandTransactionEssence returns a random transaction essence.
func RandTransactionEssenceWithInputCount ¶
func RandTransactionEssenceWithInputCount(inputCount int) *iotago.TransactionEssence
RandTransactionEssenceWithInputCount returns a random transaction essence with a specific amount of inputs..
func RandTransactionEssenceWithInputOutputCount ¶
func RandTransactionEssenceWithInputOutputCount(inputCount int, outputCount int) *iotago.TransactionEssence
RandTransactionEssenceWithInputOutputCount returns a random transaction essence with a specific amount of inputs and outputs.
func RandTransactionEssenceWithInputs ¶
func RandTransactionEssenceWithInputs(inputs iotago.Inputs) *iotago.TransactionEssence
RandTransactionEssenceWithInputs returns a random transaction essence with a specific slice of inputs.
func RandTransactionEssenceWithOutputCount ¶
func RandTransactionEssenceWithOutputCount(outputCount int) *iotago.TransactionEssence
RandTransactionEssenceWithOutputCount returns a random transaction essence with a specific amount of outputs.
func RandTransactionID ¶
func RandTransactionID() iotago.TransactionID
func RandTransactionWithEssence ¶
func RandTransactionWithEssence(essence *iotago.TransactionEssence) *iotago.Transaction
RandTransactionWithEssence returns a random transaction with a specific essence.
func RandTransactionWithInputCount ¶
func RandTransactionWithInputCount(inputCount int) *iotago.Transaction
RandTransactionWithInputCount returns a random transaction with a specific amount of inputs.
func RandTransactionWithInputOutputCount ¶
func RandTransactionWithInputOutputCount(inputCount int, outputCount int) *iotago.Transaction
RandTransactionWithInputOutputCount returns a random transaction with a specific amount of inputs and outputs.
func RandTransactionWithOutputCount ¶
func RandTransactionWithOutputCount(outputCount int) *iotago.Transaction
RandTransactionWithOutputCount returns a random transaction with a specific amount of outputs.
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 ¶
RandTrytes returns length amount of random trytes.
func RandUTXOInput ¶
RandUTXOInput returns a random UTXO input.
func RandUTXOInputWithIndex ¶
RandUTXOInputWithIndex returns a random UTXO input with a specific index.
func RandUint256 ¶
func ReferenceUnlock ¶
func ReferenceUnlock(index uint16) *iotago.ReferenceUnlock
ReferenceUnlock returns a reference unlock with the given index.
func SortedRand32ByteArray ¶
SortedRand32ByteArray returns a count length slice of sorted 32 byte arrays.
func SortedRandBlockIDs ¶
SortedRandBlockIDs returns random block IDs.
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 ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*HexBytes) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.