Skip to content

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

refactor(wallet): replace inline method strings with constants from tinywallet-bus\n\nReplace hardcoded method name strings with the corresponding constants from the `tinywallet_bus::names::methods` module to centralise method name definitions and reduce the risk of typos or mismatches when the bus protocol evolves.\n\nAuto-committed-on: dragonfly\n

Steven Enamakel25991671fd2c
diff --git a/src/openhuman/modules/wallet.rs b/src/openhuman/modules/wallet.rs
index 66f1157ce8..d45f08988e 100644
--- a/src/openhuman/modules/wallet.rs
+++ b/src/openhuman/modules/wallet.rs
@@ -66,6 +66,7 @@
//! with which it is, and [`sign_payload`] dispatches on the tag rather than on
//! the chain — so a chain that changes scheme cannot silently sign wrongly.
+use tinywallet_bus::names::methods;
use tinywallet_bus::wire::{
DerivedAccount, ExportRequest, ExportedKey, Scheme, SecretMaterial, SignMessageRequest,
SignRequest, Signature, SignedTransaction, TransactionSpec,
@@ -125,7 +126,7 @@ pub async fn sign_transaction_in_module(
);
proxy
.call_confidential(
- "SignTransaction",
+ methods::SIGN_TRANSACTION,
(SignRequest {
secret: secret.clone(),
transaction: transaction.clone(),
@@ -150,7 +151,7 @@ pub async fn derive_account(
secret.chain
);
proxy
- .call_confidential("DeriveAccount", (secret.clone(),))
+ .call_confidential(methods::DERIVE_ACCOUNT, (secret.clone(),))
.await
.map_err(|error| classify(&error))
}
@@ -181,7 +182,7 @@ pub async fn sign_message(
);
proxy
.call_confidential(
- "SignMessage",
+ methods::SIGN_MESSAGE,
(SignMessageRequest {
secret: secret.clone(),
message_hex: hex(message),
@@ -213,7 +214,7 @@ pub async fn export_key(
);
proxy
.call_confidential(
- "ExportKey",
+ methods::EXPORT_KEY,
(ExportRequest {
secret: secret.clone(),
},),