mirror of
https://github.com/codex-storage/nim-codex.git
synced 2025-01-09 04:32:05 +00:00
7efa9177df
* extra utilities and tweaks * add atlas lock * update ignores * break build into it's own script * update url rules * base off codexdht's * compile fixes for Nim 1.6.14 * update submodules * convert mapFailure to procs to work around type resolution issues * add toml parser for multiaddress * change error type on keyutils * bump nimbus build to use 1.6.14 * update gitignore * adding new deps submodules * bump nim ci version * even more fixes * more libp2p changes * update keys * fix eventually function * adding coverage test file * move coverage to build.nims * use nimcache/coverage * move libp2p import for tests into helper.nim * remove named bin * bug fixes for networkpeers (from Dmitriy) --------- Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>
29 lines
714 B
Nim
29 lines
714 B
Nim
## Nim-Codex
|
|
## Copyright (c) 2022 Status Research & Development GmbH
|
|
## Licensed under either of
|
|
## * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
|
## * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
|
## at your option.
|
|
## This file may not be copied, modified, or distributed except according to
|
|
## those terms.
|
|
|
|
import std/strutils
|
|
|
|
import pkg/chronicles
|
|
import pkg/libp2p/cid
|
|
|
|
func shortLog*(cid: Cid): string =
|
|
## Returns compact string representation of ``pid``.
|
|
var scid = $cid
|
|
if len(scid) > 10:
|
|
scid[3] = '*'
|
|
|
|
when (NimMajor, NimMinor) > (1, 4):
|
|
scid.delete(4 .. scid.high - 6)
|
|
else:
|
|
scid.delete(4, scid.high - 6)
|
|
|
|
scid
|
|
|
|
chronicles.formatIt(Cid): shortLog(it)
|