starknet-edu / starknet-cairo-101

Learn how to read Cairo code
470 stars 245 forks source link

ex04 #47

Open fadyOne opened 1 year ago

fadyOne commented 1 year ago

It doesn't work for me here, I tried many things. Someone see what m I doing wrong please?

Screenshot 2023-02-02 at 13 23 35 Screenshot 2023-02-02 at 13 23 48 Screenshot 2023-02-02 at 13 23 12
fadyOne commented 1 year ago

sometimes that even put as erro = x != value "+32" and x is actually not what I sent. This time yes but sometimes I got just a random number Weird

ClementCauffet commented 1 year ago

Hi FadyOne, In fact, @LucasLvy is sneaky !

When calling "claim_points" [https://github.com/ClementCauffet/starknet-cairo-101/blob/main/contracts/ex04.cairo] the main test it does is the following :

// Checking that the value provided by the user is the one we expect // Yes, I'm sneaky let (value) = values_mapped_storage.read(user_slot); with_attr error_message("Input value is not the expected secret value") { assert value = expected_value + 32; }

where "expected_value" is the value you sent as a parameter (2615 in your example)

To solve this, you might need to focus on the "=" statement in this ! Good luck :)