Conversation
Signed-off-by: moul <94029+moul@users.noreply.github.com>
✅ 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.
how do you ensure the user send the same token as in mailchimp ?
There was a problem hiding this comment.
The faucet is sending it, with money at the same time.
Check the next line: assertIsFaucet().
There was a problem hiding this comment.
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.
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.
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.
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