Documentation ¶
Index ¶
- Variables
- func GenRandomCid() cid.Cid
- func GenRandomHash() Hash32
- func GenRandomHashes() []Hash32
- func GenRandomTransaction() *Transaction
- func GenRandomTransactionExt() *TransactionExt
- func GenRandomTransactionExts(min, max int) []TransactionExt
- func GenTestBlockHeaderWithExtra(extraBytes []byte) BlockHeader
- func GenTestModels()
- func SetUtil(u *util.Util)
- type TransactionNoSig
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 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.
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
Click to show internal directories.
Click to hide internal directories.