diff --git a/Sources/ZcashLightClientKit/Model/Proposal.swift b/Sources/ZcashLightClientKit/Model/Proposal.swift index a2645c8a..eb6ba8b2 100644 --- a/Sources/ZcashLightClientKit/Model/Proposal.swift +++ b/Sources/ZcashLightClientKit/Model/Proposal.swift @@ -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) + } +}