MCPcopy Create free account
hub / github.com/SmartPool/smartpool-client / NewForTesting

Function NewForTesting

ethereum/ethash/ethash.go:512–518  ·  view source on GitHub ↗

NewForTesting creates a proof of work for use in unit tests. It uses a smaller DAG and cache size to keep test times low. DAG files are stored in a temporary directory. Nonces found by a testing instance are not verifiable with a regular-size cache.

()

Source from the content-addressed store, hash-verified

510// Nonces found by a testing instance are not verifiable with a
511// regular-size cache.
512func NewForTesting() (*Ethash, error) {
513 dir, err := ioutil.TempDir("", "ethash-test")
514 if err != nil {
515 return nil, err
516 }
517 return &Ethash{&Light{test: true}, &Full{Dir: dir, test: true}}, nil
518}
519
520func GetSeedHash(blockNum uint64) ([]byte, error) {
521 if blockNum >= epochLength*2048 {

Callers 3

Calls

no outgoing calls

Tested by 3