PLT-5466 - Fix JS version of the CFD with oracle#27
Merged
Conversation
hrajchert
commented
May 10, 2023
Comment on lines
+212
to
+214
| -- THIS COMMIT IS A BRANCH-OFF MAIN WITHOUT MERKLEIZATION AND WITH SOME DECODING | ||
| -- FIX. WE NEED TO UPGRADE THE PLAYGROUND TO HANDLE MERKLEIZATION | ||
| "f97fb0fa7f23bc4631e6acafadd52c3303ea77e9" |
Collaborator
Author
There was a problem hiding this comment.
This commit corresponds to this PR applied to the latest commit without merkelization. The commit is present in this branch
jhbertra
reviewed
May 11, 2023
Comment on lines
+1631
to
+1636
| set -e | ||
| echo building project using sources from nix store... | ||
| purs compile ${builtins.toString ( | ||
| builtins.map getStoreGlob (builtins.attrValues inputs) | ||
| )} "$@" | ||
| echo done. |
Contributor
There was a problem hiding this comment.
Was this an auto-formatting change?
jhbertra
reviewed
May 11, 2023
| function recordEndPrice(name: ValueId, choiceId1: ChoiceId, choiceId2: ChoiceId, | ||
| continuation: Contract): Contract { | ||
| return Let(name, DivValue(MulValue(priceBeginning, MulValue(ChoiceValue(choiceId1), ChoiceValue(choiceId2))), (Constant 10_000_000_000_000_000n)), | ||
| return Let(name, DivValue(MulValue(priceBeginning, MulValue(ChoiceValue(choiceId1), ChoiceValue(choiceId2))), (Constant (10_000_000_000_000_000n))), |
Collaborator
Author
There was a problem hiding this comment.
It stores a value in the state to be used later to calculate the difference. The particular change was to add some missing parentheses in the Constant constructor
jhbertra
approved these changes
May 11, 2023
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.
This PR fixes the JS example of the contract for difference with oracle.
There were 2 issues, a parenthesis missing in the JS file, and I had to patch a non-merkleized version of purescript-marlowe with this fix