Skip to content

Commit

Permalink
....
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex6323 committed Apr 30, 2024
1 parent a9100c3 commit b745c52
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions bindings/core/src/method/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use crate::OmittedDebug;
#[non_exhaustive]
pub enum WalletMethod {
/// Returns the accounts of the wallet.
/// Expected response: [`OutputsWithData`](crate::Response::OutputsWithData)
/// Expected response: [`OutputsData`](crate::Response::OutputsData)
Accounts,
/// Backup storage. Password must be the current one, when Stronghold is used as SecretManager.
/// Expected response: [`Ok`](crate::Response::Ok)
Expand Down Expand Up @@ -199,13 +199,13 @@ pub enum WalletMethod {
bip_path: Option<Bip44>,
},
/// Returns the implicit accounts of the wallet.
/// Expected response: [`OutputsWithData`](crate::Response::OutputsWithData)
/// Expected response: [`OutputsData`](crate::Response::OutputsData)
ImplicitAccounts,
/// Returns all incoming transactions of the wallet.
/// Expected response: [`Transactions`](crate::Response::Transactions)
IncomingTransactions,
/// Returns all outputs of the wallet.
/// Expected response: [`OutputsWithData`](crate::Response::OutputsWithData)
/// Expected response: [`OutputsData`](crate::Response::OutputsData)
#[serde(rename_all = "camelCase")]
Outputs { filter_options: Option<FilterOptions> },
/// Returns all pending transactions of the wallet.
Expand Down Expand Up @@ -452,7 +452,7 @@ pub enum WalletMethod {
/// Expected response: [`Transactions`](crate::Response::Transactions)
Transactions,
/// Returns all unspent outputs of the wallet
/// Expected response: [`OutputsWithData`](crate::Response::OutputsWithData)
/// Expected response: [`OutputsData`](crate::Response::OutputsData)
#[serde(rename_all = "camelCase")]
UnspentOutputs { filter_options: Option<FilterOptions> },
/// Emits an event for testing if the event system is working
Expand Down
8 changes: 4 additions & 4 deletions bindings/core/src/method_handler/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub(crate) async fn call_wallet_method_internal(
method: WalletMethod,
) -> Result<Response, crate::Error> {
let response = match method {
WalletMethod::Accounts => Response::OutputsWithData(wallet.ledger().await.accounts().cloned().collect()),
WalletMethod::Accounts => Response::OutputsData(wallet.ledger().await.accounts().cloned().collect()),
#[cfg(feature = "stronghold")]
WalletMethod::BackupToStrongholdSnapshot { destination, password } => {
wallet.backup_to_stronghold_snapshot(destination, password).await?;
Expand Down Expand Up @@ -203,7 +203,7 @@ pub(crate) async fn call_wallet_method_internal(
Response::PreparedTransaction(data)
}
WalletMethod::ImplicitAccounts => {
Response::OutputsWithData(wallet.ledger().await.implicit_accounts().cloned().collect())
Response::OutputsData(wallet.ledger().await.implicit_accounts().cloned().collect())
}
WalletMethod::IncomingTransactions => Response::Transactions(
wallet
Expand All @@ -216,7 +216,7 @@ pub(crate) async fn call_wallet_method_internal(
),
WalletMethod::Outputs { filter_options } => {
let wallet_ledger = wallet.ledger().await;
Response::OutputsWithData(if let Some(filter) = filter_options {
Response::OutputsData(if let Some(filter) = filter_options {
wallet_ledger.filtered_outputs(filter).cloned().collect()
} else {
wallet_ledger.outputs().values().cloned().collect()
Expand Down Expand Up @@ -420,7 +420,7 @@ pub(crate) async fn call_wallet_method_internal(
),
WalletMethod::UnspentOutputs { filter_options } => {
let wallet_ledger = wallet.ledger().await;
Response::OutputsWithData(if let Some(filter) = filter_options {
Response::OutputsData(if let Some(filter) = filter_options {
wallet_ledger.filtered_unspent_outputs(filter).cloned().collect()
} else {
wallet_ledger.unspent_outputs().values().cloned().collect()
Expand Down
2 changes: 1 addition & 1 deletion bindings/core/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ pub enum Response {
/// Response for:
/// - [`Outputs`](crate::method::WalletMethod::Outputs),
/// - [`UnspentOutputs`](crate::method::WalletMethod::UnspentOutputs)
OutputsWithData(Vec<OutputData>),
OutputsData(Vec<OutputData>),
/// Response for:
/// - [`PrepareBurn`](crate::method::WalletMethod::PrepareBurn),
/// - [`PrepareClaimOutputs`](crate::method::WalletMethod::PrepareClaimOutputs)
Expand Down
2 changes: 1 addition & 1 deletion bindings/core/tests/combined.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async fn create_wallet() -> Result<(), Error> {
.await;

match response {
Response::OutputsWithData(_) => {}
Response::OutputsData(_) => {}
_ => panic!("unexpected response {response:?}"),
}

Expand Down

0 comments on commit b745c52

Please sign in to comment.