mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-23 11:27:42 +08:00
blocks: rename errWrongHash to ErrWrongHash
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
parent
68d5197265
commit
2408f866c5
@ -11,7 +11,7 @@ import (
|
||||
u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util"
|
||||
)
|
||||
|
||||
var errWrongHash = errors.New("Data did not match given hash!")
|
||||
var ErrWrongHash = errors.New("Data did not match given hash!")
|
||||
|
||||
type Block interface {
|
||||
Multihash() mh.Multihash
|
||||
@ -39,7 +39,7 @@ func NewBlockWithHash(data []byte, h mh.Multihash) (*BasicBlock, error) {
|
||||
if u.Debug {
|
||||
chk := u.Hash(data)
|
||||
if string(chk) != string(h) {
|
||||
return nil, errWrongHash
|
||||
return nil, ErrWrongHash
|
||||
}
|
||||
}
|
||||
return &BasicBlock{data: data, multihash: h}, nil
|
||||
|
||||
@ -89,7 +89,7 @@ func TestManualHash(t *testing.T) {
|
||||
u.Debug = true
|
||||
|
||||
block, err = NewBlockWithHash(data, hash)
|
||||
if err != errWrongHash {
|
||||
if err != ErrWrongHash {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user