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

Remove hiddenChars and use privateKeyToAccount to validate PK found #54

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

damianmarti
Copy link
Member

I wasn't able to test it properly. We need to add more data about the backend setup at the README.

@damianmarti damianmarti requested a review from Avelous July 24, 2024 19:41
Copy link

vercel bot commented Jul 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dice-demonstration-nextjs ❌ Failed (Inspect) Jul 24, 2024 7:42pm

isHiiddenChars = compareResult(rolledResult, game?.hiddenChars);
if (rolled && rolledResult.length > 0 && game?.hiddenPrivateKey) {
const pk: `0x{string}` = `0x${rolledResult.join("")}${game?.hiddenPrivateKey.replaceAll("*", "")}` as `0x{string}`;
const account = privateKeyToAccount(pk);
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the key. Check if the private key is found, create the account, and check the address.

Copy link
Collaborator

@Avelous Avelous left a comment

Choose a reason for hiding this comment

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

This is awesome!! Thank you @damianmarti!!

Easier to understand README coming through 😄

@Avelous Avelous merged commit 3af9ce4 into main Jul 25, 2024
2 of 3 checks passed
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.

2 participants