mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
swarm/storage: Simplify code, correct content hashing
This commit is contained in:
parent
f68e83683d
commit
3d92c93888
2 changed files with 10 additions and 0 deletions
|
|
@ -36,6 +36,7 @@ func NewENSValidator(contractaddress common.Address, backend bind.ContractBacken
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
validator.hashlength = len(ens.EnsNode(dbDirName).Bytes())
|
||||
return validator, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -333,6 +333,15 @@ func setupTest(contractbackend bind.ContractBackend, validator ResourceValidator
|
|||
}
|
||||
}
|
||||
|
||||
if validator == nil {
|
||||
// create a new signer, which creates the private key
|
||||
signer, err = newTestSigner()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
validator = NewGenericValidator(testHashFunc, signer.signContent)
|
||||
}
|
||||
|
||||
// temp datadir
|
||||
datadir, err = ioutil.TempDir("", "rh")
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue