Skip to content

Commit

Permalink
feat: camelCase for ParsedEmail wasm bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
DimiDumo committed Dec 13, 2024
1 parent e660944 commit 563da0b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ crate-type = ["rlib", "cdylib"]
itertools = "0.10.3"
serde_json = "1.0.95"
serde = { version = "1.0.159", features = ["derive"] }
zk-regex-apis = { version = "2.1.1", git = "https://github.com/zkemail/zk-regex.git" }
# zk-regex-apis = { version = "2.1.1", git = "https://github.com/zkemail/zk-regex.git" }
zk-regex-apis = { git = "https://github.com/zkemail/zk-regex.git", branch = "dimidumo/zk-802-consistent-casing-everywhere" }
hex = "0.4.3"
anyhow = "1.0.75"
poseidon-rs = { git = "https://github.com/zkemail/poseidon-rs.git", version = "1.0.0" }
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
"module": "index.ts",
"scripts": {
"publish-npm": "cd pkg && npm publish --access public && cd ..",
"publish-npm-nightly": "cd pkg && npm publish --access public --tag nightly && cd ..",
"publish": "bun run build && bun run publish-npm",
"publish-nightly": "bun run build && bun run publish-npm-nightly",
"wasm:build": "wasm-pack build --target bundler --out-dir pkg",
"wasm:postbuild": "node build.js",
"build": "npm run wasm:build && npm run wasm:postbuild"
},
"version": "0.4.55",
"version": "0.4.59.0",
"devDependencies": {
"@types/bun": "latest",
"prettier": "^3.3.3"
Expand Down
1 change: 1 addition & 0 deletions src/parse_email.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use zk_regex_apis::extract_substrs::{

/// `ParsedEmail` holds the canonicalized parts of an email along with its signature and public key.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ParsedEmail {
/// The canonicalized email header.
pub canonicalized_header: String,
Expand Down
22 changes: 11 additions & 11 deletions ts_tests/circuit_intput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ describe("generateCircuitInputsWithDecomposedRegexesAndExternalInputs test suite
{
parts: [
{
is_public: true,
regex_def: "Hi",
isPublic: true,
regexDef: "Hi",
},
{
is_public: true,
regex_def: "!",
isPublic: true,
regexDef: "!",
},
],
name: "hi",
Expand Down Expand Up @@ -49,12 +49,12 @@ describe("generateCircuitInputsWithDecomposedRegexesAndExternalInputs test suite
{
parts: [
{
is_public: true,
regex_def: "Hi",
isPublic: true,
regexDef: "Hi",
},
{
is_public: true,
regex_def: "!",
isPublic: true,
regexDef: "!",
},
],
name: "hi",
Expand All @@ -67,9 +67,9 @@ describe("generateCircuitInputsWithDecomposedRegexesAndExternalInputs test suite
{
name: "address",
maxLength: 64,
value: "[email protected]"
}
]
value: "[email protected]",
},
];

const params = {
maxHeaderLength: 2816,
Expand Down

0 comments on commit 563da0b

Please sign in to comment.