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

Function TestGetSeedHash

ethereum/ethash/ethash_test.go:197–222  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

195}
196
197func TestGetSeedHash(t *testing.T) {
198 seed0, err := GetSeedHash(0)
199 if err != nil {
200 t.Errorf("Failed to get seedHash for block 0: %v", err)
201 }
202 if bytes.Compare(seed0, make([]byte, 32)) != 0 {
203 log.Printf("seedHash for block 0 should be 0s, was: %v\n", seed0)
204 }
205 seed1, err := GetSeedHash(30000)
206 if err != nil {
207 t.Error(err)
208 }
209
210 // From python:
211 // > from pyethash import get_seedhash
212 // > get_seedhash(30000)
213 expectedSeed1, err := hex.DecodeString("290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563")
214 if err != nil {
215 t.Error(err)
216 }
217
218 if bytes.Compare(seed1, expectedSeed1) != 0 {
219 log.Printf("seedHash for block 1 should be: %v,\nactual value: %v\n", expectedSeed1, seed1)
220 }
221
222}

Callers

nothing calls this directly

Calls 2

GetSeedHashFunction · 0.85
PrintfMethod · 0.65

Tested by

no test coverage detected