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

Check the chain for transactions if there are attempted burns that haven't been completed #605

Closed
wants to merge 6 commits into from

Conversation

maplant
Copy link
Contributor

@maplant maplant commented Aug 18, 2023

No description provided.

@maplant maplant requested a review from bbalser August 18, 2023 02:54
@maplant maplant changed the title Save balances to check if we burned in the iot packet verifier to prevent double burning Draft: Save balances to check if we burned in the iot packet verifier to prevent double burning Aug 18, 2023
@maplant maplant changed the title Draft: Save balances to check if we burned in the iot packet verifier to prevent double burning DRAFT: Save balances to check if we burned in the iot packet verifier to prevent double burning Aug 18, 2023
@maplant maplant changed the title DRAFT: Save balances to check if we burned in the iot packet verifier to prevent double burning Save balances to check if we burned in the iot packet verifier to prevent double burning Aug 18, 2023
@jeffgrunewald
Copy link
Contributor

looks like the testing trait implementations may be missing some of the new methods

@maplant maplant changed the title Save balances to check if we burned in the iot packet verifier to prevent double burning Check the chain for transactions if there are attempted burns that haven't been completed Aug 21, 2023
iot_packet_verifier/src/burner.rs Show resolved Hide resolved
iot_packet_verifier/src/pending_burns.rs Show resolved Hide resolved
solana/src/lib.rs Show resolved Hide resolved
iot_packet_verifier/migrations/4_saved_balance.sql Outdated Show resolved Hide resolved
iot_packet_verifier/src/burner.rs Show resolved Hide resolved
@@ -65,6 +65,7 @@ hextree = "*"
solana-client = "1.14"
solana-sdk = "1.14"
solana-program = "1.11"
solana-transaction-status = "1.14"
Copy link
Contributor

Choose a reason for hiding this comment

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

friendly periodic reminder that the solana family of dependencies is in the 1.16.x range now. we'll have to struggle through an update eventually

@@ -48,25 +59,62 @@ impl PendingBurns for Pool<Postgres> {
.await
}

async fn subtract_burned_amount(
async fn fetch_incomplete_burns(&mut self) -> Result<Vec<BurnAttempt>, Self::Error> {
sqlx::query_as("SELECT * FROM attempted_burns")
Copy link
Contributor

Choose a reason for hiding this comment

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

you forget to checkin the migration for this table ?

Copy link
Contributor

@andymck andymck left a comment

Choose a reason for hiding this comment

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

Other than the missing attempted_burns table migration, lgtm

@maplant maplant closed this Aug 28, 2023
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.

3 participants