Skip to content

Commit

Permalink
Add testOnlyFakeProposal for testing purposes outside SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasKorba authored and str4d committed Mar 6, 2024
1 parent bb1a05e commit f617f17
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Sources/ZcashLightClientKit/Model/Proposal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit f617f17

Please sign in to comment.