From 608a355585fd15aab3c9c7e8d86e23dd1776ff0c Mon Sep 17 00:00:00 2001 From: decanus <7621705+decanus@users.noreply.github.com> Date: Mon, 13 Sep 2021 23:19:40 +0200 Subject: [PATCH] added ci --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ Makefile | 6 +----- rln/librln.h | 35 ----------------------------------- 3 files changed, 34 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 rln/librln.h diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..02e8b1e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: CI + +on: + pull_request: + push: + branches: + - main + +jobs: + test: + strategy: + matrix: + go-version: [1.16.x] + platform: [ubuntu-latest] + runs-on: ${{ matrix.platform }} + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout code + uses: actions/checkout@v2 + - name: Test + run: go test ./... + lint: + strategy: + matrix: + go-version: [1.15.x, 1.16.x] + platform: [ubuntu-latest] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@master + - uses: reviewdog/action-golangci-lint@v1 diff --git a/Makefile b/Makefile index a9db647..6b2be34 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,4 @@ rlnlib: sh scripts/build.sh - #cd lib/rln && cargo build --release --target=aarch64-apple-darwin - #cbindgen --config ../cbindgen.toml --crate rln --output librln.h --lang c - #mv lib/rln/target/release/librln.* lib/ - -# @TODO TARGET FOR BINDINGS. \ No newline at end of file + cd lib/rln && cbindgen --config ../cbindgen.toml --crate rln --output ../../rln/librln.h --lang c diff --git a/rln/librln.h b/rln/librln.h deleted file mode 100644 index 8cca80a..0000000 --- a/rln/librln.h +++ /dev/null @@ -1,35 +0,0 @@ -#include -#include -#include -#include - -typedef struct RLN_Bn256 RLN_Bn256; - -/** - * Buffer struct is taken from - * https://github.com/celo-org/celo-threshold-bls-rs/blob/master/crates/threshold-bls-ffi/src/ffi.rs - */ -typedef struct Buffer { - const uint8_t *ptr; - uintptr_t len; -} Buffer; - -bool new_circuit_from_params(uintptr_t merkle_depth, - const struct Buffer *parameters_buffer, - struct RLN_Bn256 **ctx); - -bool generate_proof(const struct RLN_Bn256 *ctx, - const struct Buffer *input_buffer, - struct Buffer *output_buffer); - -bool verify(const struct RLN_Bn256 *ctx, - const struct Buffer *proof_buffer, - const struct Buffer *public_inputs_buffer, - uint32_t *result_ptr); - -bool hash(const struct RLN_Bn256 *ctx, - const struct Buffer *inputs_buffer, - const uintptr_t *input_len, - struct Buffer *output_buffer); - -bool key_gen(const struct RLN_Bn256 *ctx, struct Buffer *keypair_buffer);