kkrt-labs / kakarot-ssj

Kakarot zkEVM - rewrite in the latest version of Cairo
https://www.kakarot.org
MIT License
114 stars 53 forks source link

feat: migrate tests from scarb to sn foundry #39

Open Eikix opened 11 months ago

Eikix commented 11 months ago

Feature Request

exploratory issue -> go through the tutorial and migrate from scarb to sn foundry

we're not using smart contracts yet so no big change

Eikix commented 11 months ago

also, update readme afterwards

Eikix commented 11 months ago

if need be, modify devcontainer

Eikix commented 11 months ago

blocked by a discrepancy between snforge and scarb that'll be resolved once cairo 2.1 is released

enitrat commented 11 months ago

we need #[should_panic] before, I made a PR to starknet-foundry to have it available (probably next week). There will be no changes to do.

Eikix commented 10 months ago

@enitrat tried to migrate to sn foundry on august 18th and found it impractical -> contract first approach, must deploy contracts to test functions

enitrat commented 10 months ago

-> contract first approach, must deploy contracts to test functions

Not necessarily but if you want to mock stuff, then you need to do that (unlike cairo-test)

Eikix commented 10 months ago

-> contract first approach, must deploy contracts to test functions

Not necessarily but if you want to mock stuff, then you need to do that (unlike cairo-test)

Not sure I understand

enitrat commented 10 months ago

Basically, imagine you want to test is_caller_eoa. To do that you want to mock the caller address, create your execution context, and then call is_caller_eoa. This is not possible in the current state of SN Foundry, because you can't mock global variables unless you explicitly interact with a deployed contract

see discussion here https://github.com/foundry-rs/starknet-foundry/pull/462

Eikix commented 10 months ago

I see! Thanks

Eikix commented 10 months ago

Important update: we are gathering some bugs in the Kakarot v0 codebase, we need to make sure each issue and each PR in Kakarot-ssj is aware of the lists of known bugs. Look at this link everytime you take an issue and check your issue isn't targeted by a known bug.

Eikix commented 10 months ago

Important update: we are gathering some bugs in the Kakarot v0 codebase, we need to make sure each issue and each PR in Kakarot-ssj is aware of the lists of known bugs. Look at this tracking issue everytime you take an issue and check your issue isn't targeted by a known bug. Will add this reminder in many places to make sure we keep track of known bugs.