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

View File

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

View File

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

View File

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

View File

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