Skip to content

Commit

Permalink
fix: use alpha 9 types for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderbiscuit committed Apr 17, 2024
1 parent aee84f9 commit b9aa3da
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 14 deletions.
3 changes: 3 additions & 0 deletions bdk-android/lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ afterEvaluate {
tasks.named("mergeReleaseJniLibFolders") {
dependsOn(":lib:moveNativeAndroidLibs")
}
tasks.named("mergeDebugJniLibFolders") {
dependsOn(":lib:moveNativeAndroidLibs")
}
}

signing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LiveTxBuilderTest {
assert(wallet.getBalance().total > 0uL)

val recipient: Address = Address("tb1qrnfslnrve9uncz9pzpvf83k3ukz22ljgees989", Network.TESTNET)
val psbt: PartiallySignedTransaction = TxBuilder()
val psbt: Psbt = TxBuilder()
.addRecipient(recipient.scriptPubkey(), 4200uL)
.feeRate(FeeRate.fromSatPerVb(2uL))
.finish(wallet)
Expand Down Expand Up @@ -61,7 +61,7 @@ class LiveTxBuilderTest {
ScriptAmount(recipient2.scriptPubkey(), 4200uL),
)

val psbt: PartiallySignedTransaction = TxBuilder()
val psbt: Psbt = TxBuilder()
.setRecipients(allRecipients)
.feeRate(FeeRate.fromSatPerVb(4uL))
.changePolicy(ChangeSpendPolicy.CHANGE_FORBIDDEN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ class LiveWalletTest {

val recipient: Address = Address("tb1qrnfslnrve9uncz9pzpvf83k3ukz22ljgees989", Network.TESTNET)

val psbt: PartiallySignedTransaction = TxBuilder()
val psbt: Psbt = TxBuilder()
.addRecipient(recipient.scriptPubkey(), 4200uL)
.feeRate(FeeRate.fromSatPerVb(4.0f))
.feeRate(FeeRate.fromSatPerVb(4uL))
.finish(wallet)

println(psbt.serialize())
Expand Down
7 changes: 4 additions & 3 deletions bdk-ffi/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,10 @@ impl From<BdkEsploraError> for EsploraError {
BdkEsploraError::Minreq(e) => EsploraError::Minreq {
error_message: e.to_string(),
},
BdkEsploraError::HttpResponse { status, message } => {
EsploraError::HttpResponse { status: status, error_message: message }
}
BdkEsploraError::HttpResponse { status, message } => EsploraError::HttpResponse {
status,
error_message: message,
},
BdkEsploraError::Parsing(e) => EsploraError::Parsing {
error_message: e.to_string(),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class LiveTxBuilderTest {
assert(wallet.getBalance().total > 0uL)

val recipient: Address = Address("tb1qrnfslnrve9uncz9pzpvf83k3ukz22ljgees989", Network.TESTNET)
val psbt: PartiallySignedTransaction = TxBuilder()
val psbt: Psbt = TxBuilder()
.addRecipient(recipient.scriptPubkey(), 4200uL)
.feeRate(FeeRate.fromSatPerVb(2uL))
.finish(wallet)
Expand Down Expand Up @@ -60,7 +60,7 @@ class LiveTxBuilderTest {
ScriptAmount(recipient2.scriptPubkey(), 4200uL),
)

val psbt: PartiallySignedTransaction = TxBuilder()
val psbt: Psbt = TxBuilder()
.setRecipients(allRecipients)
.feeRate(FeeRate.fromSatPerVb(4uL))
.changePolicy(ChangeSpendPolicy.CHANGE_FORBIDDEN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class LiveWalletTest {

val recipient: Address = Address("tb1qrnfslnrve9uncz9pzpvf83k3ukz22ljgees989", Network.TESTNET)

val psbt: PartiallySignedTransaction = TxBuilder()
val psbt: Psbt = TxBuilder()
.addRecipient(recipient.scriptPubkey(), 4200uL)
.feeRate(FeeRate.fromSatPerVb(2uL))
.finish(wallet)
Expand Down
2 changes: 1 addition & 1 deletion bdk-python/tests/test_live_tx_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def complex_tx_builder(self):
bdk.ScriptAmount(recipient2.script_pubkey, 4200)
)

psbt: bdk.PartiallySignedTransaction = bdk.TxBuilder().set_recipients(all_recipients).fee_rate(fee_rate=bdk.FeeRate.from_sat_per_vb(2)).enable_rbf().finish(wallet)
psbt: bdk.Psbt = bdk.TxBuilder().set_recipients(all_recipients).fee_rate(fee_rate=bdk.FeeRate.from_sat_per_vb(2)).enable_rbf().finish(wallet)
wallet.sign(psbt)

self.assertTrue(psbt.serialize().startswith("cHNi"), "The PSBT should start with cHNi")
Expand Down
2 changes: 1 addition & 1 deletion bdk-python/tests/test_live_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_broadcast_transaction(self):
network = bdk.Network.TESTNET
)

psbt = bdk.TxBuilder().add_recipient(script=recipient.script_pubkey(), amount=4200).fee_rate(fee_rate=bdk.FeeRate.from_sat_per_vb(2)).finish(wallet)
psbt: bdk.Psbt = bdk.TxBuilder().add_recipient(script=recipient.script_pubkey(), amount=4200).fee_rate(fee_rate=bdk.FeeRate.from_sat_per_vb(2)).finish(wallet)
# print(psbt.serialize())
self.assertTrue(psbt.serialize().startswith("cHNi"), "The PSBT should start with cHNi")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ final class LiveTxBuilderTests: XCTestCase {
ScriptAmount(script: recipient2.scriptPubkey(), amount: 4200)
]

let psbt: PartiallySignedTransaction = try TxBuilder()
let psbt: Psbt = try TxBuilder()
.setRecipients(recipients: allRecipients)
.feeRate(feeRate: FeeRate.fromSatPerVb(satPerVb: 4))
.changePolicy(changePolicy: ChangeSpendPolicy.changeForbidden)
Expand Down
2 changes: 1 addition & 1 deletion bdk-swift/Tests/BitcoinDevKitTests/LiveWalletTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ final class LiveWalletTests: XCTestCase {
print("Balance: \(wallet.getBalance().total)")

let recipient: Address = try Address(address: "tb1qrnfslnrve9uncz9pzpvf83k3ukz22ljgees989", network: .testnet)
let psbt: PartiallySignedTransaction = try
let psbt: Psbt = try
TxBuilder()
.addRecipient(script: recipient.scriptPubkey(), amount: 4200)
.feeRate(feeRate: FeeRate.fromSatPerVb(satPerVb: 2))
Expand Down

0 comments on commit b9aa3da

Please sign in to comment.