Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use correct category when creating pending winners #2467

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading