Repository navigation
test(payments): compare multi-payment native amounts exactly - #1083
Merged
Merged
Conversation
…nges Build against local client protocol checkouts; pins unchanged. - ocp: add IntentMultiTransfer for SendPublicMultiPayment (one no-privacy transfer per payment) and Client.transferMultiple; handle the new Metadata case in IntentMetadata. - flipcash2: add CommunityService and FlipClient.fetchCommunity for GetCommunity. - Map ReactionUpdate.Action.BOOSTED and RemoveReactionResponse.Result.CANNOT_REMOVE_BOOSTED. - Carry boost_usd on Reactor, EmojiReaction and ReactionUpdate, the chat holdings summary, the activity BoostedReaction and the ChatMetadata.reaction_boost case.
IntentMultiTransfer.Payment.destinationOwner is now non-optional and is always written to the SendPublicMultiPayment metadata, since the server requires it when a destination PRIMARY is auto-opened. Client.transferMultiple takes a non-optional owner too. The intent now also rejects a destination owner equal to the source authority (destinationIsSource) and any payment whose native currency differs from the verified rate's currency (currencyMismatch, compared case-insensitively). Tests cover owner presence, appMetadata set/absent, duplicate owner, owner equal to source authority, destination equal to source vault, mint mismatch, and currency mismatch.
Add MultiPaymentIntentVectorTests, which builds IntentMultiTransfer from multi_payment_intent.json and asserts actions, compact messages, SHA-256, ed25519 signatures, proto metadata, and the eight rejection cases. The vectors expect destination == source vault and a repeated destination owner to be distinct rules from the others, so IntentMultiTransfer.Error gains duplicateDestinationOwner and a destination equal to the source vault now throws destinationIsSource instead of duplicateDestination. Add a repo-root .swift-version containing "xcode" so swiftly resolves to the Xcode toolchain; a swiftly 6.2.1 toolchain fails to build FlipcashCore/Package.swift against this Xcode's SDK.
`doubleValue` divided the mantissa by ten once per decimal digit, so 0.007 became 0.006999999999999999 and 0.000001 became 1.0000000000000002e-06. Android's `BigDecimal.toDouble()` rounds correctly, so the two apps could send different `native_amount` doubles in intent `client_exchange_data` for the same amount. Parse `description` with `Double(String)` instead. `NSDecimalNumber`'s `doubleValue` is no fix: over 200k sampled decimals it missed on exactly the same values as the loop, while the string parse missed none.
With Decimal.doubleValue correctly rounded, the native_amount each payment carries equals Double(fixture string) bit for bit, so the 1e-12 relative tolerance has nothing left to absorb.
bmc08gt
changed the base branch from
chore/contract-ocp-0.8.0-flipcash2-0.20.0
to
main
October 19, 2026 14:49
* origin/main: feat(chat): pick a new group's currency from a full-width row (#1084) fix(core): round Decimal.doubleValue correctly (#1082) feat(flipcash): adopt ocp 0.8.0 and flipcash2 0.20.0 contracts (#1078) chore: bump version to 2026.10.4 (#1086) chore: record 2026.10.3 as the production release (#1089) ci(release-manifest): record every TestFlight build when it processes (#1088) build: update release manifest test: stop four retry-only tests failing on a loaded runner (#1087) fix: clear the 2026.10.3 release test gate (#1085) build: update release manifest fix(chat): cap the attach card's corner radius at 40pt on iOS 26 (#1081) feat(update): check for an update every time the app returns from the background (#1080) build: update release manifest chore(chat): log where the inline photo picker flow stops (#1079) build: update release manifest fix(chat): open the author's profile from the avatar beside a photo (#1077) feat(chat): forward a message through the share sheet (#1076) feat(chat): draw message links as a message card (#1057) # Conflicts: # FlipcashCoreVectors/Tests/FlipcashCoreVectorsTests/MultiPaymentIntentVectorTests.swift
* origin/main: fix(chat): name the users a join notice is about (#1090)
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.
Stacked on #1078. Removes the 1e-12 relative tolerance that
MultiPaymentIntentVectorTestsused fornative_amount. WithDecimal.doubleValuerounding correctly, each payment's native amount equalsDouble(fixture string)bit for bit.The first commit is the same fix as #1082, so this test can pass on its own branch. Once #1082 lands on
mainand #1078 picks it up, the duplicate commit drops on rebase.