Skip to content

Commit

Permalink
blocks: rename errWrongHash to ErrWrongHash
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
  • Loading branch information
Kubuxu committed Aug 16, 2016
1 parent 7614cda commit bf963fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion blocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit bf963fc

Please sign in to comment.