Skip to content

Commit 1580023

Browse files
author
Igor Goldobin
committed
fix for timeout and number parsing
1 parent fb48067 commit 1580023

6 files changed

Lines changed: 10 additions & 8 deletions

File tree

AddressOwnershipTool.Web/ClientApp/proxy.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const PROXY_CONFIG = [
88
context: [
99
"/api",
1010
],
11-
proxyTimeout: 10000,
11+
proxyTimeout: 10000000,
1212
target: target,
1313
secure: false,
1414
headers: {

AddressOwnershipTool/Commands/Load/LoadCommandHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ public async Task<Result<List<ClaimGroup>>> Handle(LoadCommand request, Cancella
4040
{
4141
var txs = csv.GetRecords<SwapTransaction>().ToList();
4242

43-
txs = txs.Where(t => t.SenderAmount > 0).ToList();
43+
txs = txs.Where(t => t.SenderAmountValue > 0).ToList();
4444

4545
if (!txs.Any())
4646
continue;
4747

4848
claims.AddRange(txs.Select(t => new Claim
4949
{
50-
Balance = Money.Satoshis(t.SenderAmount).ToUnit(MoneyUnit.BTC),
50+
Balance = Money.Satoshis(t.SenderAmountValue).ToUnit(MoneyUnit.BTC),
5151
Destination = t.DestinationAddress,
5252
OriginNetwork = t.Network,
5353
Type = "Burnt"

AddressOwnershipTool/Common/DistributedSwapTransaction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public DistributedSwapTransaction(SwapTransaction swapTransaction)
1616
{
1717
this.BlockHeight = swapTransaction.BlockHeight;
1818
this.StraxAddress = swapTransaction.DestinationAddress;
19-
this.SenderAmount = swapTransaction.SenderAmount;
19+
this.SenderAmount = swapTransaction.SenderAmountValue;
2020
this.TransactionHash = swapTransaction.TransactionHash;
2121
}
2222
}

AddressOwnershipTool/Common/EthRpcClientFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public class EthRpcClientFactory : IEthRpcClientFactory
44
{
55
const string TestnetGethBaseUrl = "http://88.198.48.30:8545/";
66

7-
const string MainnetGethBaseUrl = "http://144.126.200.138:8545/";
7+
const string MainnetGethBaseUrl = "https://auroria.rpc.stratisevm.com/";
88

99
public IEthRpcCleint Create(bool testnet)
1010
{

AddressOwnershipTool/Common/SwapExtractionService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ private async Task ScanForSwapTransactionsAsync(int startBlock, int endBlock)
8383
}
8484

8585
Console.WriteLine($"{this.swapTransactions.Count} swap transactions to process.");
86-
Console.WriteLine($"{Money.Satoshis(this.swapTransactions.Sum(s => s.SenderAmount)).ToUnit(MoneyUnit.BTC)} STRAX swapped.");
86+
Console.WriteLine($"{Money.Satoshis(this.swapTransactions.Sum(s => s.SenderAmountValue)).ToUnit(MoneyUnit.BTC)} STRAX swapped.");
8787

8888
using (var writer = new StreamWriter(this.outputPath))
8989
using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture))
@@ -128,7 +128,7 @@ private void ProcessBlockForSwapTransactions(BlockTransactionDetailsModel block,
128128
{
129129
BlockHeight = blockHeight,
130130
DestinationAddress = destinationAddress.ToString(),
131-
SenderAmount = (long)Money.Coins(output.Value),
131+
SenderAmount = ((long)Money.Coins(output.Value)).ToString(),
132132
TransactionHash = transaction.Hash,
133133
Network = this.network.Name.Contains("Strax", StringComparison.OrdinalIgnoreCase) ? "Strax" : "Cirrus"
134134
};

AddressOwnershipTool/Common/SwapTransaction.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ public sealed class SwapTransaction
88

99
public string DestinationAddress { get; set; }
1010

11-
public decimal SenderAmount { get; set; }
11+
public string SenderAmount { get; set; }
12+
13+
public decimal SenderAmountValue => string.IsNullOrEmpty(this.SenderAmount) ? 0 : (decimal.TryParse(this.SenderAmount, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out var amount) ? amount : 0);
1214

1315
public string TransactionHash { get; set; }
1416

0 commit comments

Comments
 (0)