-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add function verify_proof_and_register (#5)
* feat: add function verify_proof_and_register * fix: flow_test * chore: more info about transactions * feat: optimize verify_proof_and_register * fix: tx * fix(CI): increase timeout for tarpaulin --------- Co-authored-by: Steve Nguyen <[email protected]> Co-authored-by: draply <[email protected]>
- Loading branch information
1 parent
4059291
commit 242c91f
Showing
23 changed files
with
4,043 additions
and
74 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Submodule navori
updated
48 files
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub mod types; | ||
pub mod verify_proof_and_register; |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod verify_proof_and_register; |
58 changes: 58 additions & 0 deletions
58
src/contracts_caller/gps/types/verify_proof_and_register.rs
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
use std::str::FromStr; | ||
|
||
use aptos_sdk::move_types::u256::U256; | ||
use serde::Deserialize; | ||
|
||
#[derive(Debug)] | ||
pub struct VerifyProofAndRegisterData { | ||
pub proof_params: Vec<U256>, | ||
pub proof: Vec<U256>, | ||
pub task_metadata: Vec<U256>, | ||
pub cairo_aux_input: Vec<U256>, | ||
pub cairo_verifier_id: U256, | ||
pub pre_registered_facts: Vec<U256>, | ||
} | ||
|
||
#[derive(Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct VerifyProofAndRegisterDataJson { | ||
pub proof_params: Vec<String>, | ||
pub proof: Vec<String>, | ||
pub task_metadata: Vec<String>, | ||
pub cairo_aux_input: Vec<String>, | ||
pub cairo_verifier_id: String, | ||
pub pre_registered_facts: Vec<String>, | ||
} | ||
|
||
impl From<VerifyProofAndRegisterDataJson> for VerifyProofAndRegisterData { | ||
fn from(value: VerifyProofAndRegisterDataJson) -> Self { | ||
VerifyProofAndRegisterData { | ||
proof_params: value | ||
.proof_params | ||
.iter() | ||
.map(|x| U256::from_str(x).unwrap()) | ||
.collect(), | ||
proof: value | ||
.proof | ||
.iter() | ||
.map(|x| U256::from_str(x).unwrap()) | ||
.collect(), | ||
task_metadata: value | ||
.task_metadata | ||
.iter() | ||
.map(|x| U256::from_str(x).unwrap()) | ||
.collect(), | ||
cairo_aux_input: value | ||
.cairo_aux_input | ||
.iter() | ||
.map(|x| U256::from_str(x).unwrap()) | ||
.collect(), | ||
cairo_verifier_id: U256::from_str(value.cairo_verifier_id.as_str()).unwrap(), | ||
pre_registered_facts: value | ||
.pre_registered_facts | ||
.iter() | ||
.map(|x| U256::from_str(x).unwrap()) | ||
.collect(), | ||
} | ||
} | ||
} |
Oops, something went wrong.