-
Notifications
You must be signed in to change notification settings - Fork 5
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
fix for isRegistered always true #43
Conversation
Visit the preview URL for this PR (updated for commit 3a4af40): https://astarbase-a4922--pr43-fix-isregistered-alw-pfa0f9mi.web.app (expires Fri, 29 Jul 2022 15:16:52 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
isRegistered has become a transaction and requiring opening metamask. It should remain a view function and should not change |
else{ | ||
// if ss58PublicKey32 was 0, it will be encoded as 0x000...000 | ||
// this will cause chack in isRegister to show len(0)>0 | ||
delete ss58PublicKey; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot modify blockchain state in isRegistered function. It should remain a view function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right. But the reason that this method needs signing is in call to register()
this delete is for the local variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a view function to show user is registered or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make isRegistered a view method
working fine |
When isRegistered() is called with enabled external database (Shiden only) it will always result with true. The problem is that 0x000...000 will have length>0
Problem fixed with this PR is check for register() when ss58 address is 0.
set isRegistered() to be view function. Remore re-register from the isRegistered() call