anoma / juvix

A language for intent-centric and declarative decentralised applications
https://docs.juvix.org
GNU General Public License v3.0
457 stars 53 forks source link

Fix StdlibRandomNextBytes call #3150

Closed paulcadman closed 2 weeks ago

paulcadman commented 2 weeks ago

The hoon code that generates the stdlib call is:

https://github.com/anoma/juvix/blob/1a8b6324631be26a197404601a69e4bf61be3870/src/Juvix/Compiler/Nockma/AnomaLib.hs#L101

i.e the random number generator is the first argument and the width is the second argument. We have the arguments transposed in the corresponding Juvix builtin API so the call was failing.

This PR transposes the argumetns in the stdlib call so the builtin API and hoon generated nock code are compatible.