From a33af70adb1ff677ccfa913d6c276dd0e040f06f Mon Sep 17 00:00:00 2001 From: merkleplant <85061506+pmerkleplant@users.noreply.github.com> Date: Tue, 3 Sep 2024 22:06:37 +0200 Subject: [PATCH 1/2] fix: Deinit secp context undefined behaviour (#5) --- src/secp256k1.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/secp256k1.zig b/src/secp256k1.zig index ff385ac..929a83e 100644 --- a/src/secp256k1.zig +++ b/src/secp256k1.zig @@ -86,7 +86,7 @@ pub const Secp256k1 = struct { ctx: ?*secp256k1.struct_secp256k1_context_struct, pub fn deinit(self: @This()) void { - secp256k1.secp256k1_context_preallocated_destroy(self.ctx); + secp256k1.secp256k1_context_destroy(self.ctx); } /// Creates a schnorr signature using the given auxiliary random data. From f0e45eee2c91c13bf1a64474ea3585bb2dbfd986 Mon Sep 17 00:00:00 2001 From: StringNick Date: Wed, 4 Sep 2024 15:41:04 +0200 Subject: [PATCH 2/2] CI --- .github/workflows/check.yml | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..f437909 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,46 @@ +name: Zig Test + +on: + push: + branches: [main] + pull_request: + branches: [main] + +env: + ZIG_VERSION: 0.14.0-dev.909+f9f894200 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Cache Zig + uses: actions/cache@v3 + with: + path: ~/zig + key: ${{ runner.os }}-zig-${{ env.ZIG_VERSION }} + + - name: Install Zig + if: steps.cache.outputs.cache-hit != 'true' + run: | + wget https://ziglang.org/builds/zig-linux-x86_64-${{ env.ZIG_VERSION }}.tar.xz + tar -xf zig-linux-x86_64-${{ env.ZIG_VERSION }}.tar.xz + mv zig-linux-x86_64-${{ env.ZIG_VERSION }} ~/zig + + - name: Add Zig to PATH + run: echo "${HOME}/zig" >> $GITHUB_PATH + + - name: Cache Zig build artifacts + uses: actions/cache@v3 + with: + path: | + zig-cache + ~/.cache/zig + key: ${{ runner.os }}-zig-build-${{ hashFiles('**/*.zig') }} + restore-keys: | + ${{ runner.os }}-zig-build- + + - name: Unit testing + run: zig build test --summary all