From d33899f56edb75d7060752a8d802ca4e0f0fb4b6 Mon Sep 17 00:00:00 2001 From: silverpill Date: Fri, 3 Dec 2021 18:52:34 +0000 Subject: [PATCH] Use token_tx_id field to find posts awaiting tokenization --- src/ethereum/nft.rs | 4 +++- src/models/posts/queries.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ethereum/nft.rs b/src/ethereum/nft.rs index d469dcf..fe9e633 100644 --- a/src/ethereum/nft.rs +++ b/src/ethereum/nft.rs @@ -68,6 +68,8 @@ struct TokenTransfer { token_id: Token, } +/// Finds posts awaiting tokenization +/// and looks for corresponding Mint events pub async fn process_events( web3: &Web3, contract: &Contract, @@ -93,7 +95,7 @@ pub async fn process_events( return Ok(()) } log::info!( - "{} posts are waiting for token to be minted", + "{} posts are waiting for confirmation of tokenization tx", token_waitlist_active_count, ); diff --git a/src/models/posts/queries.rs b/src/models/posts/queries.rs index 6f0f605..5af0291 100644 --- a/src/models/posts/queries.rs +++ b/src/models/posts/queries.rs @@ -581,7 +581,7 @@ pub async fn get_token_waitlist( " SELECT post.id FROM post - WHERE ipfs_cid IS NOT NULL AND token_id IS NULL + WHERE token_tx_id IS NOT NULL AND token_id IS NULL ", &[], ).await?;