From 89052f638d961e503ba09b51a420d1b4e9ad811a Mon Sep 17 00:00:00 2001 From: Arnaud Date: Wed, 18 Dec 2024 15:26:55 +0100 Subject: [PATCH 1/6] Update dependencies for Nim 2.x --- nimble.lock | 126 ++++++++++++++++++++++++++++++--------------------- nitro.nimble | 16 ++++--- 2 files changed, 84 insertions(+), 58 deletions(-) diff --git a/nimble.lock b/nimble.lock index b837775..69da998 100644 --- a/nimble.lock +++ b/nimble.lock @@ -1,74 +1,84 @@ { - "version": 1, + "version": 2, "packages": { - "upraises": { - "version": "0.1.0", - "vcsRevision": "ff4f8108e44fba9b35cac535ab63d3927e8fd3c2", - "url": "https://github.com/markspanbroek/upraises.git", + "results": { + "version": "0.5.0", + "vcsRevision": "57b2392ad69849e3e2d02b74a8a0feee2c3d9570", + "url": "https://github.com/arnetheduck/nim-results", "downloadMethod": "git", "dependencies": [], "checksums": { - "sha1": "a0243c8039e12d547dbb2e9c73789c16bb8bc956" + "sha1": "901e2ed088160fdcb8fdf3b315ce62baedc3f7ba" + } + }, + "unittest2": { + "version": "0.2.3", + "vcsRevision": "845b6af28b9f68f02d320e03ad18eccccea7ddb9", + "url": "https://github.com/status-im/nim-unittest2", + "downloadMethod": "git", + "dependencies": [], + "checksums": { + "sha1": "6936b4e4676c9b37537d93f31cb8fc46f4ebaacb" } }, "stew": { - "version": "0.1.0", - "vcsRevision": "6ad35b876fb6ebe0dfee0f697af173acc47906ee", - "url": "https://github.com/status-im/nim-stew.git", - "downloadMethod": "git", - "dependencies": [], - "checksums": { - "sha1": "46d58c4feb457f3241e3347778334e325dce5268" - } - }, - "nimcrypto": { - "version": "0.5.4", - "vcsRevision": "a5742a9a214ac33f91615f3862c7b099aec43b00", - "url": "https://github.com/cheatfate/nimcrypto", - "downloadMethod": "git", - "dependencies": [], - "checksums": { - "sha1": "f76c87707cd4e96355b8bb6ef27e7f8b0aac1e08" - } - }, - "secp256k1": { - "version": "0.5.2", - "vcsRevision": "5340cf188168d6afcafc8023770d880f067c0b2f", - "url": "https://github.com/status-im/nim-secp256k1.git", + "version": "0.2.0", + "vcsRevision": "79e4fa5a9d3374db17ed63622714d3e1094c7f34", + "url": "https://github.com/status-im/nim-stew", "downloadMethod": "git", "dependencies": [ - "stew", - "nimcrypto" + "results", + "unittest2" ], "checksums": { - "sha1": "ae9cbea4487be94a06653ffee075a7f1bd1e231e" - } - }, - "questionable": { - "version": "0.10.2", - "vcsRevision": "6018fd43e033d5a5310faa45bcaa1b44049469a4", - "url": "https://github.com/status-im/questionable.git", - "downloadMethod": "git", - "dependencies": [], - "checksums": { - "sha1": "36a6c012637c7736a390e74a7f94667bca562073" + "sha1": "26d477c735913b7daa1dab53dd74803c88209634" } }, "stint": { - "version": "0.0.1", - "vcsRevision": "036c71d06a6b22f8f967ba9d54afd2189c3872ca", - "url": "https://github.com/status-im/stint.git", + "version": "2.0.0", + "vcsRevision": "3236fa68394f1e3a06e2bc34218aacdd2d675923", + "url": "https://github.com/status-im/nim-stint", "downloadMethod": "git", "dependencies": [ "stew" ], "checksums": { - "sha1": "0f187a2115315ca898e5f9a30c5e506cf6057062" + "sha1": "50744885ee1c320675078b46520268bf3c3c5d81" + } + }, + "nimcrypto": { + "version": "0.6.2", + "vcsRevision": "dc07e3058c6904eef965394493b6ea99aa2adefc", + "url": "https://github.com/cheatfate/nimcrypto", + "downloadMethod": "git", + "dependencies": [], + "checksums": { + "sha1": "8e3e42530f54c8c312942a89640b7e0f687f33a5" + } + }, + "questionable": { + "version": "0.10.15", + "vcsRevision": "82d90b67bcfb7f2e918b61dace2ff1a4ced60935", + "url": "https://github.com/markspanbroek/questionable", + "downloadMethod": "git", + "dependencies": [], + "checksums": { + "sha1": "3238ff637c7b44d2fa8fcb839a8ded968e389de3" + } + }, + "upraises": { + "version": "0.1.0", + "vcsRevision": "d9f268db1021959fe0f2c7a5e49fba741f9932a0", + "url": "https://github.com/markspanbroek/upraises", + "downloadMethod": "git", + "dependencies": [], + "checksums": { + "sha1": "176234f808b44a0be763df706ed634d6e8df17bb" } }, "contractabi": { - "version": "0.4.5", - "vcsRevision": "df55276f1d7bed529cf8d423a5077ca8a2a2d4ca", + "version": "0.7.0", + "vcsRevision": "363f8b4852b05c089b1e35ef3a0a882d51c996bc", "url": "https://github.com/status-im/nim-contract-abi", "downloadMethod": "git", "dependencies": [ @@ -79,8 +89,22 @@ "upraises" ], "checksums": { - "sha1": "11387226c5e355e207f587382e3bcca1cc5cf687" + "sha1": "be9a6b1dc2dc3057f68a6e69f77eb6b873909b04" + } + }, + "secp256k1": { + "version": "0.6.0.3.2", + "vcsRevision": "e5f0ed8bc27d477b13c174d9c2768d2b0c41da07", + "url": "https://github.com/status-im/nim-secp256k1", + "downloadMethod": "git", + "dependencies": [ + "stew", + "nimcrypto" + ], + "checksums": { + "sha1": "6df5d2c8236d715553c9c2c66d568ceaf48c454a" } } - } -} \ No newline at end of file + }, + "tasks": {} +} diff --git a/nitro.nimble b/nitro.nimble index abf31fe..aeff825 100644 --- a/nitro.nimble +++ b/nitro.nimble @@ -3,11 +3,13 @@ author = "Nim Nitro developers" license = "MIT" description = "Nitro state channels" -requires "nim >= 1.2.6 & < 2.0.0" -requires "nimcrypto >= 0.5.4 & < 0.6.0" -requires "questionable >= 0.10.1 & < 0.11.0" +requires "nim >= 1.6.14" +requires "nimcrypto >= 0.6.0 & < 0.7.0" +requires "questionable >= 0.10.10 & < 0.11.0" requires "upraises >= 0.1.0 & < 0.2.0" -requires "contractabi >= 0.4.1 & < 0.5.0" -requires "secp256k1" -requires "stint" -requires "stew" +# Update to nim 2.0.x +# Avoid downloading stint 0.8.0 +requires "contractabi#363f8b4852b05c089b1e35ef3a0a882d51c996bc" +requires "secp256k1 >= 0.6.0" +requires "stint#3236fa68394f1e3a06e2bc34218aacdd2d675923" +requires "stew >= 0.2.0" From e3719433d5ace25947c468787c805969642b3913 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Wed, 18 Dec 2024 15:28:45 +0100 Subject: [PATCH 2/6] Update versions --- .github/workflows/ci.yml | 2 +- nitro.nimble | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c9e540..c79746e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - nim: [stable, 1.2.6] + nim: [stable, 1.6.14, 2.0.12] steps: - uses: actions/checkout@v2 - uses: iffy/install-nim@v3 diff --git a/nitro.nimble b/nitro.nimble index aeff825..b381aca 100644 --- a/nitro.nimble +++ b/nitro.nimble @@ -1,4 +1,4 @@ -version = "0.5.1" +version = "0.6.0" author = "Nim Nitro developers" license = "MIT" description = "Nitro state channels" From 9cbecdde205a82ed60a54d63dd6e4b8c507a668b Mon Sep 17 00:00:00 2001 From: Arnaud Date: Tue, 7 Jan 2025 11:37:03 +0100 Subject: [PATCH 3/6] Update to Nim 2.0.14 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c79746e..b488d16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - nim: [stable, 1.6.14, 2.0.12] + nim: [stable, 1.6.14, 2.0.14] steps: - uses: actions/checkout@v2 - uses: iffy/install-nim@v3 From f3879ed666930318a9ef7d030c5d03446b6f5e50 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Fri, 14 Feb 2025 10:55:38 +0100 Subject: [PATCH 4/6] Update dependencies and remove support to Nim 1.6 due to dependencies issue --- .github/workflows/ci.yml | 4 ++-- Readme.md | 8 ++++++++ nimble.lock | 25 +++++++++++++------------ nitro.nimble | 12 +++++------- 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b488d16..11ba4e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,13 +8,13 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - nim: [stable, 1.6.14, 2.0.14] + nim: [stable, 2.0.14] steps: - uses: actions/checkout@v2 - uses: iffy/install-nim@v3 with: version: ${{ matrix.nim }} - name: Build - run: nimble install -y + run: nimble install -y --maximumtaggedversions=2 - name: Test run: nimble test -y diff --git a/Readme.md b/Readme.md index 6df93d2..87774e4 100644 --- a/Readme.md +++ b/Readme.md @@ -10,3 +10,11 @@ References - [statechannels.org](https://statechannels.org/) - [Nitro paper](https://magmo.com/nitro-protocol.pdf) - [Nitro smart contracts & Javascript code](https://github.com/statechannels/statechannels/tree/master/packages/nitro-protocol) + +# Installation + +To avoid conflicts with previous versions of `contractabi`, use the following command to install dependencies: + +```bash +nimble install --maximumtaggedversions=2 +``` \ No newline at end of file diff --git a/nimble.lock b/nimble.lock index 69da998..6090a9f 100644 --- a/nimble.lock +++ b/nimble.lock @@ -2,13 +2,13 @@ "version": 2, "packages": { "results": { - "version": "0.5.0", - "vcsRevision": "57b2392ad69849e3e2d02b74a8a0feee2c3d9570", + "version": "0.5.1", + "vcsRevision": "df8113dda4c2d74d460a8fa98252b0b771bf1f27", "url": "https://github.com/arnetheduck/nim-results", "downloadMethod": "git", "dependencies": [], "checksums": { - "sha1": "901e2ed088160fdcb8fdf3b315ce62baedc3f7ba" + "sha1": "a9c011f74bc9ed5c91103917b9f382b12e82a9e7" } }, "unittest2": { @@ -35,15 +35,16 @@ } }, "stint": { - "version": "2.0.0", - "vcsRevision": "3236fa68394f1e3a06e2bc34218aacdd2d675923", + "version": "0.8.1", + "vcsRevision": "1a2c661e3f50ff696b0b6692fab0d7bb2abf10cc", "url": "https://github.com/status-im/nim-stint", "downloadMethod": "git", "dependencies": [ - "stew" + "stew", + "unittest2" ], "checksums": { - "sha1": "50744885ee1c320675078b46520268bf3c3c5d81" + "sha1": "fe3c8b7b0484135294b8fb3dab5b1a030a08bddc" } }, "nimcrypto": { @@ -77,8 +78,8 @@ } }, "contractabi": { - "version": "0.7.0", - "vcsRevision": "363f8b4852b05c089b1e35ef3a0a882d51c996bc", + "version": "0.7.1", + "vcsRevision": "524bda044baecdf1ead4f179bdad2b8706ae3a5a", "url": "https://github.com/status-im/nim-contract-abi", "downloadMethod": "git", "dependencies": [ @@ -89,12 +90,12 @@ "upraises" ], "checksums": { - "sha1": "be9a6b1dc2dc3057f68a6e69f77eb6b873909b04" + "sha1": "c45b2abde354c731ed9cb3bf30a8fe0a444ed027" } }, "secp256k1": { "version": "0.6.0.3.2", - "vcsRevision": "e5f0ed8bc27d477b13c174d9c2768d2b0c41da07", + "vcsRevision": "62e16b4dff513f1eea7148a8cbba8a8c547b9546", "url": "https://github.com/status-im/nim-secp256k1", "downloadMethod": "git", "dependencies": [ @@ -102,7 +103,7 @@ "nimcrypto" ], "checksums": { - "sha1": "6df5d2c8236d715553c9c2c66d568ceaf48c454a" + "sha1": "443802551ed2f7ba273df38e06a18164dffa14c9" } } }, diff --git a/nitro.nimble b/nitro.nimble index b381aca..287e487 100644 --- a/nitro.nimble +++ b/nitro.nimble @@ -3,13 +3,11 @@ author = "Nim Nitro developers" license = "MIT" description = "Nitro state channels" -requires "nim >= 1.6.14" +requires "nim >= 2.0.14 < 3.0.0" requires "nimcrypto >= 0.6.0 & < 0.7.0" requires "questionable >= 0.10.10 & < 0.11.0" requires "upraises >= 0.1.0 & < 0.2.0" -# Update to nim 2.0.x -# Avoid downloading stint 0.8.0 -requires "contractabi#363f8b4852b05c089b1e35ef3a0a882d51c996bc" -requires "secp256k1 >= 0.6.0" -requires "stint#3236fa68394f1e3a06e2bc34218aacdd2d675923" -requires "stew >= 0.2.0" +requires "contractabi >= 0.7.1 & < 0.8.0" +requires "secp256k1 >= 0.6.0 & < 0.7.0" +requires "stint >= 0.8.0 & < 0.9.0" +requires "stew >= 0.2.0 & < 0.3.0" From f924a324589f2dd8d692f889d8613de337ba5d0b Mon Sep 17 00:00:00 2001 From: Arnaud Date: Fri, 14 Feb 2025 10:59:08 +0100 Subject: [PATCH 5/6] Fix typo --- nitro.nimble | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nitro.nimble b/nitro.nimble index 287e487..b674233 100644 --- a/nitro.nimble +++ b/nitro.nimble @@ -3,11 +3,11 @@ author = "Nim Nitro developers" license = "MIT" description = "Nitro state channels" -requires "nim >= 2.0.14 < 3.0.0" +requires "nim >= 2.0.14 & < 3.0.0" requires "nimcrypto >= 0.6.0 & < 0.7.0" requires "questionable >= 0.10.10 & < 0.11.0" requires "upraises >= 0.1.0 & < 0.2.0" requires "contractabi >= 0.7.1 & < 0.8.0" requires "secp256k1 >= 0.6.0 & < 0.7.0" requires "stint >= 0.8.0 & < 0.9.0" -requires "stew >= 0.2.0 & < 0.3.0" +requires "stew >= 0.2.0 & < 0.3.0" \ No newline at end of file From 1e7358c7c40e10139dcce38197712658d2776bb7 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Fri, 14 Feb 2025 11:01:51 +0100 Subject: [PATCH 6/6] Fix tests --- tests/nitro/examples.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/nitro/examples.nim b/tests/nitro/examples.nim index 4453900..b7e099b 100644 --- a/tests/nitro/examples.nim +++ b/tests/nitro/examples.nim @@ -19,10 +19,10 @@ proc example*[T](_: type seq[T], len = 0..5): seq[T] = newSeqWith(chosenlen, T.example) proc example*(_: type UInt256): UInt256 = - UInt256.fromBytes(array[32, byte].example) + UInt256.fromBytesBE(array[32, byte].example) proc example*(_: type UInt128): UInt128 = - UInt128.fromBytes(array[16, byte].example) + UInt128.fromBytesBE(array[16, byte].example) proc example*(_: type EthAddress): EthAddress = EthAddress(array[20, byte].example)