Skip to content

Conversation

@rosalogia
Copy link
Contributor

This PR adds tests for each entrypoint in the ID and Hashlock example contracts found at https://ide.ligolang.org/.

All entrypoints for ID contract are tested so far. In order for them to run to completion or error, some changes had to be made:

  • The implementation of EQ instruction had to be modified. The implementation seemed to take an input value of Int(1) as True and Int(0) as False. However, according to Michelson reference, EQ should return True only if the two values at the top of the stack are equal, and False otherwise. I believe this includes negative values, since otherwise the ID contract does not run.
  • Support for specifying transaction amount had to be added, as certain entrypoints will fail if the transaction amount is not set appropriately

@rosalogia rosalogia force-pushed the @rosalogia/test-id-hashlock branch from 88e0961 to 3552a3c Compare September 27, 2022 09:38
@rosalogia rosalogia requested a review from pkhry September 28, 2022 19:34
@rosalogia rosalogia force-pushed the @rosalogia/test-id-hashlock branch from d2eb61e to 8299098 Compare October 3, 2022 19:27
@pkhry pkhry marked this pull request as ready for review October 4, 2022 18:28
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

Successfully merging this pull request may close these issues.

3 participants