Skip to content

Commit

Permalink
fix: save the deposit channel
Browse files Browse the repository at this point in the history
  • Loading branch information
CumpsD committed Jan 29, 2024
1 parent 0ab26fd commit f6fadc8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions swappy-bot/Commands/Slash/Swap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,6 @@ await Context.Channel.SendMessageAsync(

swapState.SwapAccepted = DateTimeOffset.UtcNow;

await _dbContext.SaveChangesAsync();

var deposit = await GetDepositChannelAsync(
assetFrom,
assetTo,
Expand All @@ -519,6 +517,12 @@ await Context.Channel.SendMessageAsync(
var depositBlock = deposit.IssuedBlock;
var depositChannel = deposit.ChannelId;

swapState.DepositAddress = depositAddress;
swapState.DepositChannel = $"{depositBlock}-{assetFrom.Network}-{depositChannel}";
swapState.DepositGenerated = DateTimeOffset.UtcNow;

await _dbContext.SaveChangesAsync();

typing.Dispose();

await Context.Channel.SendMessageAsync(
Expand Down

0 comments on commit f6fadc8

Please sign in to comment.