mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-30 11:13:12 +00:00
cleanup imports after rebase, fix toJson
This commit is contained in:
parent
34c4fb07fe
commit
c1e5d0e9c2
@ -32,6 +32,7 @@ import ../node
|
||||
import ../blocktype
|
||||
import ../conf
|
||||
import ../contracts
|
||||
import ../manifest
|
||||
import ../streams/asyncstreamwrapper
|
||||
|
||||
import ./coders
|
||||
|
||||
@ -6,7 +6,6 @@ import pkg/codexdht/discv5/routing_table as rt
|
||||
import ../sales
|
||||
import ../purchasing
|
||||
import ../utils/json
|
||||
import ../units
|
||||
import ../manifest
|
||||
|
||||
export json
|
||||
|
||||
@ -28,7 +28,7 @@ push: {.upraises: [].}
|
||||
|
||||
import std/typetraits
|
||||
import pkg/chronos
|
||||
import pkg/chronicles
|
||||
import pkg/chronicles except toJson
|
||||
import pkg/datastore
|
||||
import pkg/nimcrypto
|
||||
import pkg/questionable
|
||||
|
||||
@ -303,18 +303,7 @@ func `%`*[T: distinct](id: T): JsonNode =
|
||||
type baseType = T.distinctBase
|
||||
% baseType(id)
|
||||
|
||||
func toJson*(obj: object): string = $(%obj)
|
||||
func toJson*(obj: ref object): string = $(%obj)
|
||||
|
||||
func toJson*[T: object](elements: openArray[T]): string =
|
||||
let jObj = newJArray()
|
||||
for elem in elements: jObj.add(%elem)
|
||||
$jObj
|
||||
|
||||
func toJson*[T: ref object](elements: openArray[T]): string =
|
||||
let jObj = newJArray()
|
||||
for elem in elements: jObj.add(%elem)
|
||||
$jObj
|
||||
func toJson*[T](item: T): string = $(%item)
|
||||
|
||||
proc toJsnImpl(x: NimNode): NimNode =
|
||||
case x.kind
|
||||
|
||||
@ -3,7 +3,7 @@ import std/options
|
||||
import std/strformat
|
||||
import std/strutils
|
||||
import std/unittest
|
||||
import pkg/chronicles
|
||||
import pkg/chronicles except toJson
|
||||
import pkg/stew/byteutils
|
||||
import pkg/stint
|
||||
import pkg/codex/contracts/requests
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user