Skip to content
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

Ignite Tutorial on BankKeeper Use is Flawed #2828

Closed
slendermaan opened this issue Sep 12, 2022 · 2 comments · Fixed by #2835
Closed

Ignite Tutorial on BankKeeper Use is Flawed #2828

slendermaan opened this issue Sep 12, 2022 · 2 comments · Fixed by #2835
Assignees
Labels
component:docs Documentation additions or improvements. report

Comments

@slendermaan
Copy link

slendermaan commented Sep 12, 2022

Describe the bug

Credit to : HelloBloc

The Ignite tutorial on the use of BankKeeper is flawed, specifically, some of the BankKeeper.SendCoinxx operations are missing important error handling.
fix

if isFound {
         ...
        k.bankKeeper.SendCoins(ctx, buyer, owner, bid)
    }

to

if isFound {
         ...
        err := k.bankKeeper.SendCoins(ctx, buyer, owner, bid)
		if err != nil {
			return nil, err
		}
    }

To reproduce
Steps to reproduce the behavior:

  1. Build NameService
  2. Initialize a test account without token in config.yml
  3. call BuyName, you can find that it can be called normally even without money.

Doc Url
https://docs.ignite.com/guide/nameservice/keeper
image

Associated Projects
Currently the following projects may have the same error due to tutorial issues, some of them have been fixed
sourcegraph

@fadeev fadeev added the component:docs Documentation additions or improvements. label Sep 12, 2022
@tbruyelle tbruyelle self-assigned this Sep 15, 2022
tbruyelle added a commit that referenced this issue Sep 16, 2022
Fix #2828

Bonus: format all guide's go snippets
@tbruyelle
Copy link
Contributor

Hey @slendermaan thank you very much for your report. I just pushed a PR to fix that.

@slendermaan
Copy link
Author

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:docs Documentation additions or improvements. report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants