Skip to content

Commit

Permalink
Add Proposal.transactionCount
Browse files Browse the repository at this point in the history
  • Loading branch information
str4d committed Mar 7, 2024
1 parent e9177a2 commit 9b2be55
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Sources/ZcashLightClientKit/Model/Proposal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ import Foundation
public struct Proposal: Equatable {
let inner: FfiProposal

/// Returns the number of transactions that this proposal will create.
///
/// This is equal to the number of `TransactionSubmitResult`s that will be returned
/// from `Synchronizer.createProposedTransactions`.
///
/// Proposals always create at least one transaction.
public func transactionCount() -> Int {
inner.steps.count
}

/// Returns the total fee to be paid across all proposed transactions, in zatoshis.
public func totalFeeRequired() -> Zatoshi {
inner.steps.reduce(Zatoshi.zero) { acc, step in
Expand Down

0 comments on commit 9b2be55

Please sign in to comment.