Skip to content

Commit

Permalink
made tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
matzayonc committed May 28, 2024
1 parent b851d47 commit c94fd47
Show file tree
Hide file tree
Showing 11 changed files with 413 additions and 392 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions bin/saya/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ tokio.workspace = true
tracing-subscriber.workspace = true
tracing.workspace = true
url.workspace = true

[dev-dependencies]
cairo-proof-parser.workspace = true
starknet-crypto.workspace = true
1 change: 1 addition & 0 deletions bin/saya/input.json

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions bin/saya/src/args/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ impl TryFrom<SayaArgs> for SayaConfig {

Ok(SayaConfig {
katana_rpc: args.rpc_url,
prover_url: args.url,
prover_key,
url: args.url,
private_key: prover_key,
start_block: args.start_block,
batch_size: args.batch_size,
data_availability: da_config,
Expand Down Expand Up @@ -162,7 +162,8 @@ mod tests {
config_file: Some(config_file_path.clone()),
rpc_url: Url::parse("http://localhost:5050").unwrap(),
url: Url::parse("http://localhost:5050").unwrap(),
private_key: "d0fa91f4949e9a777ebec071ca3ca6acc1f5cd6c6827f123b798f94e73425027".into(),
private_key: "0xd0fa91f4949e9a777ebec071ca3ca6acc1f5cd6c6827f123b798f94e73425027"
.into(),
json_log: false,
start_block: 0,
batch_size: 4,
Expand All @@ -183,11 +184,11 @@ mod tests {
let config: SayaConfig = args.try_into().unwrap();

assert_eq!(config.katana_rpc.as_str(), "http://localhost:5050/");
assert_eq!(config.prover_url.as_str(), "http://localhost:1234/");
assert_eq!(config.url.as_str(), "http://localhost:1234/");
assert_eq!(config.batch_size, 4);
assert_eq!(
config.prover_key.signing_key_as_hex_string(),
"d0fa91f4949e9a777ebec071ca3ca6acc1f5cd6c6827f123b798f94e73425027"
config.private_key.signing_key_as_hex_string(),
"0xd0fa91f4949e9a777ebec071ca3ca6acc1f5cd6c6827f123b798f94e73425027"
);
assert_eq!(config.start_block, 0);
if let Some(DataAvailabilityConfig::Celestia(celestia_config)) = config.data_availability {
Expand Down
4 changes: 3 additions & 1 deletion bin/saya/src/args/test_saya_config_file.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"katana_rpc": "http://localhost:5050",
"prover_url": "http://localhost:1234",
"url": "http://localhost:1234",
"private_key": "0xd0fa91f4949e9a777ebec071ca3ca6acc1f5cd6c6827f123b798f94e73425027",
"batch_size": 4,
"world_address": "0x332b8ff41b1b026991fa9b7f0ec352909f8bc33416b65a80527edc988a9b082",
"fact_registry_address": "0x217746a5f74c2e5b6fa92c97e902d8cd78b1fabf1e8081c4aa0d2fe159bc0eb",
"start_block": 0,
Expand Down
3 changes: 3 additions & 0 deletions bin/saya/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ use tokio::signal::ctrl_c;

mod args;

#[cfg(test)]
mod tests;

use args::SayaArgs;

#[tokio::main]
Expand Down
Loading

0 comments on commit c94fd47

Please sign in to comment.