Skip to content

Commit

Permalink
renames
Browse files Browse the repository at this point in the history
  • Loading branch information
Autoparallel committed Sep 10, 2024
1 parent a10b097 commit 0805aa5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion circuits/test/http/codegen.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function executeCodegen(inputFilename: string, outputFilename: string) {
return new Promise((resolve, reject) => {
const inputPath = join(__dirname, "..", "..", "..", "examples", "lockfile", inputFilename);

const codegen = spawn("cargo", ["run", "http-lock", "--lockfile", inputPath, "--output-filename", outputFilename]);
const codegen = spawn("cargo", ["run", "http", "--lockfile", inputPath, "--output-filename", outputFilename]);

codegen.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
Expand Down
2 changes: 1 addition & 1 deletion circuits/test/json/extractor/extractor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function executeCodegen(inputFilename: string, outputFilename: string) {
return new Promise((resolve, reject) => {
const inputPath = join(__dirname, "..", "..", "..", "..", "examples", "extractor", inputFilename);

const codegen = spawn("cargo", ["run", "extractor", "--template", inputPath, "--output-filename", outputFilename]);
const codegen = spawn("cargo", ["run", "json", "--template", inputPath, "--output-filename", outputFilename]);

codegen.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
Expand Down
2 changes: 1 addition & 1 deletion src/http_lock.rs → src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ fn locker_circuit(
}

// TODO: This needs to codegen a circuit now.
pub fn http_lock(args: HttpLockArgs) -> Result<(), Box<dyn Error>> {
pub fn http_lock(args: HttpArgs) -> Result<(), Box<dyn Error>> {
let data = std::fs::read(&args.lockfile)?;

let http_data: HttpData = serde_json::from_slice(&data)?;
Expand Down
2 changes: 1 addition & 1 deletion src/extractor.rs → src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ fn parse_json_request(
Ok(())
}

pub fn extractor(args: ExtractorArgs) -> Result<(), Box<dyn std::error::Error>> {
pub fn extractor(args: JsonArgs) -> Result<(), Box<dyn std::error::Error>> {
let data = std::fs::read(&args.template)?;
let json_data: Data = serde_json::from_slice(&data)?;

Expand Down
16 changes: 8 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use clap::{Parser, Subcommand};
use serde::{Deserialize, Serialize};
use std::{error::Error, path::PathBuf};

pub mod extractor;
pub mod http_lock;
pub mod http;
pub mod json;
pub mod witness;

#[derive(Parser, Debug)]
Expand All @@ -16,8 +16,8 @@ pub struct Args {
#[derive(Subcommand, Debug)]
pub enum Command {
Witness(WitnessArgs),
Extractor(ExtractorArgs),
HttpLock(HttpLockArgs),
Json(JsonArgs),
Http(HttpArgs),
}

#[derive(Parser, Debug)]
Expand Down Expand Up @@ -45,7 +45,7 @@ pub enum WitnessSubcommand {
}

#[derive(Parser, Debug)]
pub struct ExtractorArgs {
pub struct JsonArgs {
/// Path to the JSON file
#[arg(long)]
template: PathBuf,
Expand All @@ -59,7 +59,7 @@ pub struct ExtractorArgs {
}

#[derive(Parser, Debug)]
pub struct HttpLockArgs {
pub struct HttpArgs {
/// Path to the JSON file
#[arg(long)]
lockfile: PathBuf,
Expand All @@ -74,8 +74,8 @@ pub struct HttpLockArgs {

pub fn main() -> Result<(), Box<dyn Error>> {
match Args::parse().command {
Command::Extractor(args) => extractor::extractor(args),
Command::Witness(args) => witness::witness(args),
Command::HttpLock(args) => http_lock::http_lock(args),
Command::Json(args) => json::extractor(args),
Command::Http(args) => http::http_lock(args),
}
}

0 comments on commit 0805aa5

Please sign in to comment.