cardano-multiplatform-lib icon indicating copy to clipboard operation
cardano-multiplatform-lib copied to clipboard

Change PlutusMap from BtreeMap to Vec

Open SebastienGllmt opened this issue 2 years ago • 1 comments

I noticed that Berry's fork of CML changed the PlutusMap to use a Vec instead of a BtreeMap. Not sure what the rationale for this was, but just creating an issue to track this since there may have been a good reason

SebastienGllmt avatar Jul 15 '22 12:07 SebastienGllmt

So it sounds like it's because when constructing a transaction offchain, PlutusTx maintains insertion order whereas CML isn't because it uses a BtreeMap. Sounds like the solution may be to use a LinkedHashMap? The cddl type does use a map type though and I'm not sure what the implications of the regeneration are on this type

SebastienGllmt avatar Jul 20 '22 21:07 SebastienGllmt

This was likely done due to duplicate keys. I'll close this now that we have #241

rooooooooob avatar Oct 24 '23 18:10 rooooooooob