Use nph v0.6.0 in nimble format and run format on project. (#66)

This commit is contained in:
web3-developer 2024-07-22 21:05:02 +08:00 committed by GitHub
parent 9a6d85e8da
commit 608d10a24e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 18 additions and 34 deletions

View File

@ -21,7 +21,7 @@ jobs:
# Updating nph version should be accompanied with running the new
# version on the project directory.
run: |
VERSION="v0.5.1"
VERSION="v0.6.0"
ARCHIVE="nph-linux_x64.tar.gz"
curl -L "https://github.com/arnetheduck/nph/releases/download/${VERSION}/${ARCHIVE}" -o ${ARCHIVE}
tar -xzf ${ARCHIVE}

View File

@ -14,7 +14,7 @@ requires "nim >= 1.6", "results", "tempfile", "unittest2"
task format, "Format nim code using nph":
# Using the latest nph commit for now because the latest tagged version
# doesn't work with the latest nim 2 version
exec "nimble install nph@#head"
exec "nimble install nph@0.6.0"
exec "nph ."
task clean, "Remove temporary files":

View File

@ -330,8 +330,7 @@ proc keyExists*(
db.get(
key,
proc(data: openArray[byte]) =
discard
,
discard,
cfHandle,
)

View File

@ -41,14 +41,12 @@ suite "ColFamily Tests":
check cf.get(
key,
proc(data: openArray[byte]) =
bytes = @data
,
bytes = @data,
)[]
check not cf.get(
otherKey,
proc(data: openArray[byte]) =
bytes = @data
,
bytes = @data,
)[]
var r1 = cf.get(key)

View File

@ -40,14 +40,12 @@ suite "RocksDbRef Tests":
check db.get(
key,
proc(data: openArray[byte]) =
bytes = @data
,
bytes = @data,
)[]
check not db.get(
otherKey,
proc(data: openArray[byte]) =
bytes = @data
,
bytes = @data,
)[]
var r1 = db.get(key)
@ -97,15 +95,13 @@ suite "RocksDbRef Tests":
check db.get(
key,
proc(data: openArray[byte]) =
bytes = @data
,
bytes = @data,
defaultCfHandle,
)[]
check not db.get(
otherKey,
proc(data: openArray[byte]) =
bytes = @data
,
bytes = @data,
defaultCfHandle,
)[]
@ -159,15 +155,13 @@ suite "RocksDbRef Tests":
check db.get(
key,
proc(data: openArray[byte]) =
bytes = @data
,
bytes = @data,
defaultCfHandle,
)[]
check not db.get(
otherKey,
proc(data: openArray[byte]) =
bytes = @data
,
bytes = @data,
defaultCfHandle,
)[]
@ -175,15 +169,13 @@ suite "RocksDbRef Tests":
check db.get(
otherKey,
proc(data: openArray[byte]) =
bytes2 = @data
,
bytes2 = @data,
otherCfHandle,
)[]
check not db.get(
key,
proc(data: openArray[byte]) =
bytes2 = @data
,
bytes2 = @data,
otherCfHandle,
)[]
@ -259,8 +251,7 @@ suite "RocksDbRef Tests":
let r = db.get(
key1,
proc(data: openArray[byte]) =
v = @data
,
v = @data,
)
check:
r.isOk()
@ -273,8 +264,7 @@ suite "RocksDbRef Tests":
let r = db.get(
key2,
proc(data: openArray[byte]) =
v = @data
,
v = @data,
)
check:
r.isOk()
@ -287,8 +277,7 @@ suite "RocksDbRef Tests":
let r = db.get(
key3,
proc(data: openArray[byte]) =
v = @data
,
v = @data,
)
check:
r.isOk()
@ -301,8 +290,7 @@ suite "RocksDbRef Tests":
let r = db.get(
key4,
proc(data: openArray[byte]) =
v = @data
,
v = @data,
)
check:
r.isOk()
@ -315,8 +303,7 @@ suite "RocksDbRef Tests":
let r = db.get(
key5,
proc(data: openArray[byte]) =
v = @data
,
v = @data,
)
check:
r.isOk()