From 5340cf188168d6afcafc8023770d880f067c0b2f Mon Sep 17 00:00:00 2001 From: zah Date: Mon, 20 Jun 2022 14:31:15 +0300 Subject: [PATCH] Restructure the project to allow nimble check to pass (#36) * Restructure the project to allow nimble check to pass * Add a lock file --- nimble.lock | 25 +++++++++++++++++++++++++ secp256k1.nim | 4 ++-- secp256k1.nimble | 3 ++- secp256k1_abi.nim => secp256k1/abi.nim | 2 +- tests/test_secp256k1_abi.nim | 2 +- 5 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 nimble.lock rename secp256k1_abi.nim => secp256k1/abi.nim (99%) diff --git a/nimble.lock b/nimble.lock new file mode 100644 index 0000000..3e67944 --- /dev/null +++ b/nimble.lock @@ -0,0 +1,25 @@ +{ + "version": 1, + "packages": { + "nimcrypto": { + "version": "0.5.4", + "vcsRevision": "a5742a9a214ac33f91615f3862c7b099aec43b00", + "url": "https://github.com/cheatfate/nimcrypto", + "downloadMethod": "git", + "dependencies": [], + "checksums": { + "sha1": "f76c87707cd4e96355b8bb6ef27e7f8b0aac1e08" + } + }, + "stew": { + "version": "0.1.0", + "vcsRevision": "cdb1f213d073fd2ecbdaf35a866417657da9294c", + "url": "https://github.com/status-im/nim-stew", + "downloadMethod": "git", + "dependencies": [], + "checksums": { + "sha1": "3dd9e4ec78d906b59b6f9bcf74f5f8fa6b5c24fe" + } + } + } +} \ No newline at end of file diff --git a/secp256k1.nim b/secp256k1.nim index 3000bff..5e2a2ca 100644 --- a/secp256k1.nim +++ b/secp256k1.nim @@ -12,7 +12,7 @@ import strformat, typetraits, stew/[byteutils, objects, results, ctops], - ./secp256k1_abi + ./secp256k1/abi from nimcrypto/utils import burnMem @@ -21,7 +21,7 @@ export results # Implementation notes # # The goal of this wrapper is to create a thin layer on top of the API presented -# in secp256k1_abi, exploiting some of its regulatities to make it slightly more +# in secp256k1/abi, exploiting some of its regulatities to make it slightly more # convenient to use from Nim # # * Types like keys and signatures are guaranteed to hold valid values which diff --git a/secp256k1.nimble b/secp256k1.nimble index ed6dbbc..ea115a1 100644 --- a/secp256k1.nimble +++ b/secp256k1.nimble @@ -5,7 +5,8 @@ version = "0.5.2" author = "Status Research & Development GmbH" description = "A wrapper for the libsecp256k1 C library" license = "Apache License 2.0" -installDirs = @[".", "secp256k1_wrapper"] +skipDirs = @["tests"] +installDirs = @["secp256k1_wrapper"] requires "nim >= 1.2.0" requires "stew" diff --git a/secp256k1_abi.nim b/secp256k1/abi.nim similarity index 99% rename from secp256k1_abi.nim rename to secp256k1/abi.nim index ab7746a..acd4c35 100644 --- a/secp256k1_abi.nim +++ b/secp256k1/abi.nim @@ -3,7 +3,7 @@ from os import DirSep, AltSep, quoteShell const wrapperPath = currentSourcePath.rsplit({DirSep, AltSep}, 1)[0] & - "/secp256k1_wrapper" + "/../secp256k1_wrapper" internalPath = wrapperPath & "/secp256k1" srcPath = internalPath & "/src" secpSrc = srcPath & "/secp256k1.c" diff --git a/tests/test_secp256k1_abi.nim b/tests/test_secp256k1_abi.nim index cfb6d79..7d78768 100644 --- a/tests/test_secp256k1_abi.nim +++ b/tests/test_secp256k1_abi.nim @@ -1,4 +1,4 @@ -import ../secp256k1_abi, unittest +import ../secp256k1/abi, unittest {.used.}