Skip to content

Commit

Permalink
gx update go-cid and fix code to use new Cid type
Browse files Browse the repository at this point in the history
This commit was moved from ipfs/go-block-format@ec5ea81
  • Loading branch information
kevina committed Sep 11, 2018
1 parent 0e9d930 commit d21f7ed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions block/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ 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{}
}

// 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
}

Expand All @@ -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 {
Expand All @@ -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
}

Expand Down

0 comments on commit d21f7ed

Please sign in to comment.