chore(tech-debt): phase 4#106
Merged
Merged
Conversation
…notes
Net: +256 / -454. The 200-line shrink lands almost entirely in the
library; the only net additions are the REPL / quickstart updates that
construct `Wallet`s inline (the legacy `privkey: String` API was a
single arg; the curve-aware API takes `&Wallet`, so call sites grow a
bit) and the CHANGELOG entries.
Removed (breaking, pre-1.0):
- The legacy `privkey: String` wrappers around the curve-agnostic
trading and auth APIs. The `_with_wallet` family is the only public
shape now. Specifically deleted:
- commands::trading::send_order::send_order
- commands::trading::cancel_order::call_cancel_order
- commands::trading::cancel_order::call_cancel_order_from_config
- commands::trading::deposit::call_deposit_from_config
- commands::trading::withdraw::call_withdraw_from_config
- commands::trading::balance::balance_from_config
- commands::auth::authenticate_with_signature
- The dead-code legacy two-chain pretty-printer
`commands::trading::balance::balance` plus its private-key-derived
helpers (`call_get_balance`, `call_get_locked_balance`,
`call_get_erc20_balance`, `call_get_native_balance`) and the
`balance_table` helper. The address-based `*_for_address` variants
+ `format_balance` stay — aspens-admin uses them.
- The `chain_client::derive_associated_token_account` re-export. The
function still lives at `aspens::solana::derive_associated_token_account`.
Updated:
- aspens-repl: uses the curve-aware `_with_wallet` API everywhere.
Wallet construction is centralised behind a new
`load_trader_wallet_or_complain` helper; each call site wraps the
library call in `async move` so the executor's `'static` requirement
is satisfied.
- aspens-admin: `Login` flow now builds a Wallet and calls
`auth::authenticate_with_wallet` directly instead of going through
the deleted `authenticate_with_signature` wrapper.
- aspens/examples/quickstart.rs: same pattern. The example re-builds
a fresh Wallet inside each `async move` block because Wallet is
intentionally not Clone (Solana keypairs).
- CLAUDE.md: the "legacy `privkey: String` functions still exist as
thin wrappers" paragraph is now accurate — they don't.
Not removed (audit was wrong):
- `aspens-cli` does use the `log` dep (`log::LevelFilter` conversion
from clap-verbosity in main.rs:390-395). The audit's "unused log"
item was incorrect.
All gates green locally:
- cargo test --workspace --all-features
- cargo test -p aspens --no-default-features --features evm,solana
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo deny --workspace check
- RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --all-features
- cargo fmt --all -- --check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Retire legacy privkey wrappers and stale notes
Net: +256 / -454. The 200-line shrink lands almost entirely in the library; the only net additions are the REPL / quickstart updates that construct
Wallets inline (the legacyprivkey: StringAPI was a single arg; the curve-aware API takes&Wallet, so call sites grow a bit) and the CHANGELOG entries.Removed (breaking, pre-1.0):
privkey: Stringwrappers around the curve-agnostic trading and auth APIs. The_with_walletfamily is the only public shape now. Specifically deleted:commands::trading::balance::balanceplus its private-key-derived helpers (call_get_balance,call_get_locked_balance,call_get_erc20_balance,call_get_native_balance) and thebalance_tablehelper. The address-based*_for_addressvariantsformat_balancestay — aspens-admin uses them.chain_client::derive_associated_token_accountre-export. The function still lives ataspens::solana::derive_associated_token_account.Updated:
_with_walletAPI everywhere. Wallet construction is centralised behind a newload_trader_wallet_or_complainhelper; each call site wraps the library call inasync moveso the executor's'staticrequirement is satisfied.Loginflow now builds a Wallet and callsauth::authenticate_with_walletdirectly instead of going through the deletedauthenticate_with_signaturewrapper.async moveblock because Wallet is intentionally not Clone (Solana keypairs).privkey: Stringfunctions still exist as thin wrappers" paragraph is now accurate — they don't.Not removed (audit was wrong):
aspens-clidoes use thelogdep (log::LevelFilterconversion from clap-verbosity in main.rs:390-395). The audit's "unused log" item was incorrect.All gates green locally: