Unverified Commit 75d3ffe5 authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #58 from ipfs/feat/decred-codec

Add Decred codecs
parents bd441bb4 8028fee0
...@@ -77,6 +77,8 @@ const ( ...@@ -77,6 +77,8 @@ const (
BitcoinTx = 0xb1 BitcoinTx = 0xb1
ZcashBlock = 0xc0 ZcashBlock = 0xc0
ZcashTx = 0xc1 ZcashTx = 0xc1
DecredBlock = 0xe0
DecredTx = 0xe1
) )
// Codecs maps the name of a codec to its type // Codecs maps the name of a codec to its type
...@@ -99,6 +101,8 @@ var Codecs = map[string]uint64{ ...@@ -99,6 +101,8 @@ var Codecs = map[string]uint64{
"bitcoin-tx": BitcoinTx, "bitcoin-tx": BitcoinTx,
"zcash-block": ZcashBlock, "zcash-block": ZcashBlock,
"zcash-tx": ZcashTx, "zcash-tx": ZcashTx,
"decred-block": DecredBlock,
"decred-tx": DecredTx,
} }
// CodecToStr maps the numeric codec to its name // CodecToStr maps the numeric codec to its name
...@@ -120,6 +124,8 @@ var CodecToStr = map[uint64]string{ ...@@ -120,6 +124,8 @@ var CodecToStr = map[uint64]string{
BitcoinTx: "bitcoin-tx", BitcoinTx: "bitcoin-tx",
ZcashBlock: "zcash-block", ZcashBlock: "zcash-block",
ZcashTx: "zcash-tx", ZcashTx: "zcash-tx",
DecredBlock: "decred-block",
DecredTx: "decred-tx",
} }
// NewCidV0 returns a Cid-wrapped multihash. // NewCidV0 returns a Cid-wrapped multihash.
......
...@@ -33,6 +33,8 @@ var tCodecs = map[uint64]string{ ...@@ -33,6 +33,8 @@ var tCodecs = map[uint64]string{
BitcoinTx: "bitcoin-tx", BitcoinTx: "bitcoin-tx",
ZcashBlock: "zcash-block", ZcashBlock: "zcash-block",
ZcashTx: "zcash-tx", ZcashTx: "zcash-tx",
DecredBlock: "decred-block",
DecredTx: "decred-tx",
} }
func assertEqual(t *testing.T, a, b *Cid) { func assertEqual(t *testing.T, a, b *Cid) {
......
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