Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,3 @@ For automated contributors specifically:
- Integration tests stay in the crate's `tests/` directory.
- OpenHuman's `scripts/externalize-inline-tests.mjs <repo-root> --write` moves
inline test modules out mechanically; without `--write` it only reports.
- Existing `test.rs` and `<module>_test.rs` files predate this rule. Rename each
to `<module>_tests.rs` (keep its `mod` name, add the `#[path]` attribute) the
next time you touch it.
1 change: 1 addition & 0 deletions crates/tinywallet-bus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,5 @@ pub use tinywallet_crypto::{Chain, Error, Result};
pub use version::{CONTRACT_VERSION, is_compatible};

#[cfg(test)]
#[path = "lib_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-bus/src/wire/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ pub struct Utxo {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;

// ---------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions crates/tinywallet-crypto/src/address/btc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,4 +290,5 @@ fn wrong_network(address: &str, reason: &str) -> Error {
}

#[cfg(test)]
#[path = "btc/btc_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-crypto/src/address/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,5 @@ fn prefixed(body: &str) -> String {
}

#[cfg(test)]
#[path = "evm/evm_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-crypto/src/address/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,5 @@ pub fn validate(chain: Chain, address: &str) -> Result<String> {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-crypto/src/address/solana.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,5 @@ pub fn encode(bytes: &[u8; ADDRESS_BYTES]) -> String {
}

#[cfg(test)]
#[path = "solana/solana_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-crypto/src/address/tron.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,5 @@ pub fn encode(bytes: &[u8; ADDRESS_BYTES]) -> Result<String> {
}

#[cfg(test)]
#[path = "tron/tron_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-crypto/src/asset/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,4 +418,5 @@ pub fn networks(solana: SolanaCluster) -> Vec<Network> {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-crypto/src/chain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@ impl FromStr for Chain {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-crypto/src/error/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@ pub enum Error {
pub type Result<T> = std::result::Result<T, Error>;

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-crypto/src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,5 @@ pub fn decode<T: serde::de::DeserializeOwned>(
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
2 changes: 1 addition & 1 deletion crates/tinywallet-crypto/src/tx/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,5 @@ fn take_exact<'a>(input: &mut &'a [u8], length: usize) -> Result<&'a [u8]> {
}

#[cfg(test)]
#[path = "proto/test.rs"]
#[path = "proto/proto_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-module/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -804,4 +804,5 @@ mod exports {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-web3/src/crypto/abi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ fn flatten(error: &Error, to_address: &str, amount_raw: &str) -> String {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-web3/src/crypto/chains/btc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,5 @@ pub(crate) async fn lookup_tx(engine: &WalletEngine, hash: &str) -> Result<TxLoo
}

#[cfg(test)]
#[path = "mod_tests.rs"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update documentation for renamed test files

After changing these modules to load *_tests.rs, CONTRIBUTING.md:32 still directs contributors to put unit tests in test.rs, and crates/tinywallet-web3/README.md:101 says the same. Those instructions now prescribe filenames that the repository explicitly forbids, so the contributor guide and crate README should be updated as part of this rename.

AGENTS.md reference: AGENTS.md:L305-L306

Useful? React with 👍 / 👎.

mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-web3/src/crypto/chains/evm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,4 +367,5 @@ pub(crate) async fn lookup_tx(
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-web3/src/crypto/chains/solana/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,5 @@ pub(crate) async fn execute_solana_quote(
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-web3/src/crypto/chains/solana/wire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,5 @@ pub(super) fn build_spl_transfer_message(
}

#[cfg(test)]
#[path = "wire/wire_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-web3/src/crypto/chains/tron/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,4 +470,5 @@ pub(crate) async fn lookup_tx(engine: &WalletEngine, hash: &str) -> Result<TxLoo
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-web3/src/crypto/defaults/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ pub use types::{
};

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-web3/src/crypto/execution/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ pub(crate) use validate::validate_calldata;
const LOG_PREFIX: &str = "[wallet]";

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-web3/src/crypto/execution/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,5 @@ pub fn hex_to_bytes(value: &str) -> Result<Vec<u8>, String> {
}

#[cfg(test)]
#[path = "validate/validate_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-web3/src/crypto/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@ impl Web3Service {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-web3/src/crypto/service/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,5 @@ impl Web3Service {
}

#[cfg(test)]
#[path = "ops/ops_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-web3/src/crypto/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ pub use engine::{WalletEngine, WalletSeams};
pub use types::{WalletAccount, WalletChain, WalletSetupSource, WalletStatus};

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-web3/src/quote/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ pub use tool::to_tool_result;
pub use types::{QuoteOwner, Quoted, WALLET_NOT_CONFIGURED_MESSAGE};

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-web3/src/seams/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ impl QuoteScope for NoQuoteScope {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-web3/src/test_support/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ pub(crate) fn init() {
}

#[cfg(test)]
#[path = "logging/logging_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-web3/src/tools/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ pub use status::WalletStatusTool;
pub use tx_query::{WalletLookupTxTool, WalletTxReceiptTool, WalletTxStatusTool};

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-web3/src/tools/web3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ pub use dapp::{Web3DappCallTool, Web3DappExecuteTool};
pub use swap::{Web3SwapExecuteTool, Web3SwapQuoteTool, Web3SwapRoutesTool};

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-x402/src/abi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,5 @@ fn keccak(bytes: &[u8]) -> [u8; 32] {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-x402/src/crypto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ pub(crate) fn fresh_nonce() -> [u8; 32] {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-x402/src/eip712/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,5 @@ fn left_pad_address(address: Address20) -> [u8; 32] {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-x402/src/ledger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ pub use types::{
};

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-x402/src/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ pub use proxy::ProxyPolicy;
pub(crate) const LOG_PREFIX: &str = "[x402]";

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-x402/src/thread/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ impl ThreadScope for NoThread {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-x402/src/tools/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ mod request;
pub use request::X402RequestTool;

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinywallet-x402/src/wire/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

mod assets;
#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
mod types;

Expand Down
1 change: 1 addition & 0 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ mod status;
mod tron;

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;

/// Errors raised by a chain query.
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions src/key/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,5 @@ fn seed_from_mnemonic(mnemonic: &str) -> Result<Zeroizing<Vec<u8>>> {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
File renamed without changes.
1 change: 1 addition & 0 deletions src/tx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ pub use tinywallet_crypto::tx::proto;
pub use tinywallet_crypto::tx::{Error, Result};

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
File renamed without changes.
Loading