Skip to content

add codecs for Dash blocks, tx #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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