Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/threshold-schnorr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: threshold-schnorr

on:
push:
branches: [master]
pull_request:
paths:
- motoko/threshold-schnorr/**
- .github/workflows/threshold-schnorr.yml

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
motoko-threshold-schnorr:
runs-on: ubuntu-24.04
container: ghcr.io/dfinity/icp-dev-env-motoko:0.3.2
env:
ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Deploy and test
working-directory: motoko/threshold-schnorr
run: |
icp network start -d
icp deploy
make test
20 changes: 0 additions & 20 deletions motoko/threshold-schnorr/.devcontainer/devcontainer.json

This file was deleted.

113 changes: 0 additions & 113 deletions motoko/threshold-schnorr/BUILD.md

This file was deleted.

46 changes: 27 additions & 19 deletions motoko/threshold-schnorr/Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
.PHONY: all
all: deploy
.PHONY: test

.PHONY: deploy
.SILENT: deploy
deploy:
dfx deploy
test:
@echo "=== Test 1/5: public_key returns hex for bip340secp256k1 ==="
@result=$$(icp canister call backend public_key '(variant { bip340secp256k1 })') && \
echo "$$result" && \
echo "$$result" | grep -q 'public_key_hex' && \
echo "PASS" || (echo "FAIL" && exit 1)

.PHONY: test
.SILENT: test
test: deploy
npm install
bash test.sh hellohellohellohellohellohello12
@echo "=== Test 2/5: public_key returns hex for ed25519 ==="
@result=$$(icp canister call backend public_key '(variant { ed25519 })') && \
echo "$$result" && \
echo "$$result" | grep -q 'public_key_hex' && \
echo "PASS" || (echo "FAIL" && exit 1)

@echo "=== Test 3/5: sign returns signature_hex for bip340secp256k1 ==="
@result=$$(icp canister call backend sign '("hello world of BIP340-secp256k1!", variant { bip340secp256k1 }, null)') && \
echo "$$result" && \
echo "$$result" | grep -q 'signature_hex' && \
echo "PASS" || (echo "FAIL" && exit 1)

@echo "=== Test 4/5: sign returns signature_hex for ed25519 ==="
@result=$$(icp canister call backend sign '("hello world", variant { ed25519 }, null)') && \
echo "$$result" && \
echo "$$result" | grep -q 'signature_hex' && \
echo "PASS" || (echo "FAIL" && exit 1)

.PHONY: clean
.SILENT: clean
clean:
rm -rf .dfx
rm -rf dist
rm -rf node_modules
rm -rf src/declarations
rm -f .env
@echo "=== Test 5/5: all three signature types verify cryptographically ==="
@npm install --silent
@chmod +x test.sh && ./test.sh "hello world of BIP340-secp256k1!" && echo "PASS" || (echo "FAIL" && exit 1)
Loading
Loading