Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,6 @@ public TxFeeEstimateRequest()
/// recipient will receive in STRAT (or a sidechain coin). If the transaction was realized,
/// both the values would be used to create the UTXOs for the transaction recipients.
/// </summary>
[Required(ErrorMessage = "A list of recipients is required.")]
[MinLength(1)]
public List<RecipientModel> Recipients { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ protected void AddCoins(TransactionBuildContext context)

// Get total spendable balance in the account.
long balance = context.UnspentOutputs.Sum(t => t.Transaction.Amount);
long totalToSend = context.Recipients.Sum(s => s.Amount);
long totalToSend = context.Recipients.Sum(s => s.Amount) + (context.OpReturnAmount ?? Money.Zero);
if (balance < totalToSend)
throw new WalletException("Not enough funds.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1634,7 +1634,7 @@ public void BuildTransactionWithChangeAddressReturnsWalletBuildTransactionModel(
IActionResult result = controller.BuildTransaction(new BuildTransactionRequest
{
AccountName = "Account 0",
Recipients = new List<RecipientModel>(),
Recipients = new List<RecipientModel>() { new RecipientModel() { Amount = "1.0", DestinationAddress = new Key().PubKey.Hash.GetAddress(this.Network).ToString() } },
WalletName = walletName,
ChangeAddress = usedReceiveAddress.Address
});
Expand Down Expand Up @@ -1676,7 +1676,7 @@ public void BuildTransactionWithChangeAddressNotInWalletReturnsBadRequest()
IActionResult result = controller.BuildTransaction(new BuildTransactionRequest
{
AccountName = "Account 0",
Recipients = new List<RecipientModel>(),
Recipients = new List<RecipientModel>() { new RecipientModel() { Amount = "1.0", DestinationAddress = new Key().PubKey.Hash.GetAddress(this.Network).ToString() } },
WalletName = walletName,
ChangeAddress = addressNotInWallet.Address
});
Expand Down Expand Up @@ -1713,7 +1713,7 @@ public void BuildTransactionWithChangeAddressAccountNotInWalletReturnsBadRequest
IActionResult result = controller.BuildTransaction(new BuildTransactionRequest
{
AccountName = "Account 0",
Recipients = new List<RecipientModel>(),
Recipients = new List<RecipientModel>() { new RecipientModel() { Amount = "1.0", DestinationAddress = new Key().PubKey.Hash.GetAddress(this.Network).ToString() } },
WalletName = walletName,
ChangeAddress = addressNotInWallet.Address
});
Expand Down