Fix stroops overflow, missing merchants.updated_at, add PATCH /me - #1009
Open
joel-metal wants to merge 1 commit into
Open
Fix stroops overflow, missing merchants.updated_at, add PATCH /me#1009joel-metal wants to merge 1 commit into
joel-metal wants to merge 1 commit into
Conversation
…TCH /me - Use checked_mul/checked_add in parse_amount_to_stroops to avoid silent i64 overflow for XLM amounts above ~922,337,203 XLM (kellymusk#963) - Add updated_at column to merchants table, model, and queries for consistency with every other table (kellymusk#967) - Add PATCH /me to let a merchant update their name, keeping users.name and merchants.name in sync in one transaction (kellymusk#968) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0176gtGcUc8tMZmF8aZysxmD
|
@joel-metal Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
parse_amount_to_stroopsoverflows for XLM amounts above 922,337,203 XLM #963 —parse_amount_to_stroopsinsrc/blockchain/stellar.rsnow useschecked_mul/checked_addinstead of raw multiplication/addition, returning anErrinstead of silently overflowingi64for XLM amounts above ~922,337,203 XLM.merchants.created_atcolumn has noupdated_at— inconsistent with all other tables #967 — Addedupdated_atto themerchantstable (new migration0007_merchant_updated_at.sql), theMerchantmodel, and every SQL query that touchesmerchants, matching every other table in the schema.PATCH /meto allow merchants to update their name #968 — AddedPATCH /meso a merchant can update their name after signup. Validates via the existingvalidate_name, updatesusers.nameandmerchants.nametogether in one transaction, and is documented inAPI.md/openapi.yaml.Closes #963
closes #967
closes #968
Test plan
merchants.updated_atis populatedPATCH /mewith a valid/invalidnameand confirm bothusersandmerchantsrows update togetheri64::MAX / 10_000_000stroops are rejected instead of wrapping