Applies async/await to getbalance and mint commands
This commit is contained in:
parent
9c8151bdb7
commit
9f7e95c515
|
@ -31,8 +31,14 @@ namespace BiblioTech.Commands
|
|||
return;
|
||||
}
|
||||
|
||||
var eth = gethNode.GetEthBalance(addr);
|
||||
var testTokens = contracts.GetTestTokenBalance(addr);
|
||||
var eth = 0.Eth();
|
||||
var testTokens = 0.TestTokens();
|
||||
|
||||
await Task.Run(() =>
|
||||
{
|
||||
eth = gethNode.GetEthBalance(addr);
|
||||
testTokens = contracts.GetTestTokenBalance(addr);
|
||||
});
|
||||
|
||||
await context.Followup($"{context.Command.User.Username} has {eth} and {testTokens}.");
|
||||
}
|
||||
|
|
|
@ -33,8 +33,14 @@ namespace BiblioTech.Commands
|
|||
|
||||
var report = new List<string>();
|
||||
|
||||
var sentEth = ProcessEth(gethNode, addr, report);
|
||||
var mintedTokens = ProcessTokens(contracts, addr, report);
|
||||
Transaction<Ether>? sentEth = null;
|
||||
Transaction<TestToken>? mintedTokens = null;
|
||||
|
||||
await Task.Run(() =>
|
||||
{
|
||||
sentEth = ProcessEth(gethNode, addr, report);
|
||||
mintedTokens = ProcessTokens(contracts, addr, report);
|
||||
});
|
||||
|
||||
Program.UserRepo.AddMintEventForUser(userId, addr, sentEth, mintedTokens);
|
||||
|
||||
|
|
Loading…
Reference in New Issue