Skip to content
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

Probably a bug in PlutusMap serialization #684

Closed
klntsky opened this issue Aug 27, 2024 · 1 comment
Closed

Probably a bug in PlutusMap serialization #684

klntsky opened this issue Aug 27, 2024 · 1 comment
Milestone

Comments

@klntsky
Copy link

klntsky commented Aug 27, 2024

I'm trying to create a map with duplicate keys, which should be allowed:

m = csl.PlutusMap.new()
vs = csl.PlutusMapValues.new()
zero = csl.PlutusData.new_integer(csl.BigInt.from_str('0'))
one = csl.PlutusData.new_integer(csl.BigInt.from_str('1'))
vs.add(zero)
vs.add(one)
m.insert(zero, vs)
r = csl.PlutusData.new_map(m)
r.to_hex()
'a103010302'

Which gives me the following parse using cbor.me:

A1    # map(1)
   03 # unsigned(3)
   01 # unsigned(1)


##### 2 unused bytes after the end of the data item:

03 02

Seemingly, the map size is wrong. The unused bytes fall outside the map

@lisicky lisicky added this to the 12.0.0 milestone Aug 28, 2024
@lisicky
Copy link
Contributor

lisicky commented Aug 28, 2024

Thanks @klntsky ! Fixed in 12.0.0

@lisicky lisicky closed this as completed Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants