-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: add r/demo/chess/register realm #163
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: moul <[email protected]>
✅ Deploy Preview for gnochess canceled.
|
✅ Deploy Preview for gnochess-signup-form canceled.
|
|
||
var players = avl.Tree{} // player -> token | ||
|
||
func RegisterPlayer(playerAddr std.Address, token string) { |
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.
how do you ensure the user send the same token as in mailchimp ?
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.
The faucet is sending it, with money at the same time.
Check the next line: assertIsFaucet()
.
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.
Yes! sorry i just realized!
The missing part is roughly this: https://github.com/gnolang/faucet/pull/2/files. I suggest we make the generic faucet repo accepting a custom callback to build the tx with arbitrary message when we don't want the faucet to actually call "send", but do "something else". |
sent := std.GetOrigSend() | ||
banker := std.GetBanker(std.BankerTypeOrigSend) | ||
pkgaddr := std.GetOrigPkgAddr() | ||
banker.SendCoins(pkgaddr, playerAddr, sent) |
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.
Just to be sure I understood correctly, so here you are transferring from the realm account to the player account. So I assume the faucet funded the realm just before ?
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.
It is not transferring from the realm account (real); I’m transferring what is still in the pipe, freshly sent by the faucet (unreal), not less, not more.
if ever someone funds the realm without a register, it is just a lost.
The amount received is directly forwarded in the same transaction; at the end of successful or failed register; the realm balance is the same at the beginning and at the end.
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.
I dont get that notion of still in the pipe...
If std.GetOrigPkgAddr()
returns the address of the original faucet, this register
realm acts as a passe-plat, and just sends the tokens from the original faucet to the player account. Am I correct?
First part of #160.
Following this, the concluding action requires the faucet to transition from the traditional
gnokey send XXXugnot targetAddr
. Instead, it should employ:This change ensures that the registration process aligns seamlessly with the newly proposed on-chain mechanism.
Depends on gnolang/faucet#2