Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SignerPrivKey = "e0aa6db5a833531da4d259fb5df210bae481b276dc4c2ab6ab9771569375aed5" // NewVoteHardcoded needs to be a constructor, since multiple tests will // modify its value. We need a different pointer for each test. NewVoteHardcoded = func() *state.Vote { vp, _ := base64.StdEncoding.DecodeString("eyJ0eXBlIjoicG9sbC12b3RlIiwibm9uY2UiOiI1NTkyZjFjMThlMmExNTk1M2YzNTVjMzRiMjQ3ZDc1MWRhMzA3MzM4Yzk5NDAwMGI5YTY1ZGIxZGMxNGNjNmMwIiwidm90ZXMiOlsxLDIsMV19") return &state.Vote{ ProcessID: testutil.Hex2byte(nil, "e9d5e8d791f51179e218c606f83f5967ab272292a6dbda887853d81f7a1d5105"), Nullifier: testutil.Hex2byte(nil, "5592f1c18e2a15953f355c34b247d751da307338c994000b9a65db1dc14cc6c0"), VotePackage: vp, } } ProcessHardcoded = &models.Process{ ProcessId: testutil.Hex2byte(nil, "e9d5e8d791f51179e218c606f83f5967ab272292a6dbda887853d81f7a1d5105"), EntityId: testutil.Hex2byte(nil, "180dd5765d9f7ecef810b565a2e5bd14a3ccd536c442b3de74867df552855e85"), CensusRoot: testutil.Hex2byte(nil, "0a975f5cf517899e6116000fd366dc0feb34a2ea1b64e9b213278442dd9852fe"), CensusOrigin: models.CensusOrigin_OFF_CHAIN_TREE, BlockCount: 1000, EnvelopeType: &models.EnvelopeType{}, Mode: &models.ProcessMode{}, Status: models.ProcessStatus_READY, VoteOptions: &models.ProcessVoteOptions{MaxCount: 16, MaxValue: 16}, MaxCensusSize: 1000, } StateDBProcessHardcoded = &models.StateDBProcess{ Process: ProcessHardcoded, VotesRoot: make([]byte, 32), } )
Functions ¶
func NewMockIndexer ¶ added in v1.4.0
Types ¶
type APIserver ¶ added in v1.4.0
type APIserver struct { Account *ethereum.SignKeys ListenAddr *url.URL Storage data.Storage VochainAPP *vochain.BaseApplication Indexer *indexer.Indexer VochainInfo *vochaininfo.VochainInfo ChainID string }
APIserver contains all the required pieces for running a mock API server. It is used for testing purposes only. The server starts a Vochain instance, the Indexer, the IPFS storage and the API router. The blockchain is advanced by calling the APIserver.VochainAPP.AdvanceTestBlock() method.
Click to show internal directories.
Click to hide internal directories.