-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from HerodotusDev/refactor
Refactor
- Loading branch information
Showing
54 changed files
with
384 additions
and
463 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: CI | ||
on: | ||
push: | ||
merge_group: | ||
pull_request: | ||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: software-mansion/setup-scarb@v1 | ||
- run: scarb fmt --check | ||
- run: scarb test |
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,2 +1 @@ | ||
scarb 2.3.1 | ||
starknet-foundry 0.11.0 | ||
scarb 2.4.0 |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,28 +1,3 @@ | ||
[workspace] | ||
members = [ | ||
"src/structs", | ||
"src/verifier", | ||
"src/channel", | ||
"src/common", | ||
"contract/channel_contract", | ||
] | ||
[package] | ||
name = "cairo_verifier" | ||
version = "0.1.0" | ||
|
||
[workspace.dependencies] | ||
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.8.0" } | ||
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.11.0" } | ||
cairo_blake2s = { git = "https://github.com/HerodotusDev/cairo-blake2s.git" } | ||
starknet = "2.3.1" | ||
structs = { path = "src/structs" } | ||
verifier = { path = "src/verifier" } | ||
channel = { path = "src/channel" } | ||
common = { path = "src/common" } | ||
|
||
[tool.snforge] | ||
exit_first = true | ||
|
||
# Default profile | ||
[tool.sncast] | ||
account = "cairo1_verifier" | ||
url = "https://devnet.starknet.visoft.solutions" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
mod channel; | ||
|
||
#[cfg(test)] | ||
mod tests; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mod test_channel; |
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,33 @@ | ||
use cairo_verifier::channel::channel::ChannelTrait; | ||
|
||
#[test] | ||
#[available_gas(9999999999)] | ||
fn test_random_felts_to_prover() { | ||
let mut channel = ChannelTrait::new( | ||
u256 { low: 0xf7685ebd40e852b164633a4acbd3244c, high: 0xe8e77626586f73b955364c7b4bbf0bb7 } | ||
); | ||
let random = channel.random_felts_to_prover(3); | ||
assert( | ||
*random[0] == 3199910790894706855027093840383592257502485581126271436027309705477370004002, | ||
'invalid random felts[0]' | ||
); | ||
assert( | ||
*random[1] == 2678311171676075552444787698918310126938416157877134200897080931937186268438, | ||
'invalid random felts[1]' | ||
); | ||
assert( | ||
*random[2] == 2409925148191156067407217062797240658947927224212800962983204460004996362724, | ||
'invalid random felts[2]' | ||
); | ||
} | ||
|
||
#[test] | ||
#[available_gas(9999999999)] | ||
fn test_random_uint256_to_prover() { | ||
let mut channel = ChannelTrait::new(0); | ||
let random = channel.random_uint256_to_prover(); | ||
assert( | ||
random == 0xae09db7cd54f42b490ef09b6bc541af688e4959bb8c53f359a6f56e38ab454a3, | ||
'invalid random uint256' | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
mod blake2s; | ||
mod flip_endiannes; | ||
mod from_span; | ||
mod horner_eval; | ||
mod to_array; | ||
mod from_span; | ||
mod flip_endiannes; | ||
mod blake2s; | ||
|
||
#[cfg(test)] | ||
mod tests; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.