From 3f1777738fd7c4620c49954ba2f482df511b8de7 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 28 May 2019 01:35:41 +0200 Subject: [PATCH] Add libp2p-key multicodec Context: https://github.com/multiformats/multicodec/issues/130 License: MIT Signed-off-by: Marcin Rataj --- _rsrch/cidiface/enums.go | 3 +++ cid.go | 2 ++ cid_test.go | 1 + 3 files changed, 6 insertions(+) diff --git a/_rsrch/cidiface/enums.go b/_rsrch/cidiface/enums.go index 53e3d47..6a1ef9b 100644 --- a/_rsrch/cidiface/enums.go +++ b/_rsrch/cidiface/enums.go @@ -8,6 +8,7 @@ const ( DagProtobuf = 0x70 DagCBOR = 0x71 + Libp2pKey = 0x72 GitRaw = 0x78 @@ -34,6 +35,7 @@ var Codecs = map[string]uint64{ "raw": Raw, "protobuf": DagProtobuf, "cbor": DagCBOR, + "libp2p-key": Libp2pKey, "git-raw": GitRaw, "eth-block": EthBlock, "eth-block-list": EthBlockList, @@ -57,6 +59,7 @@ var CodecToStr = map[uint64]string{ Raw: "raw", DagProtobuf: "protobuf", DagCBOR: "cbor", + Libp2pKey: "libp2p-key", GitRaw: "git-raw", EthBlock: "eth-block", EthBlockList: "eth-block-list", diff --git a/cid.go b/cid.go index 6b62d30..d88b661 100644 --- a/cid.go +++ b/cid.go @@ -62,6 +62,7 @@ const ( DagProtobuf = 0x70 DagCBOR = 0x71 + Libp2pKey = 0x72 GitRaw = 0x78 @@ -90,6 +91,7 @@ var Codecs = map[string]uint64{ "raw": Raw, "protobuf": DagProtobuf, "cbor": DagCBOR, + "libp2p-key": Libp2pKey, "git-raw": GitRaw, "eth-block": EthBlock, "eth-block-list": EthBlockList, diff --git a/cid_test.go b/cid_test.go index a1dae64..1c181f9 100644 --- a/cid_test.go +++ b/cid_test.go @@ -19,6 +19,7 @@ var tCodecs = map[uint64]string{ Raw: "raw", DagProtobuf: "protobuf", DagCBOR: "cbor", + Libp2pKey: "libp2p-key", GitRaw: "git-raw", EthBlock: "eth-block", EthBlockList: "eth-block-list",