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
56 changes: 0 additions & 56 deletions bdk-ffi/src/bdk.udl
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,6 @@ interface Bip39Error {
AmbiguousLanguages(string languages);
};

[Error]
interface CalculateFeeError {
MissingTxOut(sequence<OutPoint> out_points);
NegativeFee(string amount);
};

[Error]
interface CannotConnectError {
Include(u32 height);
};

[Error]
interface CreateTxError {
Descriptor(string error_message);
Expand All @@ -79,13 +68,6 @@ interface CreateTxError {
LockTimeConversionError();
};

[Error]
interface CreateWithPersistError {
Persist(string error_message);
DataAlreadyExists();
Descriptor(string error_message);
};

[Error]
interface DescriptorError {
InvalidHdKeyPath();
Expand Down Expand Up @@ -170,13 +152,6 @@ interface FromScriptError {
OtherFromScriptErr();
};

[Error]
interface LoadWithPersistError {
Persist(string error_message);
InvalidChangeSet(string error_message);
CouldNotLoad();
};

[Error]
interface MiniscriptError {
AbsoluteLockTime();
Expand Down Expand Up @@ -288,32 +263,6 @@ interface RequestBuilderError {
RequestAlreadyConsumed();
};

[Error]
interface SignerError {
MissingKey();
InvalidKey();
UserCanceled();
InputIndexOutOfRange();
MissingNonWitnessUtxo();
InvalidNonWitnessUtxo();
MissingWitnessUtxo();
MissingWitnessScript();
MissingHdKeypath();
NonStandardSighash();
InvalidSighash();
SighashP2wpkh(string error_message);
SighashTaproot(string error_message);
TxInputsIndexError(string error_message);
MiniscriptPsbt(string error_message);
External(string error_message);
Psbt(string error_message);
};

[Error]
interface SqliteError {
Sqlite(string rusqlite_error);
};

[Error]
interface TransactionError {
Io();
Expand All @@ -325,11 +274,6 @@ interface TransactionError {
OtherTransactionErr();
};

[Error]
interface TxidParseError {
InvalidTxid(string txid);
};

// ------------------------------------------------------------------------
// bdk_wallet crate - types module
// ------------------------------------------------------------------------
Expand Down
16 changes: 8 additions & 8 deletions bdk-ffi/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ pub enum Bip39Error {
AmbiguousLanguages { languages: String },
}

#[derive(Debug, thiserror::Error)]
#[derive(Debug, thiserror::Error, uniffi::Error)]
pub enum CalculateFeeError {
#[error("missing transaction output: {out_points:?}")]
MissingTxOut { out_points: Vec<OutPoint> },
Expand All @@ -130,7 +130,7 @@ pub enum CalculateFeeError {
NegativeFee { amount: String },
}

#[derive(Debug, thiserror::Error)]
#[derive(Debug, thiserror::Error, uniffi::Error)]
pub enum CannotConnectError {
#[error("cannot include height: {height}")]
Include { height: u32 },
Expand Down Expand Up @@ -205,7 +205,7 @@ pub enum CreateTxError {
LockTimeConversionError,
}

#[derive(Debug, thiserror::Error)]
#[derive(Debug, thiserror::Error, uniffi::Error)]
pub enum CreateWithPersistError {
#[error("sqlite persistence error: {error_message}")]
Persist { error_message: String },
Expand Down Expand Up @@ -414,7 +414,7 @@ pub enum RequestBuilderError {
RequestAlreadyConsumed,
}

#[derive(Debug, thiserror::Error)]
#[derive(Debug, thiserror::Error, uniffi::Error)]
pub enum LoadWithPersistError {
#[error("sqlite persistence error: {error_message}")]
Persist { error_message: String },
Expand Down Expand Up @@ -691,7 +691,7 @@ pub enum PsbtFinalizeError {
InputIdxOutofBounds { psbt_inp: u32, requested: u32 },
}

#[derive(Debug, thiserror::Error)]
#[derive(Debug, thiserror::Error, uniffi::Error)]
pub enum SignerError {
#[error("missing key for signing")]
MissingKey,
Expand Down Expand Up @@ -745,7 +745,7 @@ pub enum SignerError {
Psbt { error_message: String },
}

#[derive(Debug, thiserror::Error)]
#[derive(Debug, thiserror::Error, uniffi::Error)]
pub enum SqliteError {
#[error("sqlite error: {rusqlite_error}")]
Sqlite { rusqlite_error: String },
Expand Down Expand Up @@ -776,7 +776,7 @@ pub enum TransactionError {
OtherTransactionErr,
}

#[derive(Debug, thiserror::Error)]
#[derive(Debug, thiserror::Error, uniffi::Error)]
pub enum TxidParseError {
#[error("invalid txid: {txid}")]
InvalidTxid { txid: String },
Expand Down Expand Up @@ -1535,12 +1535,12 @@ impl From<bdk_kyoto::kyoto::ClientError> for CbfError {

#[cfg(test)]
mod test {
use crate::error::SignerError;
use crate::error::{
Bip32Error, Bip39Error, CannotConnectError, DescriptorError, DescriptorKeyError,
ElectrumError, EsploraError, ExtractTxError, PersistenceError, PsbtError, PsbtParseError,
RequestBuilderError, TransactionError, TxidParseError,
};
use crate::SignerError;

#[test]
fn test_error_bip32() {
Expand Down
7 changes: 0 additions & 7 deletions bdk-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,22 @@ use crate::electrum::ServerFeaturesRes;
use crate::error::AddressParseError;
use crate::error::Bip32Error;
use crate::error::Bip39Error;
use crate::error::CalculateFeeError;
use crate::error::CannotConnectError;
use crate::error::CreateTxError;
use crate::error::CreateWithPersistError;
use crate::error::DescriptorError;
use crate::error::DescriptorKeyError;
use crate::error::ElectrumError;
use crate::error::EsploraError;
use crate::error::ExtractTxError;
use crate::error::FeeRateError;
use crate::error::FromScriptError;
use crate::error::LoadWithPersistError;
use crate::error::MiniscriptError;
use crate::error::ParseAmountError;
use crate::error::PersistenceError;
use crate::error::PsbtError;
use crate::error::PsbtFinalizeError;
use crate::error::PsbtParseError;
use crate::error::RequestBuilderError;
use crate::error::SignerError;
use crate::error::SqliteError;
use crate::error::TransactionError;
use crate::error::TxidParseError;
use crate::esplora::EsploraClient;
use crate::keys::DerivationPath;
use crate::keys::DescriptorPublicKey;
Expand Down
Loading