-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Modify email_addr_with_name using reversed_email_addr_with_name * Pass all unit tests * Add range check to each input byte * Update circom_tester version * Add program to test circuits * Add --immutable to github action * Fix circom version in github action * fix circom version to 2.1.9 in github action * Add assumptions to README * Update versions
- Loading branch information
1 parent
28f6858
commit 81d0299
Showing
90 changed files
with
1,474 additions
and
953 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@zk-email/zk-regex-apis", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "apis compatible with [zk-regex](https://github.com/zkemail/zk-regex/tree/main).", | ||
"contributors": [ | ||
"Javier Su <[email protected]>", | ||
|
16 changes: 0 additions & 16 deletions
16
packages/apis/src/decomposed_defs/email_addr_with_name.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,12 +89,12 @@ pub fn extract_email_domain_idxes( | |
extract_substr_idxes(input_str, &serde_json::from_str(regex_config).unwrap()) | ||
} | ||
|
||
pub fn extract_email_addr_with_name_idxes( | ||
input_str: &str, | ||
) -> Result<Vec<(usize, usize)>, ExtractSubstrssError> { | ||
let regex_config = include_str!("./decomposed_defs/email_addr_with_name.json"); | ||
extract_substr_idxes(input_str, &serde_json::from_str(regex_config).unwrap()) | ||
} | ||
// pub fn extract_email_addr_with_name_idxes( | ||
// input_str: &str, | ||
// ) -> Result<Vec<(usize, usize)>, ExtractSubstrssError> { | ||
// let regex_config = include_str!("./decomposed_defs/email_addr_with_name.json"); | ||
// extract_substr_idxes(input_str, &serde_json::from_str(regex_config).unwrap()) | ||
// } | ||
|
||
pub fn extract_from_all_idxes( | ||
input_str: &str, | ||
|
@@ -166,20 +166,20 @@ mod test { | |
assert_eq!(idxes, vec![(17, 38)]); | ||
} | ||
|
||
#[test] | ||
fn test_email_addr_with_name_valid1() { | ||
let input_str = "from:[email protected] <[email protected]>"; | ||
let idxes = extract_email_addr_with_name_idxes(input_str).unwrap(); | ||
assert_eq!(idxes, vec![(18, 39)]); | ||
} | ||
|
||
#[test] | ||
fn test_email_addr_with_name_valid2() { | ||
// "末神 奏宙" has 13 bytes. | ||
let input_str = "from:\"末神 奏宙\" <[email protected]>"; | ||
let idxes = extract_email_addr_with_name_idxes(input_str).unwrap(); | ||
assert_eq!(idxes, vec![(22, 43)]); | ||
} | ||
// #[test] | ||
// fn test_email_addr_with_name_valid1() { | ||
// let input_str = "from:[email protected] <[email protected]>"; | ||
// let idxes = extract_email_addr_with_name_idxes(input_str).unwrap(); | ||
// assert_eq!(idxes, vec![(18, 39)]); | ||
// } | ||
|
||
// #[test] | ||
// fn test_email_addr_with_name_valid2() { | ||
// // "末神 奏宙" has 13 bytes. | ||
// let input_str = "from:\"末神 奏宙\" <[email protected]>"; | ||
// let idxes = extract_email_addr_with_name_idxes(input_str).unwrap(); | ||
// assert_eq!(idxes, vec![(22, 43)]); | ||
// } | ||
|
||
#[test] | ||
fn test_email_from_all_valid() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.