Merge pull request #1383 from LukasKorba/TCA-conformations
TCA-conformations
This commit is contained in:
commit
7a263be3cc
|
@ -6,6 +6,13 @@ and this library adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
# Unreleased
|
||||
|
||||
## Changed
|
||||
|
||||
### [#1186] Enable ZIP 317 fees
|
||||
- The SDK now generates transactions using [ZIP 317](https://zips.z.cash/zip-0317) fees,
|
||||
instead of a fixed fee of 10,000 Zatoshi. Use `Proposal.totalFeeRequired` to check the
|
||||
total fee for a transfer before creating it.
|
||||
|
||||
## Added
|
||||
|
||||
### [#1204] Expose APIs for working with transaction proposals
|
||||
|
|
|
@ -8,11 +8,26 @@
|
|||
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: 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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue