Skip to content

feat: add support for realm faucet#180

Draft
zivkovicmilos wants to merge 1 commit intomainfrom
feat/add-faucet-realm-support
Draft

feat: add support for realm faucet#180
zivkovicmilos wants to merge 1 commit intomainfrom
feat/add-faucet-realm-support

Conversation

@zivkovicmilos
Copy link
Copy Markdown
Collaborator

Description

This PR adds support for the Realm fund method, outlined in #163

This PR is dependent on #163 being merged out and deployed.

@zivkovicmilos zivkovicmilos self-assigned this Sep 26, 2023
@netlify
Copy link
Copy Markdown

netlify bot commented Sep 26, 2023

Deploy Preview for gnochess canceled.

Name Link
🔨 Latest commit df77543
🔍 Latest deploy log https://app.netlify.com/sites/gnochess/deploys/65134a21656a1f00085419e3

@netlify
Copy link
Copy Markdown

netlify bot commented Sep 26, 2023

Deploy Preview for gnochess-signup-form canceled.

Name Link
🔨 Latest commit df77543
🔍 Latest deploy log https://app.netlify.com/sites/gnochess-signup-form/deploys/65134a21a7419500089ced3f

@moul
Copy link
Copy Markdown
Contributor

moul commented Sep 26, 2023

Looks good, however, there is a question regarding the realm path.

I initially started adding the register in r/demo/chess/register, but @harry-hov made something different in #171; I think his proposal makes sense but implies updating some commands. From what I see, there is not breaking change, but just habit changes.

I'd like the team to consider the options before merging #163 and then your PR.

ToAddress: cfg.ToAddress,
Amount: cfg.SendAmount,
}
}
Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor

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()
Copy link
Copy Markdown
Collaborator

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 = ""
Copy link
Copy Markdown
Collaborator

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 ?

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.

4 participants