test

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Mrsh marsha.Marsha = cborgen.New()
	Crpt               = factory.MustNew(crpt.Ed25519, crypto.SHA3_256)
	Util               = util.New(Mrsh, Crpt)
)
View Source
var (
	TestPublicKey       crpt.PublicKey
	TestPrivateKey      crpt.PrivateKey
	TestAddress         crpt.Address
	TestSignature       Signature
	TestTransaction     Transaction
	TestTransactionHash TransactionHash
	TestTransactions    Transactions
	TestBlockHeader     BlockHeader

	TestHash = Hash32{
		0x1, 0x2, 0x3, 0x4, 0x1, 0x2, 0x3, 0x4, 0x1, 0x2, 0x3, 0x4, 0x1, 0x2, 0x3, 0x4,
		0x1, 0x2, 0x3, 0x4, 0x1, 0x2, 0x3, 0x4, 0x1, 0x2, 0x3, 0x4, 0x1, 0x2, 0x3, 0x4,
	}
	TestHash2 = Hash32{
		0x5, 0x6, 0x7, 0x8, 0x5, 0x6, 0x7, 0x8, 0x5, 0x6, 0x7, 0x8, 0x5, 0x6, 0x7, 0x8,
		0x5, 0x6, 0x7, 0x8, 0x5, 0x6, 0x7, 0x8, 0x5, 0x6, 0x7, 0x8, 0x5, 0x6, 0x7, 0x8,
	}
	TestBlockHash   = TestHash
	TestBlockHashes = make([]BlockHash, 1)
	TestAddress2    = Address(TestHash)
)

Functions

func GenRandomCid

func GenRandomCid() cid.Cid

GenRandomCid generates a random CID for test.

func GenRandomHash

func GenRandomHash() Hash32

GenRandomHash generates a random hash for test.

func GenRandomHashes

func GenRandomHashes() []Hash32

GenRandomHash generates random hashes for test.

func GenRandomTransaction

func GenRandomTransaction() *Transaction

GenRandomTransaction generates a random Transaction for test. NOTE: Sig is not a valid signature.

func GenRandomTransactionExt

func GenRandomTransactionExt() *TransactionExt

GenRandomTransactionExt generates a random TransactionExt for test.

func GenRandomTransactionExts

func GenRandomTransactionExts(min, max int) []TransactionExt

GenRandomTransactionExt generates random TransactionExts for test.

func GenTestBlockHeaderWithExtra

func GenTestBlockHeaderWithExtra(extraBytes []byte) BlockHeader

GenTestBlockHeaderWithExtra creates a BlockHeader for test with given Extra data.

func GenTestModels

func GenTestModels()

Gen test models

func SetUtil

func SetUtil(u *util.Util)

Types

type TransactionNoSig

type TransactionNoSig struct {
	Type  TransactionType
	From  Address
	Nonce uint64
	To    Address
	Data  []byte
	Extra []byte
}

func (*TransactionNoSig) InitNilEmbeddedStruct

func (t *TransactionNoSig) InitNilEmbeddedStruct()

func (*TransactionNoSig) MarshalCBOR

func (t *TransactionNoSig) MarshalCBOR(w io.Writer) error

func (TransactionNoSig) Ptr

func (t TransactionNoSig) Ptr() marsha.StructPtr

func (*TransactionNoSig) UnmarshalCBOR

func (t *TransactionNoSig) UnmarshalCBOR(r io.Reader) error

func (*TransactionNoSig) Val

func (p *TransactionNoSig) Val() marsha.Struct

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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