The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
chore(x402): remove obsolete test file
Steven Enamakel0b085b162d79
diff --git a/crates/openhuman-core/src/web3/x402/x402_tests.rs b/crates/openhuman-core/src/web3/x402/x402_tests.rsindex 7c1c59e564..fd75ac86bd 100644--- a/crates/openhuman-core/src/web3/x402/x402_tests.rs+++ b/crates/openhuman-core/src/web3/x402/x402_tests.rs@@ -2,104 +2,6 @@ use super::ops::build_evm_payment_with_signer;use super::types::*;use base64::engine::{general_purpose::STANDARD as B64, Engine as _};-#[test]-fn parse_payment_required_round_trips() {- let challenge = PaymentRequired {- x402_version: 2,- error: Some("PAYMENT-SIGNATURE header is required".into()),- resource: ResourceInfo {- url: "https://api.example.com/data".into(),- description: Some("Premium data".into()),- mime_type: Some("application/json".into()),- },- accepts: vec![PaymentRequirements {- scheme: "exact".into(),- network: SOLANA_MAINNET_CAIP2.into(),- amount: "10000".into(),- asset: USDC_MINT_MAINNET.into(),- pay_to: "2wKupLR9q6wXYppw8Gr2NvWxKBUqm4PPJKkQfoxHDBg4".into(),- max_timeout_seconds: 60,- extra: Some(PaymentExtra {- fee_payer: Some("EwWqGE4ZFKLofuestmU4LDdK7XM1N4ALgdZccwYugwGd".into()),- memo: Some("pi_3abc123".into()),- name: None,- version: None,- }),- }],- extensions: serde_json::Map::new(),- };- let json_str = serde_json::to_string(&challenge).unwrap();- let parsed: PaymentRequired = serde_json::from_str(&json_str).unwrap();- assert_eq!(parsed.x402_version, 2);- assert_eq!(parsed.accepts.len(), 1);- assert_eq!(parsed.accepts[0].amount, "10000");- assert_eq!(- parsed.accepts[0].pay_to,- "2wKupLR9q6wXYppw8Gr2NvWxKBUqm4PPJKkQfoxHDBg4"- );-}--#[test]-fn solana_exact_requirement_finds_match() {- let challenge = PaymentRequired {- x402_version: 2,- error: None,- resource: ResourceInfo {- url: "https://example.com".into(),- description: None,- mime_type: None,- },- accepts: vec![- PaymentRequirements {- scheme: "exact".into(),- network: "eip155:84532".into(),- amount: "100".into(),- asset: "0xUsdc".into(),- pay_to: "0xRecipient".into(),- max_timeout_seconds: 30,- extra: None,- },- PaymentRequirements {- scheme: "exact".into(),- network: SOLANA_MAINNET_CAIP2.into(),- amount: "5000".into(),- asset: USDC_MINT_MAINNET.into(),- pay_to: "SomeRecipient".into(),- max_timeout_seconds: 60,- extra: None,- },- ],- extensions: serde_json::Map::new(),- };- let sol = challenge.solana_exact_requirement().unwrap();- assert_eq!(sol.amount, "5000");- assert!(sol.is_solana_mainnet());-}--#[test]-fn solana_exact_requirement_returns_none_when_absent() {- let challenge = PaymentRequired {- x402_version: 2,- error: None,- resource: ResourceInfo {- url: "https://example.com".into(),- description: None,- mime_type: None,- },- accepts: vec![PaymentRequirements {- scheme: "exact".into(),- network: "eip155:1".into(),- amount: "100".into(),- asset: "0xUsdc".into(),- pay_to: "0xRecipient".into(),- max_timeout_seconds: 30,- extra: None,- }],- extensions: serde_json::Map::new(),- };- assert!(challenge.solana_exact_requirement().is_none());-}-#[test]fn payment_extra_accessors() {let req = PaymentRequirements {@@ -163,235 +65,10 @@ fn settlement_response_deserializes_failure() {assert_eq!(resp.error_reason.as_deref(), Some("insufficient_funds"));}-#[test]-fn base64_header_round_trip() {- let challenge = PaymentRequired {- x402_version: 2,- error: None,- resource: ResourceInfo {- url: "https://example.com/api".into(),- description: None,- mime_type: None,- },- accepts: vec![PaymentRequirements {- scheme: "exact".into(),- network: SOLANA_MAINNET_CAIP2.into(),- amount: "1000000".into(),- asset: USDC_MINT_MAINNET.into(),- pay_to: "RecipientPubkey".into(),- max_timeout_seconds: 60,- extra: None,- }],- extensions: serde_json::Map::new(),- };- let json_bytes = serde_json::to_vec(&challenge).unwrap();- let encoded = B64.encode(&json_bytes);- let decoded = B64.decode(&encoded).unwrap();- let parsed: PaymentRequired = serde_json::from_slice(&decoded).unwrap();- assert_eq!(parsed.accepts[0].amount, "1000000");-}-// ---------------------------------------------------------------------------// EVM tests// ----------------------------------------------------------------------------#[test]-fn evm_exact_requirement_finds_match() {- let challenge = PaymentRequired {- x402_version: 2,- error: None,- resource: ResourceInfo {- url: "https://twit.sh/post".into(),- description: None,- mime_type: None,- },- accepts: vec![- PaymentRequirements {- scheme: "exact".into(),- network: BASE_MAINNET_CAIP2.into(),- amount: "100".into(),- asset: USDC_BASE_MAINNET.into(),- pay_to: "0x1234567890abcdef1234567890abcdef12345678".into(),- max_timeout_seconds: 30,- extra: None,- },- PaymentRequirements {- scheme: "exact".into(),- network: SOLANA_MAINNET_CAIP2.into(),- amount: "5000".into(),- asset: USDC_MINT_MAINNET.into(),- pay_to: "SomeRecipient".into(),- max_timeout_seconds: 60,- extra: None,- },- ],- extensions: serde_json::Map::new(),- };- let evm = challenge.evm_exact_requirement().unwrap();- assert_eq!(evm.amount, "100");- assert!(evm.is_base_mainnet());- assert_eq!(evm.evm_chain_id(), Some(8453));-}--#[test]-fn best_exact_requirement_prefers_solana() {- let challenge = PaymentRequired {- x402_version: 2,- error: None,- resource: ResourceInfo {- url: "https://example.com".into(),- description: None,- mime_type: None,- },- accepts: vec![- PaymentRequirements {- scheme: "exact".into(),- network: SOLANA_MAINNET_CAIP2.into(),- amount: "5000".into(),- asset: USDC_MINT_MAINNET.into(),- pay_to: "SolRecipient".into(),- max_timeout_seconds: 60,- extra: None,- },- PaymentRequirements {- scheme: "exact".into(),- network: BASE_MAINNET_CAIP2.into(),- amount: "100".into(),- asset: USDC_BASE_MAINNET.into(),- pay_to: "0xRecipient".into(),- max_timeout_seconds: 30,- extra: None,- },- ],- extensions: serde_json::Map::new(),- };- let (req, chain) = challenge.best_exact_requirement().unwrap();- assert_eq!(chain, PaymentChain::Solana);- assert_eq!(req.amount, "5000");-}--#[test]-fn best_exact_requirement_falls_back_to_evm() {- let challenge = PaymentRequired {- x402_version: 2,- error: None,- resource: ResourceInfo {- url: "https://example.com".into(),- description: None,- mime_type: None,- },- accepts: vec![PaymentRequirements {- scheme: "exact".into(),- network: BASE_MAINNET_CAIP2.into(),- amount: "100".into(),- asset: USDC_BASE_MAINNET.into(),- pay_to: "0xRecipient".into(),- max_timeout_seconds: 30,- extra: None,- }],- extensions: serde_json::Map::new(),- };- let (req, chain) = challenge.best_exact_requirement().unwrap();- assert_eq!(chain, PaymentChain::Evm);- assert_eq!(req.amount, "100");-}--#[test]-fn evm_chain_id_parsing() {- let req = PaymentRequirements {- scheme: "exact".into(),- network: "eip155:8453".into(),- amount: "100".into(),- asset: USDC_BASE_MAINNET.into(),- pay_to: "0xRecipient".into(),- max_timeout_seconds: 30,- extra: None,- };- assert_eq!(req.evm_chain_id(), Some(8453));- assert!(req.is_base_mainnet());-- let eth_req = PaymentRequirements {- scheme: "exact".into(),- network: "eip155:1".into(),- amount: "100".into(),- asset: USDC_ETHEREUM_MAINNET.into(),- pay_to: "0xRecipient".into(),- max_timeout_seconds: 30,- extra: None,- };- assert_eq!(eth_req.evm_chain_id(), Some(1));- assert!(!eth_req.is_base_mainnet());-- let sol_req = PaymentRequirements {- scheme: "exact".into(),- network: SOLANA_MAINNET_CAIP2.into(),- amount: "100".into(),- asset: USDC_MINT_MAINNET.into(),- pay_to: "Recipient".into(),- max_timeout_seconds: 30,- extra: None,- };- assert_eq!(sol_req.evm_chain_id(), None);-}--#[test]-fn evm_payment_proof_serializes_correctly() {- let proof = EvmPaymentProof {- signature: "0xdeadbeef".into(),- authorization: EvmAuthorization {- from: "0xaaaa".into(),- to: "0xbbbb".into(),- value: "1000000".into(),- valid_after: "0".into(),- valid_before: "99999999".into(),- nonce: "0xabcd".into(),- },- };- let payload = PaymentPayload {- x402_version: 2,- resource: None,- accepted: PaymentRequirements {- scheme: "exact".into(),- network: BASE_MAINNET_CAIP2.into(),- amount: "1000000".into(),- asset: USDC_BASE_MAINNET.into(),- pay_to: "0xbbbb".into(),- max_timeout_seconds: 60,- extra: None,- },- payload: PaymentProof::Evm(proof),- extensions: serde_json::Map::new(),- };- let json = serde_json::to_string(&payload).unwrap();- assert!(json.contains("\"signature\":\"0xdeadbeef\""));- assert!(json.contains("\"authorization\""));- assert!(!json.contains("\"transaction\""));-}--#[test]-fn solana_payment_proof_serializes_correctly() {- let payload = PaymentPayload {- x402_version: 2,- resource: None,- accepted: PaymentRequirements {- scheme: "exact".into(),- network: SOLANA_MAINNET_CAIP2.into(),- amount: "5000".into(),- asset: USDC_MINT_MAINNET.into(),- pay_to: "Recipient".into(),- max_timeout_seconds: 60,- extra: None,- },- payload: PaymentProof::Solana(SolanaPaymentProof {- transaction: "base64tx".into(),- }),- extensions: serde_json::Map::new(),- };- let json = serde_json::to_string(&payload).unwrap();- assert!(json.contains("\"transaction\":\"base64tx\""));- assert!(!json.contains("\"signature\""));-}-#[test]fn eip712_domain_separator_is_deterministic() {// Now `tinywallet_bus::eip712`; the crate's own suite pins its hashes against