Skip to content

Commit

Permalink
Merge pull request #78 from samli88/dash-codecs
Browse files Browse the repository at this point in the history
add codecs for Dash blocks, tx
  • Loading branch information
Stebalien authored Oct 23, 2018
2 parents 6e296c5 + 3ec3578 commit c9e99b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cid.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ const (
ZcashTx = 0xc1
DecredBlock = 0xe0
DecredTx = 0xe1
DashBlock = 0xf0
DashTx = 0xf1
)

// Codecs maps the name of a codec to its type
Expand All @@ -103,6 +105,8 @@ var Codecs = map[string]uint64{
"zcash-tx": ZcashTx,
"decred-block": DecredBlock,
"decred-tx": DecredTx,
"dash-block": DashBlock,
"dash-tx": DashTx,
}

// CodecToStr maps the numeric codec to its name
Expand All @@ -126,6 +130,8 @@ var CodecToStr = map[uint64]string{
ZcashTx: "zcash-tx",
DecredBlock: "decred-block",
DecredTx: "decred-tx",
DashBlock: "dash-block",
DashTx: "dash-tx",
}

// NewCidV0 returns a Cid-wrapped multihash.
Expand Down
2 changes: 2 additions & 0 deletions cid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ var tCodecs = map[uint64]string{
ZcashTx: "zcash-tx",
DecredBlock: "decred-block",
DecredTx: "decred-tx",
DashBlock: "dash-block",
DashTx: "dash-tx",
}

func assertEqual(t *testing.T, a, b Cid) {
Expand Down

0 comments on commit c9e99b3

Please sign in to comment.