Skip to content

Commit

Permalink
Merge pull request #2467 from fluidity-money/develop-utility-category
Browse files Browse the repository at this point in the history
use correct category when creating pending winners
  • Loading branch information
af-afk authored Dec 21, 2023
2 parents 928fa97 + 7c0966e commit 1a15d9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/databases/timescale/spooler/spooler.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ func CreatePendingWinners(winner worker.EthereumWinnerAnnouncement, tokenDetails
var (
pendingWinners []PendingWinner

fluidTokenDetails = winner.TokenDetails
fluidTokenDetails = winner.TokenDetails
fluidTokenShortName = fluidTokenDetails.TokenShortName

network_ = winner.Network
hash = winner.TransactionHash
Expand Down Expand Up @@ -111,6 +112,7 @@ func CreatePendingWinners(winner worker.EthereumWinnerAnnouncement, tokenDetails

// create the recipient
pendingWinners = append(pendingWinners, PendingWinner{
Category: fluidTokenShortName,
TokenDetails: details,
TransactionHash: hash,
SenderAddress: recipientAddress,
Expand Down Expand Up @@ -171,7 +173,7 @@ func InsertPendingWinners(pendingWinners []PendingWinner) {
var (
fluidTokenDetails = pendingWinner.TokenDetails

fluidTokenShortName = fluidTokenDetails.TokenShortName
category = pendingWinner.Category
hash = pendingWinner.TransactionHash
senderAddress = pendingWinner.SenderAddress
nativeWinAmount = pendingWinner.NativeWinAmount
Expand All @@ -185,7 +187,7 @@ func InsertPendingWinners(pendingWinners []PendingWinner) {
)
_, err := timescaleClient.Exec(
statementText,
fluidTokenShortName,
category,
fluidTokenDetails.TokenShortName,
fluidTokenDetails.TokenDecimals,
hash,
Expand Down
2 changes: 2 additions & 0 deletions lib/types/winners/winners.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ type BlockedWinner struct {

// PendingWinner is a winner that has been spooled but not sent
type PendingWinner struct {
// Category is the TokenShortName of the corresponding token (e.g. USDC)
Category string `json:"category"`
TokenDetails token_details.TokenDetails `json:"token_details"`
TransactionHash ethereum.Hash `json:"transaction_hash"`
SenderAddress ethereum.Address `json:"sender_address"`
Expand Down

0 comments on commit 1a15d9c

Please sign in to comment.