protostar icon indicating copy to clipboard operation
protostar copied to clipboard

Add `call_internal` cheatcode

Open MaksymilianDemitraszek opened this issue 2 years ago • 5 comments

To let users call internal methods of contracts

MaksymilianDemitraszek avatar Jan 05 '23 14:01 MaksymilianDemitraszek

Is this cheatcode really needed? A user should be able to test internal functions with "pure Cairo" test runner.

kasperski95 avatar Jan 18 '23 11:01 kasperski95

@kasperski95 User will not be able to test internal logic which may involve storage modifications. I think it is needed, although it has low priority. I will move it to improvements milestone.

MaksymilianDemitraszek avatar Jan 19 '23 14:01 MaksymilianDemitraszek

A user could use impureim sandwich. Pure functions could be tested with pure Cairo and storage modifications could be tested with Cheatable Starknet fixture.

kasperski95 avatar Feb 08 '23 09:02 kasperski95

@kasperski95 Definiatelty, but it kinda forces users to use certain pattern, don't you think it would be nice to have to give users the flexibility?

MaksymilianDemitraszek avatar Feb 08 '23 12:02 MaksymilianDemitraszek

Discussed internally with @MaksymilianDemitraszek, postponing this one for after-1.0 release, since users might not need it.

Arcticae avatar Feb 09 '23 13:02 Arcticae