-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically sort maps to match Soroban environment expectations #759
Conversation
Size Change: +1.74 kB (+0.05%) Total Size: 3.21 MB
|
@@ -182,12 +182,12 @@ describe('parsing and building ScVals', function () { | |||
scv = nativeToScVal( | |||
{ | |||
hello: 'world', | |||
goodbye: [1, 2, 3] | |||
there: [1, 2, 3] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's tough to grasp how expectations are validating the new sorting of keys from this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the main test for order was the earlier one. This test was evaluating that type
was being used correctly, and there are some assertions about scv[0]
and scv[1]
that become out of order since goodbye
comes before hello
lexicographically, so instead of modifying the assertion checks I just changed the key name so it'd stay in the same order as before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a minor comment for consideration.
Thank you for the expedited solution! 😄 |
Closes stellar/js-stellar-sdk#996 and stellar/js-stellar-sdk#966.
Note that test changes just involve changing the order of the map fields to be sorted accordingly in the "expected output" portion of the test.
Also, the diff is simpler if you turn whitespace off.