Uses new BumpFee RPC method
MODIFY
MagicalCryptoWallet.Tests/RegTests.cs
MagicalCryptoWallet.Tests/RegTests.cs
@@ -301,14 +301,13 @@ namespace MagicalCryptoWallet.Tests
await Global.RpcClient.InvalidateBlockAsync(tip); // Reorg 1
tip = await Global.RpcClient.GetBestBlockHashAsync();
await Global.RpcClient.InvalidateBlockAsync(tip); // Reorg 2
- var tx1bumpRes = await Global.RpcClient.SendCommandAsync("bumpfee", tx1.ToString()); // RBF it
- var tx1bump = new uint256(tx1bumpRes.Result["txid"].ToString());
+ var tx1bumpRes = await Global.RpcClient.BumpFeeAsync(tx1); // RBF it
await Global.RpcClient.GenerateAsync(5);
await WaitForIndexesToSyncAsync(TimeSpan.FromSeconds(90), downloader);
utxoLines = await File.ReadAllTextAsync(utxoPath);
- Assert.Contains(tx1bump.ToString(), utxoLines); // assert the tx1bump is the correct tx
+ Assert.Contains(tx1bumpRes.TransactionId.ToString(), utxoLines); // assert the tx1bump is the correct tx
Assert.DoesNotContain(tx1.ToString(), utxoLines); // assert tx1 is abandoned (despite it confirmed previously)
Assert.Contains(tx2.ToString(), utxoLines);
Assert.Contains(tx3.ToString(), utxoLines);
@@ -521,8 +520,7 @@ namespace MagicalCryptoWallet.Tests
await Global.RpcClient.InvalidateBlockAsync(tip); // Reorg 1
tip = await Global.RpcClient.GetBestBlockHashAsync();
await Global.RpcClient.InvalidateBlockAsync(tip); // Reorg 2
- var tx4bumpRes = await Global.RpcClient.SendCommandAsync("bumpfee", txid4.ToString()); // RBF it
- var tx4bump = new uint256(tx4bumpRes.Result["txid"].ToString());
+ var tx4bumpRes = await Global.RpcClient.BumpFeeAsync(txid4); // RBF it
_filtersProcessedByWalletCount = 0;
await Global.RpcClient.GenerateAsync(3);
await WaitForFiltersToBeProcessedAsync(TimeSpan.FromSeconds(120), 3);
@@ -531,8 +529,8 @@ namespace MagicalCryptoWallet.Tests
Assert.Equal(4, wallet.Coins.Count);
Assert.Empty(wallet.Coins.Where(x => x.TransactionId == txid4));
- Assert.NotEmpty(wallet.Coins.Where(x => x.TransactionId == tx4bump));
- var rbfCoin = wallet.Coins.Where(x => x.TransactionId == tx4bump).Single();
+ Assert.NotEmpty(wallet.Coins.Where(x => x.TransactionId == tx4bumpRes.TransactionId));
+ var rbfCoin = wallet.Coins.Where(x => x.TransactionId == tx4bumpRes.TransactionId).Single();
Assert.Equal(new Money(0.03m, MoneyUnit.BTC), rbfCoin.Amount);
Assert.Equal(indexDownloader.GetBestFilter().BlockHeight.Value - 2, rbfCoin.Height.Value);
@@ -542,7 +540,7 @@ namespace MagicalCryptoWallet.Tests
Assert.Null(rbfCoin.SpenderTransactionId);
Assert.NotNull(rbfCoin.SpentOutputs);
Assert.NotEmpty(rbfCoin.SpentOutputs);
- Assert.Equal(tx4bump, rbfCoin.TransactionId);
+ Assert.Equal(tx4bumpRes.TransactionId, rbfCoin.TransactionId);
Assert.Equal(2, keyManager.GetKeys(KeyState.Used, false).Count());
Assert.Empty(keyManager.GetKeys(KeyState.Used, true));

Uses new BumpFee RPC method