Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ECDSA support #91

Draft
wants to merge 121 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
7537ef2
added CI workflow file
zees-dev Feb 12, 2024
9f65ce5
pipeline setup to deploy to npm and cratesio
zees-dev Feb 13, 2024
86c16c6
Update parity-scale-codec to 3.0.0
surangap Dec 6, 2023
5017451
Update package name to doughnut-rs
surangap Dec 6, 2023
ea78ee2
Add ecdsa signing.
surangap Dec 10, 2023
d2fa1a4
Add ecdsa verify
surangap Dec 10, 2023
814c1b0
Add ecdsa support to verify_signature
surangap Dec 10, 2023
b3edd44
Add tests
surangap Dec 10, 2023
604e51d
Fix build errors
surangap Dec 10, 2023
516c953
More tests
surangap Dec 10, 2023
7d572d4
Change to use sp-io when ecdsa verifying.
surangap Dec 11, 2023
2171e56
temp commit
surangap Dec 17, 2023
0577e34
Add doughnut v1
surangap Dec 18, 2023
50554c9
Add trait implementations for doughnut v1
surangap Dec 18, 2023
372c8cc
Integrate doughnut v1 to the crate
surangap Dec 18, 2023
2c71c5d
misc lib importstructure update
zees-dev Dec 18, 2023
f99ec94
trait impl restructure
zees-dev Dec 18, 2023
6f29bf5
project restructure
zees-dev Dec 18, 2023
5d9c42b
project restructure
zees-dev Dec 18, 2023
102e34f
removed sp-core, using libsecp256k1, removed conditional compilation …
zees-dev Dec 19, 2023
b727598
project restructure
zees-dev Dec 19, 2023
9dbdc57
uncommented a bunch of v1 doughnut tests
zees-dev Dec 19, 2023
8a2fe14
signatures returned from signing scheme fixed known length
zees-dev Dec 19, 2023
f9acfb6
hardcoded secret key and signature lengths to move runtime checks to …
zees-dev Dec 19, 2023
64bbc01
quick refactor
zees-dev Dec 19, 2023
319f922
small refactor
zees-dev Dec 19, 2023
5ba8d13
updated Cargo.toml dep versions
zees-dev Dec 19, 2023
05d82dd
holder -> sender rename
zees-dev Dec 20, 2023
a8fb3c5
fixed typo with error variant
zees-dev Dec 20, 2023
c024c29
Revert "fixed typo with error variant"
zees-dev Dec 20, 2023
cc4ccd3
Revert "holder -> sender rename"
zees-dev Dec 20, 2023
91354a8
copyright upd from centrality -> futureverse
zees-dev Dec 21, 2023
a47171f
conditional compilation support for wasm32 targets
zees-dev Dec 21, 2023
dda9644
editorconfig + prettier max line length upd
zees-dev Dec 21, 2023
26a2bb5
ignore file upd
zees-dev Dec 21, 2023
49a8664
upd js bindgen project - successful compilation and usage of doughnut…
zees-dev Dec 21, 2023
da0d9da
root lock file upd
zees-dev Dec 21, 2023
f4dc75c
cargo fmt --all
zees-dev Dec 21, 2023
89670aa
using feature flags instead of conditional wasm target build
zees-dev Dec 21, 2023
f4e4188
Fix wasm-pack build
surangap Dec 27, 2023
9d5ca8a
Add fee_payer to doughnut v1
surangap Dec 28, 2023
7093ac3
Add fee_payer to DoughnutApi, update encode/decode
surangap Dec 28, 2023
93888a6
Update tests
surangap Dec 28, 2023
e87ccb1
rename fee_payer to fee_mode, add fee_payer()
surangap Dec 28, 2023
ac13ce1
Add FeeMode enum
surangap Dec 28, 2023
c066f17
Add PayloadVersion enum
surangap Jan 3, 2024
d1e422b
Add DecodeInner trait
surangap Jan 3, 2024
c28198d
Implement DecodeInner for v0,v1
surangap Jan 3, 2024
4a6cb1f
Doughnut decode support both v0,v1 now
surangap Jan 3, 2024
80d06da
fix warnings
surangap Jan 3, 2024
7ded97c
remove todo
surangap Jan 3, 2024
8bdff0d
Implement Default for DoughnutV1
surangap Jan 8, 2024
1b129c2
Up to date js crate
surangap Jan 8, 2024
53c59c0
Update other
surangap Jan 8, 2024
1a5eae4
remove sp-io dependency
surangap Jan 10, 2024
215fc87
Update js tests
surangap Jan 10, 2024
e5f5666
More ecdsa js tests
surangap Jan 10, 2024
50e0dc4
Add with_version_info flag to DecodeInner
surangap Jan 11, 2024
859c001
Update DecodeInner with_version_info
surangap Jan 11, 2024
6911d71
Updates to doughnut-js
surangap Jan 29, 2024
7b7149e
Initial signature stuff
JasonTulp Feb 6, 2024
78822ef
Fix metamask signing
JasonTulp Feb 6, 2024
1d430ac
Reintroduce ecdsa signing for doughnut v1
JasonTulp Feb 6, 2024
b70a6fd
fmt
JasonTulp Feb 7, 2024
23215bd
Add sign_eip191() to Signing trait
surangap Feb 8, 2024
2634924
Implement sign_eip191()
surangap Feb 8, 2024
61a5924
sign_eip191() support for V1,V0
surangap Feb 8, 2024
dd85be5
Add signEIP191() to js interface
surangap Feb 8, 2024
210326b
Add PayloadVersionJS, SignatureVersionJS, FeeModeJS to js interface
surangap Feb 8, 2024
9218a9e
Update/Add tests
surangap Feb 8, 2024
a18744b
Refactor addSignature() in js interface
surangap Feb 8, 2024
019f66e
Remove add_eip191_signature() from Signing trait
surangap Feb 8, 2024
056c7f6
minor
surangap Feb 8, 2024
6a086c2
minor
surangap Feb 9, 2024
d3b0769
removed redundant file
zees-dev Feb 7, 2024
1902a5e
removed redundant e2e test
zees-dev Feb 7, 2024
0e09cc0
migrated trnnut codebase to doughnut; refactored code
zees-dev Feb 7, 2024
13e66e1
post-rebase fixes
zees-dev Feb 8, 2024
a16955d
rebase merge fix
zees-dev Feb 8, 2024
7cfd520
nit-fix
zees-dev Feb 8, 2024
630eb53
fixed feature gating for crypto flag
zees-dev Feb 8, 2024
270c75d
introduced trnnnut js lib + json alloc fixes to build for wasm32-unkn…
zees-dev Feb 8, 2024
e0dbfcb
migrated trnnut js e2e tests
zees-dev Feb 8, 2024
fab2112
upd package.json
zees-dev Feb 8, 2024
d710b13
force use no_std in all scenarios
zees-dev Feb 8, 2024
c1e2998
qol changes - fix lint warning
zees-dev Feb 8, 2024
047e462
cargo fmt --all
zees-dev Feb 8, 2024
1d47396
updated deps - trn-pact
zees-dev Feb 8, 2024
811026d
updated deps js - trn-pact
zees-dev Feb 8, 2024
e285e9f
trn-pact - pointing to repo
zees-dev Feb 8, 2024
8dacafb
updated libsecp256k1 as optional dep
zees-dev Feb 8, 2024
73ee19e
rebased and merged changes from base branch
zees-dev Feb 9, 2024
09283d9
added back no_std support
zees-dev Feb 11, 2024
e2e84e6
upd CI pipeline
zees-dev Feb 12, 2024
e0cfef8
seperating out deps
zees-dev Feb 13, 2024
537e404
refactor for ci upd and deployment to npm
zees-dev Feb 13, 2024
219b5c5
testing npm publish
zees-dev Feb 13, 2024
87a5209
npm publish
zees-dev Feb 13, 2024
d1b19ac
using apache license for doughnuts lib
zees-dev Feb 13, 2024
509ece9
updated pact -> trn-pact and cargo fmt --all
zees-dev Feb 13, 2024
89d3f3f
added ci check for js proj
zees-dev Feb 13, 2024
df53ee0
workflow to publish to crates io
zees-dev Feb 13, 2024
d341f60
rustfmt in toolchain for js proj formatting testing
zees-dev Feb 13, 2024
7f7227f
split out cargo check js toolchain from cargo fmt
zees-dev Feb 13, 2024
848c59c
workflow upd for cratesio publishing
zees-dev Feb 13, 2024
6df3503
minor fixes to copyright and package.json
zees-dev Feb 13, 2024
a3c8546
refactor and upd project to deploy and poublish package for web and n…
zees-dev Feb 15, 2024
16ddece
downgraded js lib version; fixed CD pipeline to publish to npm
zees-dev Feb 15, 2024
44b2e60
upd build script
zees-dev Feb 15, 2024
0133312
upd license apache-2.0 -> UNLICENSED
zees-dev Feb 16, 2024
11f4056
using BUSL license since crate is not publishable with UNLICENSED
zees-dev Feb 16, 2024
0db08dc
Topping (#7)
surangap Feb 18, 2024
4be5a6c
Bump doughnut-js crate to 0.1.1
surangap Feb 19, 2024
21ce1f3
Review suggestions
surangap Feb 20, 2024
12a7fc7
Update js README.md
surangap Feb 20, 2024
7e15ad7
Remove redundant code from tests
surangap Feb 20, 2024
73776c0
Update main README.md
surangap Feb 20, 2024
8b60de8
Review suggestions
surangap Feb 20, 2024
d1281b9
fmt
surangap Feb 20, 2024
b8b36f2
Update trn-pact to 0.2.1
surangap Feb 20, 2024
9387096
bump to v0.2.2
surangap Feb 20, 2024
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
98 changes: 0 additions & 98 deletions .circleci/config.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/actions/install-wasm-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Install dependencies"
description: "Prepare repository and all dependencies"

runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
with:
toolchain: nightly-x86_64-unknown-linux-gnu
target: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
# https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data
- uses: pnpm/action-setup@v2
with:
version: 8.15.1
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
cache-dependency-path: js/pnpm-lock.yaml
- name: Install JS deps
run: pnpm install
shell: bash
working-directory: js
- name: Install wasm-pack
run: pnpm install -g wasm-pack
shell: bash
- name: Build JS wasm library using wasm-pack
run: pnpm build
shell: bash
working-directory: js
44 changes: 44 additions & 0 deletions .github/workflows/cd-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish to NPM

on:
workflow_dispatch:

# Note: The `doughtnut-web` & `doughnut-nodejs` package version is based on the `js/Cargo.toml` file.
jobs:
publish-npm-web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install & Build dependencies
uses: ./.github/actions/install-wasm-dependencies
- name: Pack and print version
run: |
mv ./doughnut-web ./pkg
wasm-pack pack ./pkg
echo "The version of the package is: $(cat ./pkg/package.json | jq -r .version)"
working-directory: js
- name: Publish to NPM
# run: wasm-pack publish --tag next --access public
run: wasm-pack publish --tag latest --access public
working-directory: js
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-npm-nodejs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install & Build dependencies
uses: ./.github/actions/install-wasm-dependencies
- name: Pack and print version
run: |
mv ./doughnut-nodejs ./pkg
wasm-pack pack ./pkg
echo "The version of the package is: $(cat ./pkg/package.json | jq -r .version)"
working-directory: js
- name: Publish to NPM
# run: wasm-pack publish --tag next --access public
run: wasm-pack publish --tag latest --access public
working-directory: js
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/cd-rs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish to Crates.io

on:
workflow_dispatch:

jobs:
publish-crate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Publish to Crates.io
run: cargo publish --token $CARGO_REGISTRY_TOKEN
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
# push:
# branches: [main]
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always

jobs:
test:
name: test ${{ matrix.rust }} ${{ matrix.flags }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
rust: ["stable", "1.73"]
flags: ["--all-features"]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: test
run: cargo test ${{ matrix.flags }}

js-wasm-build-test:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
with:
components: rustfmt
- run: cargo fmt --all --check
working-directory: js
- name: Install & Build dependencies
uses: ./.github/actions/install-wasm-dependencies
- run: cargo check --target wasm32-unknown-unknown
working-directory: js
- name: Test JS wasm library
run: pnpm test
working-directory: js

# clippy:
# runs-on: ubuntu-latest
# timeout-minutes: 30
# steps:
# - uses: actions/checkout@v4
# - uses: dtolnay/[email protected]
# with:
# components: clippy
# - uses: Swatinem/rust-cache@v2
# with:
# cache-on-failure: true
# - run: cargo clippy --workspace --all-targets --all-features
# env:
# RUSTFLAGS: -Dwarnings

fmt:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
with:
components: rustfmt
- run: cargo fmt --all --check
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/target
**/*.rs.bk
.vscode
/js/node_modules
/js/lib
/js/target

1 change: 0 additions & 1 deletion .rustfmt.toml

This file was deleted.

Loading