Documentation ¶
Overview ¶
Package cstesting defines helpers to test Chainscripts.
Index ¶
- func ChangeMapID(l *cs.Link) *cs.Link
- func ChangeState(l *cs.Link) *cs.Link
- func Clone(l *cs.Link) *cs.Link
- func CreateLink(process, mapID, prevLinkHash string, tags []string, priority float64) *cs.Link
- func InvalidLinkWithProcess(process string) *cs.Link
- func RandomBranch(parent *cs.Link) *cs.Link
- func RandomEvidence() *cs.Evidence
- func RandomInterfaces() []interface{}
- func RandomLink() *cs.Link
- func RandomLinkWithProcess(process string) *cs.Link
- func RandomSegment() *cs.Segment
- func RandomSignature(l *cs.Link) *cs.Signature
- func RandomTags() []string
- func SignLink(l *cs.Link) *cs.Link
- func SignLinkWithKey(l *cs.Link, priv crypto.PrivateKey) *cs.Link
- func SignatureWithKey(l *cs.Link, priv crypto.PrivateKey) *cs.Signature
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeMapID ¶ added in v0.2.0
ChangeMapID clones a link and randomly changes its map ID.
func ChangeState ¶ added in v0.2.0
ChangeState clones a link and randomly changes its state.
func CreateLink ¶ added in v0.2.0
CreateLink creates a minimal link.
func InvalidLinkWithProcess ¶ added in v0.2.0
InvalidLinkWithProcess creates a random invalid link.
func RandomBranch ¶
RandomBranch appends a random link to a link.
func RandomEvidence ¶ added in v0.2.0
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 RandomLinkWithProcess ¶ added in v0.2.0
RandomLinkWithProcess creates a random link in a specific process.
func RandomSignature ¶ added in v0.3.0
RandomSignature returns an arbitrary signature from a generated key pair
func SignLink ¶ added in v0.3.0
SignLink adds a signature to a link. The ed25519 signature algorithm is used.
func SignLinkWithKey ¶ added in v0.3.0
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
SignatureWithKey returns a signature of a link using the provided private key
Types ¶
This section is empty.