Add testOnlyFakeProposal for testing purposes outside SDK
This commit is contained in:
parent
bb1a05ef5c
commit
f617f17e2a
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue