Skip to content

Commit

Permalink
chore: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
rpalakkal committed Feb 6, 2024
1 parent f89892f commit bd6221e
Show file tree
Hide file tree
Showing 54 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["axiom-client", "axiom-client-sdk", "axiom-client-derive"]
members = ["circuit", "sdk", "sdk-derive"]
resolver = "2"

[profile.dev]
Expand Down
2 changes: 1 addition & 1 deletion axiom-client/Cargo.toml → circuit/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "axiom-client"
name = "axiom-circuit"
version = "0.1.0"
edition = "2021"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @axiom-crypto/client
# axiom-sdk-rs

This repository is split into 3 components:

- `client`: Contains the Axiom CLI interface and developer-facing AxiomCircuit exports
- `circuit`: Handles lower-level interface with Wasm circuit libraries
- `test`: Tests for the `client`
- `circuit`: Lower-level API for writing Axiom compute circuits
- `sdk`: User-friendly API for writing Axiom compute circuits
- `sdk-derive`: Procedural macros to for writing circuits with axiom-sdk
2 changes: 1 addition & 1 deletion axiom-client-derive/Cargo.toml → sdk-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "axiom-client-derive"
name = "axiom-sdk-derive"
version = "0.1.0"
edition = "2021"

Expand Down
22 changes: 11 additions & 11 deletions axiom-client-derive/src/input.rs → sdk-derive/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub fn impl_new_struct(ast: &ItemStruct) -> Result<TokenStream, TokenStream> {
.zip(field_types.iter())
.map(|(name, field_type)| {
quote! {
#name: <#field_type as axiom_client::input::raw_input::RawInput<axiom_client_sdk::Fr>>::FEType<T>,
#name: <#field_type as axiom_circuit::input::raw_input::RawInput<axiom_sdk::Fr>>::FEType<T>,
}
})
.collect();
Expand Down Expand Up @@ -128,7 +128,7 @@ pub fn impl_flatten_and_raw_input(ast: &DeriveInput) -> TokenStream {
if let GenericParam::Type(type_param) = param {
if type_param.ident == "T" {
type_param.ident = parse_quote! { F };
type_param.bounds = parse_quote! { axiom_client::axiom_eth::Field };
type_param.bounds = parse_quote! { axiom_circuit::axiom_eth::Field };
break;
}
}
Expand All @@ -138,7 +138,7 @@ pub fn impl_flatten_and_raw_input(ast: &DeriveInput) -> TokenStream {

let num_fe_tokens = field_types.iter().map(|ident| {
quote! {
<#ident as axiom_client::input::flatten::InputFlatten<T>>::NUM_FE
<#ident as axiom_circuit::input::flatten::InputFlatten<T>>::NUM_FE
}
});
let num_fe_tokens_clone = num_fe_tokens.clone();
Expand All @@ -155,25 +155,25 @@ pub fn impl_flatten_and_raw_input(ast: &DeriveInput) -> TokenStream {
.enumerate()
.map(|(index, (name, field_type))| {
quote! {
#name: <#field_type as axiom_client::input::flatten::InputFlatten<T>>::unflatten(segmented_fe[#index].clone())?,
#name: <#field_type as axiom_circuit::input::flatten::InputFlatten<T>>::unflatten(segmented_fe[#index].clone())?,
}
})
.collect();

quote! {
impl #impl_generics axiom_client::input::flatten::InputFlatten<T> for #name #ty_generics {
impl #impl_generics axiom_circuit::input::flatten::InputFlatten<T> for #name #ty_generics {
const NUM_FE: usize = #(#num_fe_tokens + )* 0;
fn flatten_vec(&self) -> Vec<T> {
let flattened = vec![#(#flatten_tokens)*];
flattened.into_iter().flatten().collect()
}

fn unflatten(vec: Vec<T>) -> anyhow::Result<Self> {
if vec.len() != <Self as axiom_client::input::flatten::InputFlatten<T>>::NUM_FE {
if vec.len() != <Self as axiom_circuit::input::flatten::InputFlatten<T>>::NUM_FE {
anyhow::bail!(
"Invalid input length: {} != {}",
vec.len(),
<Self as axiom_client::input::flatten::InputFlatten<T>>::NUM_FE
<Self as axiom_circuit::input::flatten::InputFlatten<T>>::NUM_FE
);
}

Expand All @@ -192,10 +192,10 @@ pub fn impl_flatten_and_raw_input(ast: &DeriveInput) -> TokenStream {
}
}

impl #new_impl_generics axiom_client::input::raw_input::RawInput<F> for #raw_circuit_name_ident #old_ty_generics {
impl #new_impl_generics axiom_circuit::input::raw_input::RawInput<F> for #raw_circuit_name_ident #old_ty_generics {
type FEType<T: Copy> = #name #new_ty_generics;
fn convert(&self) -> Self::FEType<F> {
use axiom_client::input::raw_input::RawInput;
use axiom_circuit::input::raw_input::RawInput;
#name {
#(#field_names: self.#field_names.convert(),)*
}
Expand All @@ -204,7 +204,7 @@ pub fn impl_flatten_and_raw_input(ast: &DeriveInput) -> TokenStream {

impl #new_impl_generics From<#raw_circuit_name_ident #old_ty_generics> for #name #new_ty_generics {
fn from(input: #raw_circuit_name_ident #old_ty_generics) -> Self {
use axiom_client::input::raw_input::RawInput;
use axiom_circuit::input::raw_input::RawInput;
#name {
#(#field_names: input.#field_names.convert(),)*
}
Expand All @@ -218,7 +218,7 @@ pub fn impl_flatten_and_raw_input(ast: &DeriveInput) -> TokenStream {
}
}

impl #old_impl_generics axiom_client_sdk::compute::AxiomComputeInput for #raw_circuit_name_ident #old_ty_generics {
impl #old_impl_generics axiom_sdk::compute::AxiomComputeInput for #raw_circuit_name_ident #old_ty_generics {
type LogicInput = #raw_circuit_name_ident #old_ty_generics;
type Input<T: Copy> = #name #ty_generics;
}
Expand Down
2 changes: 1 addition & 1 deletion axiom-client-derive/src/lib.rs → sdk-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub fn AxiomComputeInput(_args: TokenStream, input: TokenStream) -> TokenStream
#flatten

fn main() {
axiom_client_sdk::cmd::run_cli::<#name>();
axiom_sdk::cmd::run_cli::<#name>();
}
}
.into()
Expand Down
6 changes: 3 additions & 3 deletions axiom-client-sdk/Cargo.toml → sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "axiom-client-sdk"
name = "axiom-sdk"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
axiom-client = { path = "../axiom-client" }
axiom-client-derive = { path = "../axiom-client-derive" }
axiom-circuit = { path = "../circuit" }
axiom-sdk-derive = { path = "../sdk-derive" }
ethers = "2.0"
anyhow = "1.0.75"
serde = { version = "1.0", features = ["derive"] }
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::fmt::Debug;

use axiom_client_sdk::{
use axiom_sdk::{
axiom::{AxiomAPI, AxiomComputeFn, AxiomResult},
halo2_base::{
gates::{GateChip, GateInstructions, RangeInstructions},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{fmt::Debug, str::FromStr};

use axiom_client_sdk::{
use axiom_sdk::{
axiom::{AxiomAPI, AxiomComputeFn, AxiomResult},
halo2_base::AssignedValue,
subquery::{AccountField, HeaderField, TxField},
Expand Down
2 changes: 1 addition & 1 deletion axiom-client-sdk/readme.md → sdk/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# axiom-client-sdk
# axiom-sdk

## Usage

Expand Down
2 changes: 1 addition & 1 deletion axiom-client-sdk/src/api.rs → sdk/src/api.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::{Arc, Mutex};

use axiom_client::{
use axiom_circuit::{
axiom_codec::HiLo,
axiom_eth::{
halo2_base::{gates::RangeChip, AssignedValue, Context},
Expand Down
2 changes: 1 addition & 1 deletion axiom-client-sdk/src/cmd.rs → sdk/src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
path::PathBuf,
};

use axiom_client::{
use axiom_circuit::{
axiom_eth::{
halo2_base::{gates::circuit::BaseCircuitParams, AssignedValue},
halo2_proofs::{plonk::ProvingKey, SerdeFormat},
Expand Down
2 changes: 1 addition & 1 deletion axiom-client-sdk/src/compute.rs → sdk/src/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{
sync::{Arc, Mutex},
};

use axiom_client::{
use axiom_circuit::{
axiom_eth::{
halo2_base::{
gates::{circuit::BaseCircuitParams, RangeChip},
Expand Down
6 changes: 3 additions & 3 deletions axiom-client-sdk/src/lib.rs → sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#![feature(associated_type_defaults)]
mod api;

pub use axiom_client::{axiom_codec::HiLo, axiom_eth::halo2curves::bn256::Fr};
pub use axiom_circuit::{axiom_codec::HiLo, axiom_eth::halo2curves::bn256::Fr};

pub(crate) mod utils;
pub use axiom_client::{self, axiom_eth::halo2_base};
pub use axiom_client_derive::AxiomComputeInput;
pub use axiom_circuit::{self, axiom_eth::halo2_base};
pub use axiom_sdk_derive::AxiomComputeInput;

pub mod axiom {
pub use crate::{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::{Arc, Mutex};

use axiom_client::{
use axiom_circuit::{
axiom_codec::HiLo,
axiom_eth::halo2_base::{AssignedValue, Context},
subquery::{caller::SubqueryCaller, types::AssignedAccountSubquery, AccountField},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::{Arc, Mutex};

use axiom_client::{
use axiom_circuit::{
axiom_codec::{special_values::HEADER_LOGS_BLOOM_FIELD_IDX_OFFSET, HiLo},
axiom_eth::halo2_base::{AssignedValue, Context},
subquery::{caller::SubqueryCaller, types::AssignedHeaderSubquery, HeaderField},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::{Arc, Mutex};

use axiom_client::{
use axiom_circuit::{
axiom_codec::{constants::MAX_SOLIDITY_MAPPING_KEYS, HiLo},
axiom_eth::halo2_base::{AssignedValue, Context},
subquery::{caller::SubqueryCaller, types::AssignedSolidityNestedMappingSubquery},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ pub mod receipt;
pub mod storage;
pub mod tx;

pub use axiom_client::subquery::{AccountField, HeaderField, ReceiptField, TxField};
pub use axiom_circuit::subquery::{AccountField, HeaderField, ReceiptField, TxField};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::{Arc, Mutex};

use axiom_client::{
use axiom_circuit::{
axiom_codec::{
special_values::{
RECEIPT_ADDRESS_IDX, RECEIPT_DATA_IDX_OFFSET, RECEIPT_LOGS_BLOOM_IDX_OFFSET,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::{Arc, Mutex};

use axiom_client::{
use axiom_circuit::{
axiom_codec::HiLo,
axiom_eth::halo2_base::{AssignedValue, Context},
subquery::{caller::SubqueryCaller, types::AssignedStorageSubquery},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::{Arc, Mutex};

use axiom_client::{
use axiom_circuit::{
axiom_codec::{
special_values::{TX_CALLDATA_IDX_OFFSET, TX_CONTRACT_DATA_IDX_OFFSET},
HiLo,
Expand Down
4 changes: 2 additions & 2 deletions axiom-client-sdk/src/utils/mod.rs → sdk/src/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#[macro_export]
macro_rules! axiom_compute_tests {
($input_struct:ident, $inputs:ident, $k: expr) => {
fn params() -> axiom_client::axiom_eth::halo2_base::gates::circuit::BaseCircuitParams {
axiom_client::axiom_eth::halo2_base::gates::circuit::BaseCircuitParams {
fn params() -> axiom_circuit::axiom_eth::halo2_base::gates::circuit::BaseCircuitParams {
axiom_circuit::axiom_eth::halo2_base::gates::circuit::BaseCircuitParams {
k: $k,
num_advice_per_phase: vec![4],
num_fixed: 1,
Expand Down

0 comments on commit bd6221e

Please sign in to comment.