Skip to content

Commit

Permalink
Add Zatoshi to TransactionEncoder
Browse files Browse the repository at this point in the history
  • Loading branch information
pacu committed Sep 1, 2022
1 parent c06450b commit 666b287
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class PersistentTransactionManager: OutboundTransactionManager {
do {
let encodedTransaction = try self.encoder.createTransaction(
spendingKey: spendingKey,
zatoshi: pendingTransaction.intValue,
zatoshi: pendingTransaction.value,
to: pendingTransaction.toAddress,
memo: pendingTransaction.memo?.asZcashTransactionMemo(),
from: pendingTransaction.accountIndex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ protocol TransactionEncoder {
///
/// - Parameters:
/// - Parameter spendingKey: a `SaplingExtendedSpendingKey` containing the spending key
/// - Parameter zatoshi: the amount to send in zatoshis
/// - Parameter zatoshi: the amount to send in `Zatoshi`
/// - Parameter to: string containing the recipient address
/// - Parameter memo: string containing the memo (optional)
/// - Parameter accountIndex: index of the account that will be used to send the funds
///
/// - Throws: a TransactionEncoderError
func createTransaction(
spendingKey: SaplingExtendedSpendingKey,
zatoshi: Int,
zatoshi: Zatoshi,
to address: String,
memo: String?,
from accountIndex: Int
Expand All @@ -48,15 +48,15 @@ protocol TransactionEncoder {
///
/// - Parameters:
/// - Parameter spendingKey: a `SaplingExtendedSpendingKey` containing the spending key
/// - Parameter zatoshi: the amount to send in zatoshis
/// - Parameter zatoshi: the amount to send in `Zatoshi`
/// - Parameter to: string containing the recipient address
/// - Parameter memo: string containing the memo (optional)
/// - Parameter accountIndex: index of the account that will be used to send the funds
/// - Parameter result: a non escaping closure that receives a Result containing either an EncodedTransaction or a /// TransactionEncoderError
// swiftlint:disable:next function_parameter_count
func createTransaction(
spendingKey: SaplingExtendedSpendingKey,
zatoshi: Int,
zatoshi: Zatoshi,
to address: String,
memo: String?,
from accountIndex: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class WalletTransactionEncoder: TransactionEncoder {

func createTransaction(
spendingKey: SaplingExtendedSpendingKey,
zatoshi: Int,
zatoshi: Zatoshi,
to address: String,
memo: String?,
from accountIndex: Int
Expand Down Expand Up @@ -81,7 +81,7 @@ class WalletTransactionEncoder: TransactionEncoder {
// swiftlint:disable:next function_parameter_count
func createTransaction(
spendingKey: SaplingExtendedSpendingKey,
zatoshi: Int,
zatoshi: Zatoshi,
to address: String,
memo: String?,
from accountIndex: Int,
Expand Down Expand Up @@ -109,7 +109,7 @@ class WalletTransactionEncoder: TransactionEncoder {

func createSpend(
spendingKey: SaplingExtendedSpendingKey,
zatoshi: Int,
zatoshi: Zatoshi,
to address: String,
memo: String?,
from accountIndex: Int
Expand All @@ -123,7 +123,7 @@ class WalletTransactionEncoder: TransactionEncoder {
account: Int32(accountIndex),
extsk: spendingKey.stringEncoded,
to: address,
value: Int64(zatoshi),
value: zatoshi.amount,
memo: memo,
spendParamsPath: self.spendParamsURL.path,
outputParamsPath: self.outputParamsURL.path,
Expand Down

0 comments on commit 666b287

Please # to comment.