Commit 06d2604d authored by Kevin Atkinson's avatar Kevin Atkinson

Use lookup table in go-multibase now that it is supported.

parent b2038702
...@@ -228,13 +228,11 @@ func fmtCid(fmtStr string, base mb.Encoding, cid *c.Cid) (string, error) { ...@@ -228,13 +228,11 @@ func fmtCid(fmtStr string, base mb.Encoding, cid *c.Cid) (string, error) {
} }
func baseToString(base mb.Encoding) string { func baseToString(base mb.Encoding) string {
// FIXME: Use lookup tables when they are added to go-multibase baseStr, ok := mb.EncodingToStr[base]
switch base { if !ok {
case mb.Base58BTC:
return "base58btc"
default:
return fmt.Sprintf("base?%c", base) return fmt.Sprintf("base?%c", base)
} }
return baseStr
} }
func codecToString(num uint64) string { func codecToString(num uint64) string {
......
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