For Maps key order is important for Rust but not for JS

Open
#805 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust, typescript
Domain
cli

Research direction

Start with the TypeScript Map examples and trace the bindings-side preflight and delivery path to determine where map ordering is handled before Rust receives it. Done means both insertion orders no longer produce different preflight results, with coverage for the two examples.

Written by the indexing model from the issue text.

Description

bug

Take this Map for example

This works

let indexes = new Map<number, number[]>();
    indexes.set(0, [1, 0]);
    indexes.set(1, [3, 2]);

This throws an error during preflight

let indexes = new Map<number, number[]>();
    indexes.set(1, [3, 2]);
    indexes.set(0, [1, 0]);

Either A) we should use objects vs maps as those are alphabetically sorted (I think? maybe?) or better yet you include some util on the bindings side that takes maps and ensures they're ordered however Rust expects them to before delivery.

Dominant language
Rust
Stars
123
Forks
141
Avg merge
2d 21h
Merged PRs (30d)
17

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stellar/stellar-cli

All issues in stellar/stellar-cli

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.