Skip to content

Commit 31685aa

Browse files
committed
Clean up integration leftovers
1 parent 2e9aeb4 commit 31685aa

10 files changed

Lines changed: 25 additions & 29 deletions

File tree

Monero.IntegrationTests/MoneroDaemonRpcIntegrationTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,10 @@ public async Task TestGetFeeEstimate()
328328
{
329329
GetFeeEstimateResponse feeEstimateResponse = await _daemon.GetFeeEstimate(null);
330330
TestUtils.TestUnsignedBigInteger(feeEstimateResponse.Fee, true);
331-
Assert.Equal(4, feeEstimateResponse.Fees?.Count); // slow, normal, fast, fastest
331+
Assert.Equal(4, feeEstimateResponse.Fees.Count); // slow, normal, fast, fastest
332332
for (int i = 0; i < 4; i++)
333333
{
334-
TestUtils.TestUnsignedBigInteger(feeEstimateResponse?.Fees?[i], true);
334+
TestUtils.TestUnsignedBigInteger(feeEstimateResponse?.Fees[i], true);
335335
}
336336

337337
TestUtils.TestUnsignedBigInteger(feeEstimateResponse?.QuantizationMask, true);

Monero/Common/MoneroUtils.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ public static void Log(int level, string message)
228228
Console.WriteLine(message);
229229
}
230230

231-
public static ulong XmrToAtomicUnits(double amountXmr)
231+
public static long XmrToAtomicUnits(double amountXmr)
232232
{
233233
decimal precise = Math.Round((decimal)amountXmr * XmrAuMultiplier, 0, MidpointRounding.AwayFromZero);
234-
return (ulong)new BigInteger(precise);
234+
return (long)new BigInteger(precise);
235235
}
236236

237237
public static double AtomicUnitsToXmr(ulong amountAtomicUnits)

Monero/Daemon/Common/GetFeeEstimateResponse.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ namespace Monero.Daemon.Common;
55
public class GetFeeEstimateResponse : MoneroRpcResponse
66
{
77
[JsonPropertyName("fee")]
8-
public ulong? Fee { get; set; }
8+
public uint Fee { get; set; }
99

1010
[JsonPropertyName("fees")]
11-
public List<ulong>? Fees { get; set; }
11+
public required List<uint> Fees { get; set; }
1212

1313
[JsonPropertyName("quantization_mask")]
14-
public ulong? QuantizationMask { get; set; }
14+
public uint QuantizationMask { get; set; }
1515
}

Monero/Wallet/Common/MoneroSubaddress.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ namespace Monero.Wallet.Common;
55
public class MoneroSubaddress
66
{
77
[JsonPropertyName("major")]
8-
public uint? AccountIndex { get; set; }
8+
public uint AccountIndex { get; set; }
99

1010
[JsonPropertyName("minor")]
11-
public uint? Index { get; set; }
11+
public uint Index { get; set; }
1212

1313
private string? _address;
1414
private ulong? _balance;

Monero/Wallet/Common/MoneroTxConfig.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,8 @@ public static string GetPaymentUri(MoneroTxConfig? config)
7676
sb.Append(config.GetAddress());
7777

7878
StringBuilder paramSb = new();
79-
ulong? amount = config.GetAmount();
80-
if (amount != null)
81-
{
82-
paramSb.Append("&tx_amount=").Append(MoneroUtils.AtomicUnitsToXmr((ulong)amount));
83-
}
79+
long amount = config.GetAmount();
80+
paramSb.Append("&tx_amount=").Append(MoneroUtils.AtomicUnitsToXmr((ulong)amount));
8481

8582
if (!string.IsNullOrEmpty(config.GetRecipientName()))
8683
{
@@ -139,7 +136,7 @@ public MoneroTxConfig SetAddress(string address)
139136
return _destinations[0].Address;
140137
}
141138

142-
public MoneroTxConfig SetAmount(ulong amount)
139+
public MoneroTxConfig SetAmount(long amount)
143140
{
144141
if (_destinations != null && _destinations.Count > 1)
145142
{
@@ -160,11 +157,11 @@ public MoneroTxConfig SetAmount(ulong amount)
160157

161158
public MoneroTxConfig SetAmount(string amount)
162159
{
163-
return SetAmount(ulong.Parse(amount));
160+
return SetAmount(long.Parse(amount));
164161
}
165162

166163

167-
public ulong? GetAmount()
164+
public long GetAmount()
168165
{
169166
if (_destinations == null || _destinations.Count != 1)
170167
{
@@ -174,7 +171,7 @@ public MoneroTxConfig SetAmount(string amount)
174171
return _destinations[0].Amount;
175172
}
176173

177-
public MoneroTxConfig AddDestination(string address, ulong amount)
174+
public MoneroTxConfig AddDestination(string address, long amount)
178175
{
179176
return AddDestination(new TransferDestination { Address = address, Amount = amount });
180177
}

Monero/Wallet/Common/TransferDestination.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ public class TransferDestination
99
public required string Address { get; set; }
1010

1111
[JsonPropertyName("amount")]
12-
public ulong Amount { get; set; }
12+
public long Amount { get; set; }
1313
}

Monero/Wallet/Common/TransferItem.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Text.Json.Serialization;
22

3-
43
namespace Monero.Wallet.Common;
54

65
public abstract class TransferItem
@@ -9,16 +8,16 @@ public abstract class TransferItem
98
public required string Address { get; set; }
109

1110
[JsonPropertyName("amount")]
12-
public ulong Amount { get; set; }
11+
public long Amount { get; set; }
1312

1413
[JsonPropertyName("amounts")]
15-
public List<ulong> Amounts { get; set; } = [];
14+
public List<long> Amounts { get; set; } = [];
1615

1716
[JsonPropertyName("destinations")]
1817
public List<TransferDestination> Destinations { get; set; } = [];
1918

2019
[JsonPropertyName("confirmations")]
21-
public ulong Confirmations { get; set; }
20+
public int Confirmations { get; set; }
2221

2322
[JsonPropertyName("fee")]
2423
public ulong Fee { get; set; }
@@ -57,5 +56,5 @@ public abstract class TransferItem
5756
public required string Type { get; set; }
5857

5958
[JsonPropertyName("unlock_time")]
60-
public ulong UnlockTime { get; set; }
59+
public int UnlockTime { get; set; }
6160
}

Monero/Wallet/MoneroWalletRpc.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,10 +1541,10 @@ public async Task<GetTransfersResponse> GetTransfers(MoneroTransferQuery? query)
15411541
transfersRequest.AccountIndex = query.AccountIndex;
15421542

15431543
// set subaddress indices param
1544-
HashSet<uint> subaddressIndices = [];
1544+
HashSet<long> subaddressIndices = [];
15451545
if (query.SubaddressIndex != null)
15461546
{
1547-
subaddressIndices.Add((uint)query.SubaddressIndex);
1547+
subaddressIndices.Add((long)query.SubaddressIndex);
15481548
}
15491549

15501550
if (query.GetSubaddressIndices() != null)

Monero/Wallet/Rpc/GetTransfersRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class GetTransfersRequest
1212
[JsonPropertyName("filter_by_height ")] public bool? FilterByHeight { get; set; }
1313
[JsonPropertyName("min_height")] public uint? MinHeight { get; set; }
1414
[JsonPropertyName("max_height")] public uint? MaxHeight { get; set; }
15-
[JsonPropertyName("account_index")] public uint? AccountIndex { get; set; }
16-
[JsonPropertyName("subaddr_indices")] public IEnumerable<uint>? SubaddrIndices { get; set; }
15+
[JsonPropertyName("account_index")] public long? AccountIndex { get; set; }
16+
[JsonPropertyName("subaddr_indices")] public IEnumerable<long>? SubaddrIndices { get; set; }
1717
[JsonPropertyName("all_accounts")] public bool? AllAccounts { get; set; }
1818
}

Monero/Wallet/Rpc/ParseUriResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class ParsedUri
66
{
77
[JsonPropertyName("address")] public string Address { get; set; } = "";
88
[JsonPropertyName("amount")]
9-
public ulong Amount { get; set; }
9+
public long Amount { get; set; }
1010

1111
[JsonPropertyName("payment_id")] public string PaymentId { get; set; } = "";
1212
[JsonPropertyName("recipient_name")] public string RecipientName { get; set; } = "";

0 commit comments

Comments
 (0)