Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Okm165 committed Jul 26, 2024
1 parent e675fe7 commit d5d4d7d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cargo_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ jobs:
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache Cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-
- name: Install dependencies
run: cargo fetch

Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/npm_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ jobs:
strategy:
fail-fast: false
matrix:
layout: ["dex", "recursive", "recursive_with_poseidon", "small", "starknet", "starknet_with_keccak"]
layout:
[
"dex",
"recursive",
"recursive_with_poseidon",
"small",
"starknet",
"starknet_with_keccak",
]
hash: ["blake2s", "keccak"]

steps:
Expand All @@ -23,7 +31,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # specify your desired Node.js version
node-version: "18" # specify your desired Node.js version

- name: Configure npm
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
Expand All @@ -38,22 +46,22 @@ jobs:
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache Cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-
- name: Install wasm-pack
run: cargo install wasm-pack

- name: Build package
run: wasm-pack build --out-dir pkg --target web --features ${{ matrix.layout }},${{ matrix.hash }} --no-default-features
working-directory: ${{ env.WORKING_DIR }}

- name: Rename package
run: |
jq --arg layout "${{ matrix.layout }}" --arg hash "${{ matrix.hash }}" \
Expand Down
2 changes: 1 addition & 1 deletion proof_parser/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Swiftness Proof Parser CairoVM Verifier
# Swiftness Proof Parser CairoVM Verifier
10 changes: 6 additions & 4 deletions wasm_bindings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ Swiftness is a Rust implementation of the Cairo-VM STARK verifier with layouts,
## Example Usage

```js
import init, { verify_proof } from 'swiftness-{layout}-{commitment hash}';
import init, { verify_proof } from "swiftness-{layout}-{commitment hash}";

async function run(proof_json) {
await init(); // Initialize the Wasm module
await init(); // Initialize the Wasm module
try {
const [programHash, programOutput] = JSON.parse(await verify_proof(proof_json));
const [programHash, programOutput] = JSON.parse(
await verify_proof(proof_json),
);
} catch (err) {
console.error(`Verification failed: ${err}`);
}
Expand All @@ -28,4 +30,4 @@ async function run(proof_json) {

## Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to help improve this project.
Contributions are welcome! Feel free to open issues or submit pull requests to help improve this project.

0 comments on commit d5d4d7d

Please sign in to comment.