kadena-io / pact

The Pact Smart Contract Language
https://docs.kadena.io/build/pact
BSD 3-Clause "New" or "Revised" License
579 stars 100 forks source link

Weird behavior when computing the hash of a module AGAIN :-( #1284

Closed CryptoPascal31 closed 1 year ago

CryptoPascal31 commented 1 year ago

Issue description

Hi, @rsoeldner @jmcardon

This is related to https://github.com/kadena-io/pact/issues/1277.

It looks like it's not really fixed. Sorry for the pain The minimal non working example I gave on the previous issue is OK

But I have another non-working example : when embeding a modref in a list or an object

Steps to reproduce

 (module my-mod G
  (defcap G() true))

(print (hash [my-mod]))
(print (hash [my-mod]))

gives

q_B1sx9o7P9EPykeqjCTaO2jRLNoB9E1IaiYgJbHRgo
imFUeRmYadt9t60RfsZqz8g4JL3uaL_XIHZ0ZI4eqqo
Load successful

Same observation as the previous issue. Works within interactive REPL, but not when launching a file.

Expected Behavior

Pact would give the same hash

Debug Information

Tested with a fresh compiled master HEAD: Git hash 590ae43e964eb9c70badc243c308b034b6526edc

jmcardon commented 1 year ago

Christ, this is our fault, the problem is the fix does not apply this recursively to all values :/

This is a quick fix, a 1-liner change, I will prepare a PR.

Thank you for the report.

CryptoPascal31 commented 1 year ago

I've compiled and tested. Seems to work now. Thank you.