Fixes check for eth address files

This commit is contained in:
ThatBen 2025-04-03 15:04:58 +02:00
parent accbe51392
commit 7167252e8b
No known key found for this signature in database
GPG Key ID: 62C543548433D43E
2 changed files with 3 additions and 4 deletions

View File

@ -62,7 +62,6 @@ namespace NethereumWorkflow
log.Debug(typeof(TFunction).ToString());
var handler = web3.Eth.GetContractQueryHandler<TFunction>();
var result = Time.Wait(handler.QueryRawAsync(contractAddress, function, new BlockParameter(blockNumber)));
var aaaa = 0;
}
public string SendTransaction<TFunction>(string contractAddress, TFunction function) where TFunction : FunctionMessage, new()

View File

@ -25,10 +25,9 @@ namespace AutoClient.Modes.FolderStore
try
{
if (string.IsNullOrEmpty(app.Config.EthAddressFile)) return Array.Empty<EthAddress>();
if (!File.Exists(app.Config.EthAddressFile)) return Array.Empty<EthAddress>();
var tokens = app.Config.EthAddressFile.Split(";", StringSplitOptions.RemoveEmptyEntries);
return tokens.Select(ConvertToAddress).Where(a => a != null).ToArray();
return tokens.Select(ConvertToAddress).Where(a => a != null).Cast<EthAddress>().ToArray();
}
catch (Exception exc)
{
@ -37,8 +36,9 @@ namespace AutoClient.Modes.FolderStore
}
}
private EthAddress ConvertToAddress(string t)
private EthAddress? ConvertToAddress(string t)
{
if (!File.Exists(t)) return null;
return new EthAddress(
File.ReadAllText(t)
.Trim()