From 628ab3426c18dd81ed08638f73dc84c655db43b5 Mon Sep 17 00:00:00 2001 From: Samuel Li Date: Sun, 7 Oct 2018 11:21:11 -0700 Subject: [PATCH 1/2] add codecs for Dash blocks, tx --- cid.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cid.go b/cid.go index cfcbcde..36901e5 100644 --- a/cid.go +++ b/cid.go @@ -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 @@ -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 @@ -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. From 3ec3578fe958268a8938be576c4560b85729c87c Mon Sep 17 00:00:00 2001 From: Samuel Li Date: Sun, 7 Oct 2018 11:44:18 -0700 Subject: [PATCH 2/2] add dash to codecs table --- cid_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cid_test.go b/cid_test.go index 1b1e9c4..c05acd6 100644 --- a/cid_test.go +++ b/cid_test.go @@ -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) {