Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(host): isolate wallet callback test workspace

Steven Enamakel437dbcaddf62
diff --git a/crates/openhuman-core/src/modules/host_tests.rs b/crates/openhuman-core/src/modules/host_tests.rs
index 194e2a23cc..e7681b075b 100644
--- a/crates/openhuman-core/src/modules/host_tests.rs
+++ b/crates/openhuman-core/src/modules/host_tests.rs
@@ -30,6 +30,9 @@ async fn the_module_bus_is_a_singleton_and_serves_proxies() {
#[cfg(feature = "web3")]
#[tokio::test]
async fn wallet_host_callback_is_served_before_the_module_is_loaded() {
+ let workspace = tempfile::tempdir().expect("isolated wallet workspace");
+ let _workspace_env =
+ crate::web3::wallet::test_support::set_workspace_env_for_test(&workspace).await;
let runtime = runtime().await.expect("runtime should start");
let proxy = runtime
.proxy(
@@ -39,21 +42,11 @@ async fn wallet_host_callback_is_served_before_the_module_is_loaded() {
.expect("wallet callback contract names are valid");
let response: tinywallet_bus::wire::HostResponse = proxy
- .call(
- tinywallet_bus::names::host_methods::AUTHORIZE_X402_PAYMENT,
- tinywallet_bus::wire::AuthorizeX402PaymentRequest {
- url: "https://resource.example/".into(),
- network: "eip155:1".into(),
- asset: "0x0000000000000000000000000000000000000001".into(),
- recipient: "0x0000000000000000000000000000000000000002".into(),
- amount_atomic: 1,
- owner: None,
- },
- )
+ .call(tinywallet_bus::names::host_methods::WALLET_ACCOUNTS, ())
.await
.expect("the host must serve callbacks before resolving the wallet module");
assert!(matches!(
response,
- tinywallet_bus::wire::HostResponse::Authorization(result) if !result.approved
+ tinywallet_bus::wire::HostResponse::WalletAccounts(_)
));
}