-
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 support for realm faucet #180
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for gnochess canceled.
|
✅ Deploy Preview for gnochess-signup-form canceled.
|
Looks good, however, there is a question regarding the realm path. I initially started adding the register in I'd like the team to consider the options before merging #163 and then your PR. |
ToAddress: cfg.ToAddress, | ||
Amount: cfg.SendAmount, | ||
} | ||
} |
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.
Considering that bank.MsgSend
is already the default behavior of the faucet when no prepareTxFn
is provided, I don't think it's required to fill prepareTxFn
here.
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.
Oh I've just looked at the faucet code, and if you provide a prepareTxFn=nil
, it will probably panic when transferring funds.
The proper way is so to deal with a []faucet.Option
rather than a prepareTxFn
directly. When allowedTokens
is not empty, you add the faucet.WithPrepareTxFn
option, if it's empty you don't.
defer cancelFn() | ||
|
||
// Fetch the token from Redis | ||
token, err = redisClient.HGet(ctx, "GNO:"+cfg.ToAddress.String(), "token").Result() |
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.
token, err :=
if err != nil { | ||
// Invalid token request, pass it | ||
// to the Realm as an empty value | ||
token = "" |
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.
Do we really want that ?
Description
This PR adds support for the Realm fund method, outlined in #163
This PR is dependent on #163 being merged out and deployed.