Traffic-Based App Rewards: Fix hashing of batches#5193
Open
adetokunbo wants to merge 2 commits intoadetokunbo/use-actual-crypto-hash-in-equivalence-testfrom
Open
Conversation
- fixes a bug in how numbers were serialized; they did not match Daml - addes a migration with the SQL function that performs the fix Signed-off-by: Tim Emiola <adetokunbo@emio.la>
Signed-off-by: Tim Emiola <adetokunbo@emio.la>
d4a20cd to
daca6ed
Compare
dfordivam
reviewed
Apr 24, 2026
| // Decimal values to test format equivalence between Daml's show on Decimal | ||
| // and Postgres daml_numeric_to_text. Covers trailing zeros, negatives, | ||
| // small fractions, and integers. | ||
| val decimalFormatCases: Seq[String] = Seq( |
Contributor
There was a problem hiding this comment.
How was this obtained, could you describe the source, such that us+ future readers know / verify the coverage
Contributor
There was a problem hiding this comment.
From an brief look I noticed that max/min values are missing. so this must be hand-written.
Lets make sure we have full coverage / edge cases
dfordivam
reviewed
Apr 24, 2026
| with | ||
| input : Decimal | ||
| controller owner | ||
| do pure (hash (show input)).value |
Contributor
There was a problem hiding this comment.
is show needed? we don't have instance for Decimal?
Contributor
There was a problem hiding this comment.
We use the instance in our code, please remove show
instance CryptoHash.Hashable MintingAllowance where
hash MintingAllowance {provider, amount} =
CryptoHash.hashRecord [CryptoHash.hash provider , CryptoHash.hash amount]
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.
Follow-up/Stacked on to #5118
Fixes a bug in computation of hash of batches, and adds tests to confirm the fix
Pull Request Checklist
Cluster Testing
/cluster_teston this PR to request it, and ping someone with access to the DA-internal system to approve it./hdm_teston this PR to request it, and ping someone with access to the DA-internal system to approve it./lsu_teston this PR to request it, and ping someone with access to the DA-internal system to approve it.PR Guidelines
Fixes #n, and mention issues worked on using#nMerge Guidelines