refactor: rename nssa/nssa_core → lee/lee_core

Follow the spel fork's `nssa → lee` refactor (chore/update-lez): the
`#[lez_program]` macro now emits `lee_core::…` paths, so the crate must be
referenced by its real name rather than the `nssa_core` alias.

- Cargo.toml: rename the `nssa_core`/`nssa` dep keys to `lee_core`/`lee` and
  drop the now-redundant `package = "lee_core"`/`package = "lee"` aliases
  (dep name == package name).
- Rust: `nssa_core::` → `lee_core::`, `nssa::` → `lee::` across programs,
  modules, and tools.
- Docs: update the library reference in CLAUDE.md and README.md.

Also drop the dead `NSSA_WALLET_HOME_DIR` env var — superseded by
`LEE_WALLET_HOME_DIR`, which is the only wallet-home var any v0.2.x wallet
reads — from the test tooling (setup-amm-testnet.sh, custom-token.mjs,
run-basecamp-e2e.sh) and docs.

Closes #225
This commit is contained in:
r4bbit
2026-08-26 12:30:36 +02:00
parent 1d88e6f3c4
commit 75a99d1224
90 changed files with 141 additions and 146 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ amm_core = { workspace = true }
borsh = { workspace = true }
clock_core = { git = "https://github.com/logos-blockchain/logos-execution-zone.git", tag = "v0.2.4" }
hex = "0.4"
nssa_core = { workspace = true }
lee_core = { workspace = true }
risc0-binfmt = { version = "=3.0.4", default-features = false }
risc0-zkvm = { workspace = true }
serde = { workspace = true }
+1 -1
View File
@@ -1,6 +1,6 @@
use std::str::FromStr;
use nssa_core::{
use lee_core::{
account::{Account, AccountId, Data, Nonce},
program::ProgramId,
};
+1 -1
View File
@@ -1,5 +1,5 @@
use amm_core::{compute_config_pda, AmmConfig};
use nssa_core::{account::Account, program::ProgramId};
use lee_core::{account::Account, program::ProgramId};
use serde_json::{json, Value};
use super::{ConfigAccountRequest, ConfigIdRequest};
+1 -1
View File
@@ -1,6 +1,6 @@
use std::collections::BTreeSet;
use nssa_core::{account::AccountId, program::ProgramId};
use lee_core::{account::AccountId, program::ProgramId};
use serde_json::{json, Value};
use token_core::TokenDefinition;
+1 -1
View File
@@ -1,4 +1,4 @@
use nssa_core::{account::AccountId, program::ProgramId};
use lee_core::{account::AccountId, program::ProgramId};
use token_core::TokenHolding;
use crate::account::{decode_account, AccountRead};
+3 -3
View File
@@ -15,7 +15,7 @@ use amm_core::{
isqrt_product, mul_div_floor, spot_price_q64_64, PoolDefinition, FEE_BPS_DENOMINATOR,
MINIMUM_LIQUIDITY,
};
use nssa_core::account::AccountId;
use lee_core::account::AccountId;
use serde_json::{json, Value};
use super::{
@@ -633,7 +633,7 @@ pub(super) fn sync_reserves_plan(request: SyncReservesPlanRequest) -> Result<Val
#[cfg(test)]
mod tests {
use amm_core::{compute_config_pda, compute_pool_pda, compute_vault_pda, AmmConfig};
use nssa_core::account::{Account, AccountId, Data};
use lee_core::account::{Account, AccountId, Data};
use super::*;
use crate::account::{account_read, AccountRead};
@@ -657,7 +657,7 @@ mod tests {
}
/// A valid AMM config account read so `derive_pair` succeeds in plan tests.
fn valid_config(amm: nssa_core::program::ProgramId) -> AccountRead {
fn valid_config(amm: lee_core::program::ProgramId) -> AccountRead {
let token_program = parse_program_id(&"01".repeat(32)).unwrap();
let twap_program = parse_program_id(&"02".repeat(32)).unwrap();
let account = Account {
+1 -1
View File
@@ -1,5 +1,5 @@
use amm_core::Instruction;
use nssa_core::account::AccountId;
use lee_core::account::AccountId;
use serde_json::{json, Value};
use twap_oracle_core::{compute_oracle_price_account_pda, compute_price_observations_pda};
+1 -1
View File
@@ -3,7 +3,7 @@ use amm_core::{
compute_vault_pda,
};
use clock_core::CLOCK_01_PROGRAM_ACCOUNT_ID;
use nssa_core::{account::AccountId, program::ProgramId};
use lee_core::{account::AccountId, program::ProgramId};
use serde_json::{json, Value};
use twap_oracle_core::compute_current_tick_account_pda;
+3 -3
View File
@@ -7,7 +7,7 @@ use amm_core::{
compute_pool_pda, mul_div_ceil, mul_div_floor, price_impact_bps, swap_exact_in_amounts,
swap_exact_out_amounts, PoolDefinition, FEE_BPS_DENOMINATOR,
};
use nssa_core::account::AccountId;
use lee_core::account::AccountId;
use risc0_binfmt::ProgramBinary;
use serde_json::{json, Value};
@@ -429,7 +429,7 @@ pub(super) fn swap_exact_out_plan(request: SwapExactOutPlanRequest) -> Result<Va
pub(super) fn program_id(request: ProgramIdRequest) -> Result<Value, String> {
let elf = hex::decode(&request.elf).map_err(|error| format!("invalid elf hex: {error}"))?;
let binary = ProgramBinary::decode(&elf).map_err(|error| format!("{error:?}"))?;
let image_id: nssa_core::program::ProgramId = binary
let image_id: lee_core::program::ProgramId = binary
.compute_image_id()
.map_err(|error| format!("{error:?}"))?
.into();
@@ -439,7 +439,7 @@ pub(super) fn program_id(request: ProgramIdRequest) -> Result<Value, String> {
#[cfg(test)]
mod tests {
use amm_core::PoolDefinition;
use nssa_core::account::AccountId;
use lee_core::account::AccountId;
use super::*;
use crate::account::{AccountRead, WalletAccount};
+1 -1
View File
@@ -4,7 +4,7 @@ use amm_core::{
compute_vault_pda, isqrt_product, AmmConfig, Instruction, PoolDefinition, MINIMUM_LIQUIDITY,
};
use clock_core::CLOCK_01_PROGRAM_ACCOUNT_ID;
use nssa_core::{
use lee_core::{
account::{Account, AccountId, Data, Nonce},
program::ProgramId,
};
+1 -1
View File
@@ -40,7 +40,7 @@ pub(super) fn token_holdings(request: TokenHoldingsRequest) -> Result<Value, Str
#[cfg(test)]
mod tests {
use amm_core::{compute_config_pda, AmmConfig};
use nssa_core::{
use lee_core::{
account::{Account, AccountId, Data},
program::ProgramId,
};
+1 -1
View File
@@ -8,7 +8,7 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
hex = "0.4"
nssa_core = { workspace = true }
lee_core = { workspace = true }
risc0-binfmt = { version = "=3.0.4", default-features = false }
risc0-zkvm = { workspace = true }
serde = { workspace = true }
+1 -1
View File
@@ -1,4 +1,4 @@
use nssa_core::{
use lee_core::{
account::{Account, AccountId, Data, Nonce},
program::ProgramId,
};
+1 -1
View File
@@ -1,4 +1,4 @@
use nssa_core::{
use lee_core::{
account::{Account, AccountId},
program::ProgramId,
};
+1 -1
View File
@@ -54,6 +54,6 @@ impl fmt::Display for TokenApiError {
impl Error for TokenApiError {}
fn parse_token_program_id(value: &str) -> Result<nssa_core::program::ProgramId, TokenApiError> {
fn parse_token_program_id(value: &str) -> Result<lee_core::program::ProgramId, TokenApiError> {
parse_program_id(value).map_err(|_| TokenApiError::new("bad_request"))
}
+3 -3
View File
@@ -1,4 +1,4 @@
use nssa_core::account::AccountId;
use lee_core::account::AccountId;
use risc0_binfmt::ProgramBinary;
use serde_json::{json, Value};
use token_core::{Instruction, MetadataStandard, NewTokenDefinition, NewTokenMetadata};
@@ -18,7 +18,7 @@ use crate::account::{account_id_from_hex, account_id_hex, program_id_bytes};
pub fn program_id(request: ProgramIdRequest) -> TokenResult {
let elf = hex::decode(&request.elf).map_err(|_| TokenApiError::new("bad_request"))?;
let binary = ProgramBinary::decode(&elf).map_err(|_| TokenApiError::new("bad_request"))?;
let image_id: nssa_core::program::ProgramId = binary
let image_id: lee_core::program::ProgramId = binary
.compute_image_id()
.map_err(|_| TokenApiError::new("backend_error"))?
.into();
@@ -298,7 +298,7 @@ fn reject_zero_account_id(account_id: AccountId, code: &'static str) -> Result<(
}
fn plan_response<const N: usize>(
program_id: nssa_core::program::ProgramId,
program_id: lee_core::program::ProgramId,
account_ids: [AccountId; N],
signing_requirements: [bool; N],
instruction: Instruction,
+1 -1
View File
@@ -1,4 +1,4 @@
use nssa_core::{
use lee_core::{
account::{Account, AccountId, Data, Nonce},
program::ProgramId,
};