fix(contracts,backend,frontend): test fee round-to-zero, BigInt timestamps, event write race, and stray label - #1132
Merged
Conversation
…ypt#830, LabsCrypt#831, and LabsCrypt#862 - LabsCrypt#794: Verify collect_fee rounds-to-zero branch test in contracts/stream_contract/src/test.rs - LabsCrypt#830: Change Stream (startTime, lastUpdateTime, endTime, pausedAt) and StreamEvent (timestamp) to BigInt in schema.prisma and add migration - LabsCrypt#831: Fix controller vs indexer event write race using upsert on transactionHash_eventType in withdraw.ts and updating ledgerSequence/timestamp in worker upsert - LabsCrypt#862: Verify stray Token: label removal in frontend stream detail page
…indexers (LabsCrypt#830) - Update createStream, topUpStreamHandler, withdrawHandler, and sorobanIndexerService to pass BigInt values for startTime, lastUpdateTime, endTime, and timestamp - Update ClaimableStreamState interface to accept number | bigint for timestamp fields
3 tasks
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 of Changes
This PR addresses issues #794, #830, #831, and #862 on branch
feat/multi-issue-fix:Contract Fee Rounding to Zero Test ([Testing] collect_fee fee-rounds-to-zero branch untested - positive fee rate but amount too small to charge #794)
test_no_fee_transfer_or_event_when_fee_rounds_to_zeroincontracts/stream_contract/src/test.rs.fee_rate_bps > 0butamount * bps / 10_000truncates to0, no fee transfer orfee_collectedevent is emitted.Backend BigInt Unix-Timestamp Schema & Migration ([Backend] Stream/StreamEvent Unix-timestamp columns typed Int overflow at 2038 (endTime can overflow today) #830)
startTime,lastUpdateTime,endTime, andpausedAtonStreamandtimestamponStreamEventfromInttoBigIntinbackend/prisma/schema.prisma.20260729170000_timestamp_bigint.soroban-event-worker.tsto compute timestamps withBigIntmath so streams ending past Jan 2038 persist and round-trip correctly.Controller vs Indexer Event Write Race Fix ([Backend] Action controllers write StreamEvent via create() + ledgerSequence:0, colliding with worker upsert on @@unique([transactionHash,eventType]) #831)
backend/src/routes/v1/streams/withdraw.tsto writeStreamEventusingupsertontransactionHash_eventTypeinstead ofcreate, eliminatingP2002500 errors when the worker indexes first.upsertcalls insoroban-event-worker.tssoupdate:setsledgerSequenceandtimestamp, correctly overwriting placeholderledgerSequence: 0entries.backend/tests/eventRace.test.ts.Frontend Stray Label Removal ([Frontend] Stray Token: labeled statement left inside handleWithdraw on stream detail page #862)
Token:JS labeled statement insidehandleWithdrawinfrontend/src/app/streams/[id]/stream-details-content.tsx.Issue Reference
Verification Steps
cargo testincontracts/stream_contractnpm testinbackendnpm run lintinfrontend