Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Challenge 3 Dice Game extension migration #240

Merged
merged 5 commits into from
Dec 9, 2024

Conversation

damianmarti
Copy link
Member

Challenge 3 migrated to an extension following #234

Closes #239

Copy link
Member

@rin-st rin-st left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Damu!

Some strange NaN's. This extension instance:
Screenshot 2024-12-06 at 15 06 32

Original challenge 3:
Screenshot 2024-12-06 at 15 07 31


Roll the dice button doesn't work with my old contract

Screen.Recording.2024-12-06.at.15.24.44.mov

And could you please add a link to install the extension to next PR's?

yarn cli -e scaffold-eth/se-2-challenges:ch3-extension-init

README.md Show resolved Hide resolved
extension/packages/hardhat/contracts/RiggedRoll.sol Outdated Show resolved Hide resolved
@damianmarti
Copy link
Member Author

Thanks, Damu!

Thanks @rin-st for testing it!

Some strange NaN's. This extension instance: Screenshot 2024-12-06 at 15 06 32

Original challenge 3: Screenshot 2024-12-06 at 15 07 31

Fixed. There was an error with the native currency price, the same issue Pablo found when I was migrating the challenge 1. This was changed on SE-2 and not on the challenges code yet. We should check this when we migrate the other challenges.

Roll the dice button doesn't work with my old contract

Screen.Recording.2024-12-06.at.15.24.44.mov

It's working fine for me. I tried to reproduce your error but I couldn't. What do you mean by "with my old contract"?

And could you please add a link to install the extension to next PR's?

yarn cli -e scaffold-eth/se-2-challenges:ch3-extension-init

Yes, sure!!

@damianmarti damianmarti requested a review from rin-st December 6, 2024 17:22
@rin-st
Copy link
Member

rin-st commented Dec 6, 2024

It's working fine for me. I tried to reproduce your error but I couldn't. What do you mean by "with my old contract"?

I meant my solution I always use for testing challenge 3. But now it works fine! It seems I used wrong browser + metamask and that's why it didn't work as expected. Sorry!

Now it looks good to me, thank you!

@damianmarti damianmarti requested a review from Pabl0cks December 7, 2024 02:24
Copy link
Collaborator

@Pabl0cks Pabl0cks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx Damu! It's looking good to me 🙌

I found an issue but don't think it's related to the migration to extension. After playing for a bit with the dice, I realized I couldn't change tabs to the homepage or /debug, and was because I had a infinite loop in the console.

Looks like getting rid of rolls in the first useEffect dependency and winners.length in the second useEffect dependency fixed the problem as a quickfix, but prefer you to check for a proper solution 🙏

