cstesting

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package cstesting defines helpers to test Chainscripts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeMapID added in v0.2.0

func ChangeMapID(l *cs.Link) *cs.Link

ChangeMapID clones a link and randomly changes its map ID.

func ChangeState added in v0.2.0

func ChangeState(l *cs.Link) *cs.Link

ChangeState clones a link and randomly changes its state.

func Clone added in v0.2.0

func Clone(l *cs.Link) *cs.Link

Clone clones a link.

func CreateLink(process, mapID, prevLinkHash string, tags []string, priority float64) *cs.Link

CreateLink creates a minimal link.

func InvalidLinkWithProcess added in v0.2.0

func InvalidLinkWithProcess(process string) *cs.Link

InvalidLinkWithProcess creates a random invalid link.

func RandomBranch

func RandomBranch(parent *cs.Link) *cs.Link

RandomBranch appends a random link to a link.

func RandomEvidence added in v0.2.0

func RandomEvidence() *cs.Evidence

RandomEvidence creates a random evidence.

func RandomInterfaces added in v0.3.0

func RandomInterfaces() []interface{}

RandomInterfaces creates between zero and four random values of type string/float/bool. int type is not generated because of assertion failure on float/int interpretation

func RandomLink() *cs.Link

RandomLink creates a random link.

func RandomLinkWithProcess added in v0.2.0

func RandomLinkWithProcess(process string) *cs.Link

RandomLinkWithProcess creates a random link in a specific process.

func RandomSegment

func RandomSegment() *cs.Segment

RandomSegment creates a random segment.

func RandomSignature added in v0.3.0

func RandomSignature(l *cs.Link) *cs.Signature

RandomSignature returns an arbitrary signature from a generated key pair

func RandomTags

func RandomTags() []string

RandomTags creates between zero and four random tags.

func SignLink(l *cs.Link) *cs.Link

SignLink adds a signature to a link. The ed25519 signature algorithm is used.

func SignLinkWithKey added in v0.3.0

func SignLinkWithKey(l *cs.Link, priv crypto.PrivateKey) *cs.Link

SignLinkWithKey signs the link with the provided private key. The key must be an instance of ed25519.PrivateKey

func SignatureWithKey added in v0.3.0

func SignatureWithKey(l *cs.Link, priv crypto.PrivateKey) *cs.Signature

SignatureWithKey returns a signature of a link using the provided private key

Types

This section is empty.

Jump to

Keyboard shortcuts

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