Documentation
¶
Overview ¶
Package vectors generates the golden vectors under testdata/vectors from the codec in internal/storerec. Every value is derived from fixed stand-ins (public test keys, hashes of labels for anything a client draws at random), so the files are reproducible byte for byte; every check the generator makes fails the run when it stops holding.
Index ¶
Constants ¶
const ( Bucket = "photos_qzvmkwerty" OtherBucket = "archive_tqpzmwxrvk" // Created is the vectors' fixed time, Unix milliseconds. Created = 1798761600000 )
The vectors' buckets; each suffix is a fixed example.
const ContentRule = "" /* 239-byte string literal not displayed */
ContentRule is how every proof vector's content is made, so that both codecs regenerate it: segment s (4,096 bytes) is 1,024 words of xorshift32 (x ^= x << 13; x ^= x >> 17; x ^= x << 5), little-endian, from the state x = (s * 0x9e3779b9 + 0x7f4a7c15) mod 2^32 (1 if that is 0), stepping before each word; the content is the segments in order, cut to its size.
Variables ¶
var ( Owner = party("owner", 0x61) Alice = party("alice", 0x62) Bob = party("bob", 0x63) Carol = party("carol", 0x64) Dave = party("dave", 0x65) Erin = party("erin", 0x66) Parties = []Party{Owner, Alice, Bob, Carol, Dave, Erin} )
The parties: the bucket's owner, a writer, two providers, a front and buyer, and a stranger.
Functions ¶
Types ¶
type Headers ¶
Headers is the test chain's block headers: a merkle root per height. It is the chain tracker the transaction vectors are admitted against.
func (Headers) CurrentHeight ¶
CurrentHeight is the highest height held.
type Party ¶
type Party struct {
Name string
Priv *ec.PrivateKey
}
Party is one public test identity: 32 bytes of one value as the private key. Never for real use.