This repository was archived by the owner on Aug 27, 2025. It is now read-only.
Unexpected map keys not printed when using IPC test server#904
Merged
Conversation
Contributor
Author
|
@vaivaswatha pointed me in the right direction, and the fix was relatively simple. I checked the production IPC server, and it doesn't seem to have the same problem, so I think we're good. |
anton-trunov
approved these changes
Nov 12, 2020
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
When using the test IPC server, only keys that already exist in the gold files are printed. This is clearly not what we want, and it affects the simple-dex contract on the disambiguation branch, because the map keys in the order book are sha256 hashes, so a change in the name of the key type constructors means that the key values change.
This PR fixes this problem, but this seems to reveal another bug, which show itself in the transition
test6in inplace-map.scilla:Tests 9 and 10 of inplace-map.scilla invoke this transition, starting from a contract state in which the key
"Hi"does not exist in the outermost map ofgmap3. The expected result is that the state does not change. However, the actual result is that the empty map is inserted atgmap3["Hi"][1], i.e., the equivalent of the following code:I am going to need some help figuring out how to diagnose this. Presumably the problem is somewhere in tests/ipc or tests/runner/Testcontracts.ml, because running the tests without using ipc works just fine, so I doubt the bug affects production code.