Skip to content

Commit 68090a8

Browse files
committed
Revert "fix: bring back, but deprecate CodecToStr and Codecs"
This reverts commit 548365f.
1 parent 69784e9 commit 68090a8

File tree

4 files changed

+0
-60
lines changed

4 files changed

+0
-60
lines changed

cid.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
"strings"
3131

3232
mbase "github.com/multiformats/go-multibase"
33-
"github.com/multiformats/go-multicodec"
3433
mh "github.com/multiformats/go-multihash"
3534
varint "github.com/multiformats/go-varint"
3635
)
@@ -84,25 +83,6 @@ const (
8483
FilCommitmentSealed = 0xf102
8584
)
8685

87-
// Codecs maps the name of a codec to its type
88-
// Deprecated: modern code should use consts from go-multicodec instead:
89-
// <https://github.com/multiformats/go-multicodec>
90-
var Codecs map[string]uint64
91-
92-
// CodecToStr maps the numeric codec to its name
93-
// Deprecated: modern code should use consts from go-multicodec instead:
94-
// <https://github.com/multiformats/go-multicodec>
95-
var CodecToStr map[uint64]string
96-
97-
func init() {
98-
Codecs = make(map[string]uint64)
99-
CodecToStr = make(map[uint64]string)
100-
for _, code := range multicodec.KnownCodes() {
101-
Codecs[code.String()] = uint64(code)
102-
CodecToStr[uint64(code)] = code.String()
103-
}
104-
}
105-
10686
// tryNewCidV0 tries to convert a multihash into a CIDv0 CID and returns an
10787
// error on failure.
10888
func tryNewCidV0(mhash mh.Multihash) (Cid, error) {

cid_test.go

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -29,43 +29,6 @@ func assertEqual(t *testing.T, a, b Cid) {
2929
}
3030
}
3131

32-
func TestTable(t *testing.T) {
33-
// test some known codecs, hard-wired here to make them a fixture that would
34-
// need to be updated if they change elsewhere
35-
for k, v := range map[uint64]string{
36-
Raw: "raw",
37-
DagProtobuf: "dag-pb",
38-
DagCBOR: "dag-cbor",
39-
DagJSON: "dag-json",
40-
Libp2pKey: "libp2p-key",
41-
GitRaw: "git-raw",
42-
EthBlock: "eth-block",
43-
EthBlockList: "eth-block-list",
44-
EthTxTrie: "eth-tx-trie",
45-
EthTx: "eth-tx",
46-
EthTxReceiptTrie: "eth-tx-receipt-trie",
47-
EthTxReceipt: "eth-tx-receipt",
48-
EthStateTrie: "eth-state-trie",
49-
EthAccountSnapshot: "eth-account-snapshot",
50-
EthStorageTrie: "eth-storage-trie",
51-
BitcoinBlock: "bitcoin-block",
52-
BitcoinTx: "bitcoin-tx",
53-
ZcashBlock: "zcash-block",
54-
ZcashTx: "zcash-tx",
55-
DecredBlock: "decred-block",
56-
DecredTx: "decred-tx",
57-
DashBlock: "dash-block",
58-
DashTx: "dash-tx",
59-
FilCommitmentUnsealed: "fil-commitment-unsealed",
60-
FilCommitmentSealed: "fil-commitment-sealed",
61-
DagJOSE: "dag-jose",
62-
} {
63-
if Codecs[v] != k {
64-
t.Errorf("Table mismatch: 0x%x %s", k, v)
65-
}
66-
}
67-
}
68-
6932
func TestPrefixSum(t *testing.T) {
7033
// Test creating CIDs both manually and with Prefix.
7134
// Tests: https://github.com/ipfs/go-cid/issues/83

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ module github.com/ipfs/go-cid
22

33
require (
44
github.com/multiformats/go-multibase v0.0.3
5-
github.com/multiformats/go-multicodec v0.5.0
65
github.com/multiformats/go-multihash v0.0.15
76
github.com/multiformats/go-varint v0.0.6
87
)

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ8
1313
github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM=
1414
github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk=
1515
github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc=
16-
github.com/multiformats/go-multicodec v0.5.0 h1:EgU6cBe/D7WRwQb1KmnBvU7lrcFGMggZVTPtOW9dDHs=
17-
github.com/multiformats/go-multicodec v0.5.0/go.mod h1:DiY2HFaEp5EhEXb/iYzVAunmyX/aSFMxq2KMKfWEues=
1816
github.com/multiformats/go-multihash v0.0.15 h1:hWOPdrNqDjwHDx82vsYGSDZNyktOJJ2dzZJzFkOV1jM=
1917
github.com/multiformats/go-multihash v0.0.15/go.mod h1:D6aZrWNLFTV/ynMpKsNtB40mJzmCl4jb1alC0OvHiHg=
2018
github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY=

0 commit comments

Comments
 (0)