mlabs-haskell / lambda-buffers

LambdaBuffers toolkit for sharing types and their semantics between different languages
https://mlabs-haskell.github.io/lambda-buffers/
Apache License 2.0
29 stars 0 forks source link

Rust codegen: Plutus.Map configuration #223

Open bladyjoker opened 3 months ago

bladyjoker commented 3 months ago

Currently: https://github.com/mlabs-haskell/lambda-buffers/blob/f5acbc09718191cdfbf374ee5aaeacf626b8b9e9/lambda-buffers-codegen/data/rust-plutus-pla.json#L152C5-L156C7

But should point to https://github.com/mlabs-haskell/plutus-ledger-api-rust/blob/4b2660648f194647fdc17ecb793ee776f07d7df7/plutus-ledger-api/src/v1/assoc_map.rs#L15

Which is canonically https://github.com/IntersectMBO/plutus/blob/master/plutus-tx/src/PlutusTx/Data/AssocMap.hs

How does this pass the test?

bladyjoker commented 3 months ago

The BTree<K,V> has the same representation https://github.com/mlabs-haskell/plutus-ledger-api-rust/blob/4b2660648f194647fdc17ecb793ee776f07d7df7/plutus-ledger-api/src/plutus_data.rs#L457,

this is accidentally correct and we shouldn't point there but to AssocMap.