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
ec5ea817
Commit
ec5ea817
authored
Sep 05, 2018
by
Kevin Atkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gx update go-cid and fix code to use new Cid type
parent
517e9864
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
blocks.go
blocks.go
+4
-4
package.json
package.json
+2
-2
No files found.
blocks.go
View file @
ec5ea817
...
...
@@ -19,7 +19,7 @@ var ErrWrongHash = errors.New("data did not match given hash")
// Block provides abstraction for blocks implementations.
type
Block
interface
{
RawData
()
[]
byte
Cid
()
*
cid
.
Cid
Cid
()
cid
.
Cid
String
()
string
Loggable
()
map
[
string
]
interface
{}
}
...
...
@@ -27,7 +27,7 @@ type Block interface {
// A BasicBlock is a singular block of data in ipfs. It implements the Block
// interface.
type
BasicBlock
struct
{
cid
*
cid
.
Cid
cid
cid
.
Cid
data
[]
byte
}
...
...
@@ -40,7 +40,7 @@ func NewBlock(data []byte) *BasicBlock {
// NewBlockWithCid creates a new block when the hash of the data
// is already known, this is used to save time in situations where
// we are able to be confident that the data is correct.
func
NewBlockWithCid
(
data
[]
byte
,
c
*
cid
.
Cid
)
(
*
BasicBlock
,
error
)
{
func
NewBlockWithCid
(
data
[]
byte
,
c
cid
.
Cid
)
(
*
BasicBlock
,
error
)
{
if
u
.
Debug
{
chkc
,
err
:=
c
.
Prefix
()
.
Sum
(
data
)
if
err
!=
nil
{
...
...
@@ -65,7 +65,7 @@ func (b *BasicBlock) RawData() []byte {
}
// Cid returns the content identifier of the block.
func
(
b
*
BasicBlock
)
Cid
()
*
cid
.
Cid
{
func
(
b
*
BasicBlock
)
Cid
()
cid
.
Cid
{
return
b
.
cid
}
...
...
package.json
View file @
ec5ea817
...
...
@@ -9,9 +9,9 @@
"gxDependencies"
:
[
{
"author"
:
"whyrusleeping"
,
"hash"
:
"Qm
ZFbDTY9jfSBms2MchvYM9oYRbAF19K7Pby47yDBfpPrb
"
,
"hash"
:
"Qm
PSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7
"
,
"name"
:
"go-cid"
,
"version"
:
"0.
8
.0"
"version"
:
"0.
9
.0"
},
{
"author"
:
"multiformats"
,
...
...
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