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

fix: check time window for first batch fetched #270

Merged
merged 2 commits into from
Nov 18, 2023

Conversation

swimricky
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Nov 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
grant-program ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 18, 2023 1:21am
grant-program-devnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 18, 2023 1:21am

@@ -57,6 +57,21 @@ export class TokenDispenserEventSubscriber {
this.connection.commitment as anchor.web3.Finality
)
let batchWithinWindow = true
if (currentBatch.length === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this code work? currentBatch.length is always > 0 as long as there have been transactions, currentBatch.length === 0 only happens before there have been any transactions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Youre right this length check is unnecessary assuming the program has been deployed and initialized but the rest of the logic should work. thanks for catching this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait isn't the else part the same thing as below ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but i need to do it once before the while loop since the while loop does the concat for the signatures I'm actually going to parse. Sorry let me rewrite this to be cleaner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants