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
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ final class CoreSendIntegrationTests: IntegrationTestCase {
let recipientAddress = try receiver.getCoreWallet().nextReceiveAddress()

let beforeTxids = try await readTxids()
_ = try sender.getCoreWallet().sendToAddresses(
recipients: [(address: recipientAddress, amountDuffs: amount)]
)
_ = try sender.send(to: recipientAddress, amountDuffs: amount)
guard let sendTxid = try await waitForNewTxid(notIn: beforeTxids) else {
XCTFail("send PersistentTransaction row never appeared on iteration \(i)")
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ final class PersisterRestartClassificationIntegrationTests: IntegrationTestCase
try await alice.waitForSpendable(exactly: fundingDuffs, timeout: 90)

let aliceSecondAddr = try alice.getCoreWallet().nextReceiveAddress()
let sendTxData = try alice.getCoreWallet().sendToAddresses(
recipients: [(address: aliceSecondAddr, amountDuffs: sendAmount)]
)
let sendTxid = Self.txid(ofRawTx: sendTxData)
let sendTx = try alice.send(to: aliceSecondAddr, amountDuffs: sendAmount)
let sendTxid = Self.txid(ofRawTx: sendTx.data)
try await waitForTxRow(sendTxid)

// First sighting must already classify as Internal / -fee.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ final class SpvRestartIntegrationTests: IntegrationTestCase {
let recipientAddress = try receiver.getCoreWallet().nextReceiveAddress()

let beforeTxids = try await readTxids()
_ = try sender.getCoreWallet().sendToAddresses(
recipients: [(address: recipientAddress, amountDuffs: amount)]
)
_ = try sender.send(to: recipientAddress, amountDuffs: amount)
guard let sendTxid = try await waitForNewTxid(notIn: beforeTxids) else {
XCTFail("send PersistentTransaction row never appeared")
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ final class TestWalletWrapper {
wallet
}

/// Build + sign + broadcast a single-output payment from this wallet's
/// BIP-44 account 0 — the integration-test replacement for the removed
/// one-shot `ManagedCoreWallet.sendToAddresses`. Returns the built
/// `CoreTransaction` (its `.data` is the raw signed bytes).
@discardableResult
func send(to address: String, amountDuffs: UInt64) throws -> CoreTransaction {
let builder = try CoreTransactionBuilder(network: core.network())
_ = try builder.addOutput(address: address, amountDuffs: amountDuffs)
try builder.setFunding(wallet: wallet, accountType: .bip44, accountIndex: 0)
let tx = try builder.buildSigned(wallet: wallet, accountType: .bip44, accountIndex: 0)
_ = try core.broadcastTransaction(tx)
return tx
}

func waitForSpendable(exactly duffs: UInt64, timeout: TimeInterval = 60) async throws {
try await Wait.until(
"wallet spendable == \(duffs) duffs",
Expand Down
Loading