From 608d10a24e66836210cb118e84e69739296ff8f5 Mon Sep 17 00:00:00 2001 From: web3-developer <51288821+web3-developer@users.noreply.github.com> Date: Mon, 22 Jul 2024 21:05:02 +0800 Subject: [PATCH] Use nph v0.6.0 in nimble format and run format on project. (#66) --- .github/workflows/ci.yml | 2 +- rocksdb.nimble | 2 +- rocksdb/rocksdb.nim | 3 +-- tests/test_columnfamily.nim | 6 ++---- tests/test_rocksdb.nim | 39 +++++++++++++------------------------ 5 files changed, 18 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 676ca28..2e9bfd0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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} diff --git a/rocksdb.nimble b/rocksdb.nimble index 684ecd6..c24596d 100644 --- a/rocksdb.nimble +++ b/rocksdb.nimble @@ -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": diff --git a/rocksdb/rocksdb.nim b/rocksdb/rocksdb.nim index 3fcb63a..879a7f0 100644 --- a/rocksdb/rocksdb.nim +++ b/rocksdb/rocksdb.nim @@ -330,8 +330,7 @@ proc keyExists*( db.get( key, proc(data: openArray[byte]) = - discard - , + discard, cfHandle, ) diff --git a/tests/test_columnfamily.nim b/tests/test_columnfamily.nim index 326e0d1..671908d 100644 --- a/tests/test_columnfamily.nim +++ b/tests/test_columnfamily.nim @@ -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) diff --git a/tests/test_rocksdb.nim b/tests/test_rocksdb.nim index 28bef1c..21cbde9 100644 --- a/tests/test_rocksdb.nim +++ b/tests/test_rocksdb.nim @@ -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()