Add testOnlyFakeProposal for testing purposes outside SDK

This commit is contained in:
Lukas Korba 2024-02-29 13:31:27 +01:00 committed by Jack Grigg
parent bb1a05ef5c
commit f617f17e2a
1 changed files with 15 additions and 0 deletions

View File

@ -16,3 +16,18 @@ public struct Proposal: Equatable {
Zatoshi(Int64(inner.balance.feeRequired))
}
}
public extension Proposal {
/// IMPORTANT: This function is for testing purposes only. It produces fake invalid
/// data that can be used to check UI elements, but will always produce an error when
/// passed to `Synchronizer.createProposedTransactions`. It should never be called in
/// production code.
static func testOnlyFakeProposal(totalFee: UInt64) -> Self {
var ffiProposal = FfiProposal()
var balance = FfiTransactionBalance()
balance.feeRequired = totalFee
return Self(inner: ffiProposal)
}
}