lindy-labs / opus_contracts

Opus Source Code
https://opus.money
Other
0 stars 0 forks source link

chore: bump Cairo to `v2.6.x` #564

Closed tserg closed 8 months ago

tserg commented 8 months ago

This PR bumps Cairo to v2.6.3, and updates the syntax to the extent needed for the test suite to pass. It also fixes a few tests that are now failing.

In addition, I also had to set the edition to 2023_11, as the other alternatives resulted in a collision between Zeroable and Zero traits which are both imported in the prelude. This also means that I had to add pub to every mod, function, structs and struct members, which is not that nice.

Other changes

This PR does not address the following, which should be followed up separately:

  1. Compiler warnings for unused variables that are used in event assertions that are currently commented out.
  2. Using new features like assert_not_emitted for negative assertions of events
tserg commented 8 months ago

I tried upgrading to scarb 2.6.4 and snfoundry 0.20.0 but it looks like there are some issues in the CI.

tserg commented 8 months ago

Looking at the changes got me thinking - what do you think about having a .tool-versions file in the repo? It would look like this

scarb 2.6.3
starknet-foundry 0.19.0

It's an asdf thing AFAIK. The purpose is to ensure we're all using the same toolchain. Scarb and SNFoundry CI actions are aware of it as well so we wouldn't have to declare the versions in the yaml.

Sounds good!