openbuildxyz / StarknetBootcamp

StarknetBootcamp
9 stars 10 forks source link

exercises/enums/enums2.cairo 题目有BUG? #1

Open lispking opened 7 months ago

lispking commented 7 months ago

https://github.com/shramee/starklings-cairo1/blob/main/exercises/enums/enums2.cairo

只是按照这里的文档,将Message改了下,其他没动,代码如下

[derive(Copy, Drop)]

enum Message { // TODO: define the different variants used below Quit, Echo: felt252, Move: (u128, u128), ChangeColor: (u8, u8, u8), }

环境用默认的,没有修改过:(Rust 用的是 1.74)

cairo-lang-test-runner = {git = "https://github.com/starkware-libs/cairo", rev = "bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f"}
cairo-lang-test-plugin = {git = "https://github.com/starkware-libs/cairo", rev = "bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f"}
cairo-lang-runner = {git = "https://github.com/starkware-libs/cairo", rev = "bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f"}
cairo-lang-sierra = {git = "https://github.com/starkware-libs/cairo", rev = "bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f"}
scarb = { git = "https://github.com/software-mansion/scarb", version = "2.3.0" }
scarb-ui = { git = "https://github.com/software-mansion/scarb", version = "0.1.0" }
image
lispking commented 7 months ago

补充下相关信息,在几个case也有类似的问题(代码已实现了,不过把info.toml注释了),需要官方修复下,不知道跟环境是否相关。 代码仓库:https://github.com/lispking/starklings-cairo1 环境信息:Mac Air (M1),Rust 1.74,scarb 2.3.1

gianalarcon commented 7 months ago

@lispking Last week has been an upgrade on starklings official repo that introduces few bugs into the exercises. I suggest, after you do the git clone https://github.com/shramee/starklings-cairo1, input the following command ` To the get the latest stable versiongit checkout c8d77d4018e57167b9bdfb15e647a20ef5bdaa4a`

lispking commented 7 months ago

测试过,无论是runner_crate还是exercise_crate都是一样的报错的

https://github.com/shramee/starklings-cairo1/commit/c8d77d4018e57167b9bdfb15e647a20ef5bdaa4a

image
gianalarcon commented 7 months ago

You have to downgrade few commits on the main branch. After git clone ... apply git checkout c8d77d4018e57167b9bdfb15e647a20ef5bdaa4a then solve the exercises

Screen