You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an argument is or contains a Map Rust expects the keys to be alphabetically ordered but JS doesn't enforce that. This will cause unclear errors right now. Soroban client likely should perform a key sort behind the scenes in order to avoid this issue.
The text was updated successfully, but these errors were encountered:
@willemneal is this something you can incorporate (or needs to be incorporated?) into ContractSpec? I can look into doing this in parallel for nativeToScVal.
I'm not sure this is the responsibility of the contract spec.
The contract spec doesn't have an opinion on how the Map val is ordered. It presents the fields in the order of code such that they can be regenerated in the same order.
Also, Maps are used irrespective of a contract type, and so the JS lib and every SDK needs to be able to support sorting a maps entries so they're valid. Map keys may be numbers, symbols, strings, bytes, anything really. This is going to be pretty challenging.
When an argument is or contains a Map Rust expects the keys to be alphabetically ordered but JS doesn't enforce that. This will cause unclear errors right now. Soroban client likely should perform a key sort behind the scenes in order to avoid this issue.
The text was updated successfully, but these errors were encountered: