Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-block-format
Commits
bf963fc3
Commit
bf963fc3
authored
Aug 16, 2016
by
Jakub Sztandera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blocks: rename errWrongHash to ErrWrongHash
License: MIT Signed-off-by:
Jakub Sztandera
<
kubuxu@protonmail.ch
>
parent
7614cdad
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
blocks.go
blocks.go
+2
-2
blocks_test.go
blocks_test.go
+1
-1
No files found.
blocks.go
View file @
bf963fc3
...
@@ -11,7 +11,7 @@ import (
...
@@ -11,7 +11,7 @@ import (
u
"gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util"
u
"gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util"
)
)
var
e
rrWrongHash
=
errors
.
New
(
"Data did not match given hash!"
)
var
E
rrWrongHash
=
errors
.
New
(
"Data did not match given hash!"
)
type
Block
interface
{
type
Block
interface
{
Multihash
()
mh
.
Multihash
Multihash
()
mh
.
Multihash
...
@@ -39,7 +39,7 @@ func NewBlockWithHash(data []byte, h mh.Multihash) (*BasicBlock, error) {
...
@@ -39,7 +39,7 @@ func NewBlockWithHash(data []byte, h mh.Multihash) (*BasicBlock, error) {
if
u
.
Debug
{
if
u
.
Debug
{
chk
:=
u
.
Hash
(
data
)
chk
:=
u
.
Hash
(
data
)
if
string
(
chk
)
!=
string
(
h
)
{
if
string
(
chk
)
!=
string
(
h
)
{
return
nil
,
e
rrWrongHash
return
nil
,
E
rrWrongHash
}
}
}
}
return
&
BasicBlock
{
data
:
data
,
multihash
:
h
},
nil
return
&
BasicBlock
{
data
:
data
,
multihash
:
h
},
nil
...
...
blocks_test.go
View file @
bf963fc3
...
@@ -89,7 +89,7 @@ func TestManualHash(t *testing.T) {
...
@@ -89,7 +89,7 @@ func TestManualHash(t *testing.T) {
u
.
Debug
=
true
u
.
Debug
=
true
block
,
err
=
NewBlockWithHash
(
data
,
hash
)
block
,
err
=
NewBlockWithHash
(
data
,
hash
)
if
err
!=
e
rrWrongHash
{
if
err
!=
E
rrWrongHash
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment