Commit ec5ea817 authored by Kevin Atkinson's avatar Kevin Atkinson

gx update go-cid and fix code to use new Cid type

parent 517e9864
...@@ -19,7 +19,7 @@ var ErrWrongHash = errors.New("data did not match given hash") ...@@ -19,7 +19,7 @@ var ErrWrongHash = errors.New("data did not match given hash")
// Block provides abstraction for blocks implementations. // Block provides abstraction for blocks implementations.
type Block interface { type Block interface {
RawData() []byte RawData() []byte
Cid() *cid.Cid Cid() cid.Cid
String() string String() string
Loggable() map[string]interface{} Loggable() map[string]interface{}
} }
...@@ -27,7 +27,7 @@ type Block interface { ...@@ -27,7 +27,7 @@ type Block interface {
// A BasicBlock is a singular block of data in ipfs. It implements the Block // A BasicBlock is a singular block of data in ipfs. It implements the Block
// interface. // interface.
type BasicBlock struct { type BasicBlock struct {
cid *cid.Cid cid cid.Cid
data []byte data []byte
} }
...@@ -40,7 +40,7 @@ func NewBlock(data []byte) *BasicBlock { ...@@ -40,7 +40,7 @@ func NewBlock(data []byte) *BasicBlock {
// NewBlockWithCid creates a new block when the hash of the data // NewBlockWithCid creates a new block when the hash of the data
// is already known, this is used to save time in situations where // is already known, this is used to save time in situations where
// we are able to be confident that the data is correct. // 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 { if u.Debug {
chkc, err := c.Prefix().Sum(data) chkc, err := c.Prefix().Sum(data)
if err != nil { if err != nil {
...@@ -65,7 +65,7 @@ func (b *BasicBlock) RawData() []byte { ...@@ -65,7 +65,7 @@ func (b *BasicBlock) RawData() []byte {
} }
// Cid returns the content identifier of the block. // Cid returns the content identifier of the block.
func (b *BasicBlock) Cid() *cid.Cid { func (b *BasicBlock) Cid() cid.Cid {
return b.cid return b.cid
} }
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
"gxDependencies": [ "gxDependencies": [
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
"hash": "QmZFbDTY9jfSBms2MchvYM9oYRbAF19K7Pby47yDBfpPrb", "hash": "QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7",
"name": "go-cid", "name": "go-cid",
"version": "0.8.0" "version": "0.9.0"
}, },
{ {
"author": "multiformats", "author": "multiformats",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment