diff --git a/Sources/ZcashLightClientKit/Model/Proposal.swift b/Sources/ZcashLightClientKit/Model/Proposal.swift index 0111c588..fac1c62d 100644 --- a/Sources/ZcashLightClientKit/Model/Proposal.swift +++ b/Sources/ZcashLightClientKit/Model/Proposal.swift @@ -8,11 +8,24 @@ import Foundation /// A data structure that describes a series of transactions to be created. -public struct Proposal { +public struct Proposal: Equatable { let inner: FfiProposal /// Returns the total fee to be paid across all proposed transactions, in zatoshis. public func totalFeeRequired() -> Zatoshi { - return Zatoshi(Int64(inner.balance.feeRequired)) + Zatoshi(Int64(inner.balance.feeRequired)) + } +} + +public extension Proposal { + /// IMPORTANT: Use of this function is for testing purposes only, not recommended to use in production. + /// The instance of `Proposal` should never be created on client's side. + static func testOnlyFakeProposal(totalFee: UInt64) -> Self { + var ffiProposal = FfiProposal() + var balance = FfiTransactionBalance() + + balance.feeRequired = totalFee + + return Self(inner: ffiProposal) } } diff --git a/Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift b/Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift index 99d128a6..290bce63 100644 --- a/Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift +++ b/Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift @@ -13,7 +13,7 @@ let globalDBLock = NSLock() actor ZcashRustBackend: ZcashRustBackendWelding { let minimumConfirmations: UInt32 = 10 - let useZIP317Fees = false + let useZIP317Fees = true let dbData: (String, UInt) let fsBlockDbRoot: (String, UInt)