We could tackle it after this PR too, I'll check if it's happening me with the standard Ch3.

Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.
    at DiceGame (webpack-internal:///(app-pages-browser)/./app/dice/page.tsx:24:78)
    at ClientPageRoot (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/client-page.js:14:11)
    at InnerLayoutRouter (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:243:11)
    at RedirectErrorBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/redirect-boundary.js:74:9)
    at RedirectBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/redirect-boundary.js:82:11)
    at NotFoundBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/not-found-boundary.js:84:11)
    at LoadingBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:349:11)
    at ErrorBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js:160:11)
    at InnerScrollAndFocusHandler (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:153:9)
    at ScrollAndFocusHandler (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:228:11)
    at RenderFromTemplateContext (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/render-from-template-context.js:16:44)
    at OuterLayoutRouter (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:370:11)
    at InnerLayoutRouter (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:243:11)
    at RedirectErrorBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/redirect-boundary.js:74:9)
    at RedirectBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/redirect-boundary.js:82:11)
    at NotFoundErrorBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/not-found-boundary.js:76:9)
    at NotFoundBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/not-found-boundary.js:84:11)
    at LoadingBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:349:11)
    at ErrorBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js:160:11)
    at InnerScrollAndFocusHandler (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:153:9)
    at ScrollAndFocusHandler (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:228:11)
    at RenderFromTemplateContext (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/render-from-template-context.js:16:44)
    at OuterLayoutRouter (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:370:11)
    at main
    at div
    at ScaffoldEthApp (webpack-internal:///(app-pages-browser)/./components/ScaffoldEthAppWithProviders.tsx:38:11)
    at div
    at ModalProvider (webpack-internal:///(app-pages-browser)/./node_modules/@rainbow-me/rainbowkit/dist/index.js:8698:11)
    at ShowBalanceProvider (webpack-internal:///(app-pages-browser)/./node_modules/@rainbow-me/rainbowkit/dist/index.js:3499:11)
    at TransactionStoreProvider (webpack-internal:///(app-pages-browser)/./node_modules/@rainbow-me/rainbowkit/dist/index.js:4040:11)
    at ModalSizeProvider (webpack-internal:///(app-pages-browser)/./node_modules/@rainbow-me/rainbowkit/dist/index.js:4266:11)

@damianmarti
Copy link
Member Author

Thx Damu! It's looking good to me 🙌

I found an issue but don't think it's related to the migration to extension. After playing for a bit with the dice, I realized I couldn't change tabs to the homepage or /debug, and was because I had a infinite loop in the console.

Looks like getting rid of rolls in the first useEffect dependency and winners.length in the second useEffect dependency fixed the problem as a quickfix, but prefer you to check for a proper solution 🙏

We could tackle it after this PR too, I'll check if it's happening me with the standard Ch3.

Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.
    at DiceGame (webpack-internal:///(app-pages-browser)/./app/dice/page.tsx:24:78)
    at ClientPageRoot (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/client-page.js:14:11)
    at InnerLayoutRouter (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:243:11)
    at RedirectErrorBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/redirect-boundary.js:74:9)
    at RedirectBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/redirect-boundary.js:82:11)
    at NotFoundBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/not-found-boundary.js:84:11)
    at LoadingBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:349:11)
    at ErrorBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js:160:11)
    at InnerScrollAndFocusHandler (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:153:9)
    at ScrollAndFocusHandler (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:228:11)
    at RenderFromTemplateContext (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/render-from-template-context.js:16:44)
    at OuterLayoutRouter (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:370:11)
    at InnerLayoutRouter (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:243:11)
    at RedirectErrorBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/redirect-boundary.js:74:9)
    at RedirectBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/redirect-boundary.js:82:11)
    at NotFoundErrorBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/not-found-boundary.js:76:9)
    at NotFoundBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/not-found-boundary.js:84:11)
    at LoadingBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:349:11)
    at ErrorBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js:160:11)
    at InnerScrollAndFocusHandler (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:153:9)
    at ScrollAndFocusHandler (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:228:11)
    at RenderFromTemplateContext (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/render-from-template-context.js:16:44)
    at OuterLayoutRouter (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:370:11)
    at main
    at div
    at ScaffoldEthApp (webpack-internal:///(app-pages-browser)/./components/ScaffoldEthAppWithProviders.tsx:38:11)
    at div
    at ModalProvider (webpack-internal:///(app-pages-browser)/./node_modules/@rainbow-me/rainbowkit/dist/index.js:8698:11)
    at ShowBalanceProvider (webpack-internal:///(app-pages-browser)/./node_modules/@rainbow-me/rainbowkit/dist/index.js:3499:11)
    at TransactionStoreProvider (webpack-internal:///(app-pages-browser)/./node_modules/@rainbow-me/rainbowkit/dist/index.js:4040:11)
    at ModalSizeProvider (webpack-internal:///(app-pages-browser)/./node_modules/@rainbow-me/rainbowkit/dist/index.js:4266:11)

Thanks @Pabl0cks for the review!!

I was able to reproduce the error but I think it's better to address this in another issue. Can you please create an issue for this? Thanks!!

@damianmarti damianmarti merged commit 5cb4a64 into challenge-3-dice-game--extension Dec 9, 2024
@damianmarti damianmarti deleted the ch3-extension-init branch December 9, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants