OpShin / opshin

A simple pythonic programming language for Smart Contracts on Cardano
https://book.opshin.dev/
MIT License
143 stars 28 forks source link

Add Eq and NotEq for ListType #368

Open nielstron opened 7 months ago

nielstron commented 7 months ago

Is your feature request related to a problem? Please describe. Currently list objects can not be compared directly in OpShin but only by comparing datums that contain them or by casting them into Anything. This enforces equality on a CBOR level but does not allow purely semantic comparison.

concretely compiling and executing the following does not work currently but is supposed to work

def validator(x: int, y: int):
   return [x, y] == [5, 2]

Describe the solution you'd like An implementation of Eq and NotEq in the ListType that relies only on list semantics. Note that this execution is expensive (linear in the size of the list)

Describe alternatives you've considered None.

Bug bounty: 200 ADA