Fix for styleCheck:usages (#34)

This commit is contained in:
Tanguy 2021-12-27 11:27:55 +01:00 committed by GitHub
parent d790c42206
commit 153ec71a34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View File

@ -317,7 +317,7 @@ func fromRaw*(T: type SkSignature, data: openArray[byte]): SkResult[T] =
ok(T(data: sig))
func fromDer*(T: type SkSignature, data: openarray[byte]): SkResult[T] =
func fromDer*(T: type SkSignature, data: openArray[byte]): SkResult[T] =
## Initialize Secp256k1 `signature` ``sig`` from DER
## representation ``data``.
if len(data) < 1:
@ -341,7 +341,7 @@ func toRaw*(sig: SkSignature): array[SkRawSignatureSize, byte] =
secp256k1_context_no_precomp, result.ptr0, unsafeAddr sig.data)
doAssert res == 1, "Can't fail, per documentation"
func toDer*(sig: SkSignature, data: var openarray[byte]): int =
func toDer*(sig: SkSignature, data: var openArray[byte]): int =
## Serialize Secp256k1 `signature` ``sig`` to raw binary form and store it
## to ``data``.
##

View File

@ -1,7 +1,7 @@
mode = ScriptMode.Verbose
packageName = "secp256k1"
version = "0.5.1"
version = "0.5.2"
author = "Status Research & Development GmbH"
description = "A wrapper for the libsecp256k1 C library"
license = "Apache License 2.0"
@ -18,7 +18,7 @@ proc test(env, path: string) =
lang = getEnv"TEST_LANG"
exec "nim " & lang & " " & env &
" -r -f --hints:off --skipParentCfg " & path
" -r -f --hints:off --styleCheck:usages --styleCheck:error --skipParentCfg " & path
task test, "Tests":
test "--threads:on", "tests/all_tests"

View File

@ -8,13 +8,13 @@ const
srcPath = internalPath & "/src"
secpSrc = srcPath & "/secp256k1.c"
{.passC: "-I" & quoteShell(wrapperPath).}
{.passC: "-I" & quoteShell(internalPath).}
{.passC: "-I" & quoteShell(srcPath).}
{.passC: "-DHAVE_CONFIG_H".}
{.passc: "-I" & quoteShell(wrapperPath).}
{.passc: "-I" & quoteShell(internalPath).}
{.passc: "-I" & quoteShell(srcPath).}
{.passc: "-DHAVE_CONFIG_H".}
when defined(gcc) or defined(clang):
{.passC: "-DHAVE_BUILTIN_EXPECT"}
{.passc: "-DHAVE_BUILTIN_EXPECT"}
{.compile: secpSrc.}