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 14, 2024
1 parent 250c2aa commit 64052d2
Show file tree
Hide file tree
Showing 5 changed files with 18 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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"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"
Expand All @@ -16,4 +18,3 @@
"peerDependencies": {
"typescript": "^5.0.0"
}
}
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_input.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 64052d2

Please sign in to comment.