From 3633e9be3421158cc8e19d7f883e35868e0b2903 Mon Sep 17 00:00:00 2001 From: balisdev Date: Sun, 21 Jun 2026 19:21:48 +0100 Subject: [PATCH] refactor: rename crate from nodus-amm to nodus-protocol-amm - Updated Cargo.toml package name to align with repository - Updated all imports across test files - Updated WASM artifact paths in CI workflow - Updated build and deploy scripts This better reflects the project structure and makes the crate name consistent with the GitHub repository name 'Nodus-Protocol-Smart-Contract'. Closes #91 --- .github/workflows/ci.yml | 4 ++-- Cargo.toml | 2 +- scripts/build.sh | 2 +- scripts/deploy.sh | 2 +- tests/fuzz_tests.rs | 4 ++-- tests/integration_tests.rs | 2 +- tests/unit_tests.rs | 8 ++++---- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 139567d..b969c86 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,8 +22,8 @@ jobs: - name: Upload WASM artifact uses: actions/upload-artifact@v4 with: - name: nodus-amm-wasm - path: target/wasm32v1-none/release/nodus_amm.wasm + name: nodus-protocol-amm-wasm + path: target/wasm32v1-none/release/nodus_protocol_amm.wasm test: name: Test (unit + integration) diff --git a/Cargo.toml b/Cargo.toml index 0c6f45d..2393866 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nodus-amm" +name = "nodus-protocol-amm" version = "0.1.0" authors = ["Nodus Protocol Team"] edition = "2021" diff --git a/scripts/build.sh b/scripts/build.sh index a722471..03e1106 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -10,6 +10,6 @@ fi stellar contract build -WASM="target/wasm32-unknown-unknown/release/nodus_amm.wasm" +WASM="target/wasm32-unknown-unknown/release/nodus_protocol_amm.wasm" echo "Build complete: $WASM" ls -lh "$WASM" diff --git a/scripts/deploy.sh b/scripts/deploy.sh index aab597f..cf511f6 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -24,7 +24,7 @@ if ! command -v stellar &>/dev/null; then exit 1 fi -WASM="target/wasm32-unknown-unknown/release/nodus_amm.wasm" +WASM="target/wasm32-unknown-unknown/release/nodus_protocol_amm.wasm" if [ ! -f "$WASM" ]; then echo "WASM not found. Run: make build" exit 1 diff --git a/tests/fuzz_tests.rs b/tests/fuzz_tests.rs index cc0d09d..3cab225 100644 --- a/tests/fuzz_tests.rs +++ b/tests/fuzz_tests.rs @@ -1,6 +1,6 @@ #[cfg(test)] mod fuzz_math { - use nodus_amm::math; + use nodus_protocol_amm::math; #[test] fn fuzz_amount_out_never_exceeds_reserve_out() { @@ -66,7 +66,7 @@ mod fuzz_math { #[test] fn fuzz_k_invariant_holds_across_swap_sizes() { - use nodus_amm::liquidity_pool; + use nodus_protocol_amm::liquidity_pool; let reserve = 1_000_000i128; for amount_in in [100i128, 1_000, 5_000, 50_000, 200_000] { let amount_out = math::get_amount_out(amount_in, reserve, reserve).unwrap(); diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index dad7002..434cf0d 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -1,7 +1,7 @@ #[cfg(test)] #[cfg(feature = "testutils")] mod integration { - use nodus_amm::{NodusAmm, NodusAmmClient}; + use nodus_protocol_amm::{NodusAmm, NodusAmmClient}; use soroban_sdk::{ testutils::{Address as _, Ledger as _}, Address, Env, diff --git a/tests/unit_tests.rs b/tests/unit_tests.rs index 9055adc..0c3c339 100644 --- a/tests/unit_tests.rs +++ b/tests/unit_tests.rs @@ -1,6 +1,6 @@ #[cfg(test)] mod math_tests { - use nodus_amm::math; + use nodus_protocol_amm::math; #[test] fn get_amount_out_standard_case() { @@ -67,7 +67,7 @@ mod math_tests { #[cfg(test)] mod liquidity_pool_tests { - use nodus_amm::liquidity_pool; + use nodus_protocol_amm::liquidity_pool; #[test] fn calculate_initial_liquidity_geometric_mean() { @@ -101,7 +101,7 @@ mod liquidity_pool_tests { let r0 = 100_000i128; let r1 = 100_000i128; let amount_in = 1_000i128; - let amount_out = nodus_amm::math::get_amount_out(amount_in, r0, r1).unwrap(); + let amount_out = nodus_protocol_amm::math::get_amount_out(amount_in, r0, r1).unwrap(); let b0 = r0 + amount_in; let b1 = r1 - amount_out; assert!(liquidity_pool::verify_k_invariant(b0, b1, amount_in, 0, r0, r1).is_ok()); @@ -123,7 +123,7 @@ mod liquidity_pool_tests { #[cfg(test)] #[cfg(feature = "testutils")] mod soroban_contract_tests { - use nodus_amm::{NodusAmm, NodusAmmClient}; + use nodus_protocol_amm::{NodusAmm, NodusAmmClient}; use soroban_sdk::{ testutils::{Address as _, Ledger as _}, Address, Env,