Skip to content

Commit

Permalink
amend table in last nft trades block getter.
Browse files Browse the repository at this point in the history
  • Loading branch information
jppade committed May 18, 2022
1 parent 856c9ed commit be30eac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/nftTradescrapers/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/diadata-org/diadata/cmd/nftTradescrapers
go 1.17

require (
github.com/diadata-org/diadata v1.4.1-rc-173
github.com/diadata-org/diadata v1.4.1-rc-174
github.com/jackc/pgconn v1.10.0
github.com/sirupsen/logrus v1.8.1
)
2 changes: 1 addition & 1 deletion pkg/model/nfts.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func (rdb *RelDB) SetNFTTradeToTable(trade dia.NFTTrade, table string) error {

// GetLastBlockNFTTtrade returns the last blocknumber that was scraped for trades in @nftclass.
func (rdb *RelDB) GetLastBlockNFTTrade(nftclass dia.NFTClass) (blocknumber uint64, err error) {
query := fmt.Sprintf("SELECT block_number FROM %s WHERE nftclass_id=(SELECT nftclass_id FROM %s WHERE address='%s' AND blockchain='%s') ORDER BY block_number DESC LIMIT 1;", nfttradeTable, nftclassTable, nftclass.Address, nftclass.Blockchain)
query := fmt.Sprintf("SELECT block_number FROM %s WHERE nftclass_id=(SELECT nftclass_id FROM %s WHERE address='%s' AND blockchain='%s') ORDER BY block_number DESC LIMIT 1;", NfttradeCurrTable, nftclassTable, nftclass.Address, nftclass.Blockchain)
err = rdb.postgresClient.QueryRow(context.Background(), query).Scan(&blocknumber)
if err != nil {
return
Expand Down

0 comments on commit be30eac

Please sign in to comment.