Skip to content

Commit

Permalink
Extract token count in sales completion (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
awfm9 authored Aug 26, 2022
1 parent 5fb74b6 commit 588dcc1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion models/events/sale.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Sale struct {
MarketplaceAddress string `json:"marketplace_address"`
CollectionAddress string `json:"collection_address"`
TokenID string `json:"token_id"`
TokenCount uint `json:"token_count"`
TokenCount string `json:"token_count"`
BlockNumber uint64 `json:"block_number"`
TransactionHash string `json:"transaction_hash"`
EventIndex uint `json:"event_index"`
Expand Down
2 changes: 1 addition & 1 deletion service/parsers/seaport_sale.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func SeaportSale(log types.Log) (*events.Sale, error) {
MarketplaceAddress: log.Address.Hex(),
CollectionAddress: nft.Address.Hex(),
TokenID: nft.Identifier.String(),
TokenCount: uint(nft.Amount.Uint64()),
TokenCount: nft.Amount.String(),
BlockNumber: log.BlockNumber,
TransactionHash: log.TxHash.Hex(),
EventIndex: log.Index,
Expand Down
2 changes: 1 addition & 1 deletion service/parsers/wyvern_sale.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func WyvernSale(log types.Log) (*events.Sale, error) {
MarketplaceAddress: log.Address.Hex(),
CollectionAddress: "", // Done in completion pipeline
TokenID: "", // Done in completion pipeline
TokenCount: 0, // Done in completion pipeline
TokenCount: "", // Done in completion pipeline
BlockNumber: log.BlockNumber,
TransactionHash: log.TxHash.Hex(),
EventIndex: log.Index,
Expand Down
1 change: 1 addition & 0 deletions service/workers/completion_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ func (p *CompletionHandler) Handle(ctx context.Context, completion *jobs.Complet
nftTransfer := nftTransfers[0]
sale.CollectionAddress = nftTransfer.CollectionAddress
sale.TokenID = nftTransfer.TokenID
sale.TokenCount = nftTransfer.TokenCount
}

// Put everything together for the result.
Expand Down

0 comments on commit 588dcc1

Please sign in to comment.