cosmos / b9-checkers-academy-draft

32 stars 40 forks source link

full_game.go contains invalid/unreachable import #35

Closed lubkoll closed 2 years ago

lubkoll commented 2 years ago

In full_game.go the rules are imported from "github.com/xavierlepretre/checkers/x/checkers/rules", which either does not exist or is in a private repo. To my understanding this should actually be "github.com/alice/checkers/x/checkers/rules".

xavierlepretre commented 2 years ago

In this case, before the import works, you have to copy the file manually and change the package, as explained here https://tutorials.cosmos.network/academy/3-my-own-chain/stored-game.html#defining-the-rule-set.

lubkoll commented 2 years ago

In this case, before the import works, you have to copy the file manually and change the package, as explained here https://tutorials.cosmos.network/academy/3-my-own-chain/stored-game.html#defining-the-rule-set.

The described package-change does not fix the issue. Following exactly the steps as described in the tutorial, does require the above mentioned change.

xavierlepretre commented 2 years ago

Do you have your checkers on a public repo?

lubkoll commented 2 years ago

No, I followed the instructions to checkout the checkers template, but didn't fork it. I can do that if it helps.

xavierlepretre commented 2 years ago

Yes, you can push it somewhere temporary.

lubkoll commented 2 years ago

that helps because it is an implicit requirement or because you can take a look at it?

xavierlepretre commented 2 years ago

I would like to have a look at what you have that is causing your issue.

lubkoll commented 2 years ago

here it is: https://github.com/lubkoll/checkers

xavierlepretre commented 2 years ago

Mmh, you are on an old version of the project. The code of the v1 project calls itself module github.com/b9lab/checkers. So any import for github.com/b9lab/checkers would resolve to itself AFAIK. We choose this to give ourselves the opportunity to eventually host the project there elegantly.

The tutorial on the other hand should mention github.com/alice/checkers so as to be more neutral. Perhaps the emphasis is not made strongly enough that whenever you see github.com/alice/checkers you have to replace it with the name you chose at the beginning.

As for xavierlepretre, that was an even earlier version. Not sure where you found that...

lubkoll commented 2 years ago

I guess, then it is time to update the tutorial (if you are busy, I currently have some time available that I could allocate on that). I found the code through this: https://tutorials.cosmos.network/academy Regarding xavierlepretre, that is part of the linked source code in the tutorial, i.e. in sec "Store Object - Make a Checkers Blockchain" the code samples of full_game.go come with links to files in this repo.

xavierlepretre commented 2 years ago

Ah right, the links were with commit hashes, so unless we updated the link too, the change in the branch was not reflected.

Good news, the new version is ready to go online next week: https://github.com/cosmos/sdk-tutorials/pull/1169 and https://github.com/cosmos/sdk-tutorials/pull/1189 The code is already here in all the branches.

lubkoll commented 2 years ago

Nice, thanks for the feedback and patience. Will check the new versions (probably that also solves the other issues I found and didn't report yet:)