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

Bank proxy panic on creation of Community Spend Proposal to new account #576

Closed
cyborgshead opened this issue Jan 27, 2021 · 0 comments
Closed
Assignees

Comments

@cyborgshead
Copy link
Member

cyborgshead commented Jan 27, 2021

During proposal creation gov module executes proposal's content in cache-wrapped context

cacheCtx, _ := ctx.CacheContext()
handler := keeper.router.GetRoute(content.ProposalRoute())
if err := handler(cacheCtx, content); err != nil {
	  return types.Proposal{}, sdkerrors.Wrap(types.ErrInvalidProposalContent, err.Error())
}

This not cause state change but triggers hook with SendCoins in our bank's proxy module to index given address (in this case community pool spend proposal recipient).
If address not already exist this will follow to panic on nil pointer on GetAccountNumber
https://github.com/cybercongress/go-cyber/tree/master/x/bank/internal/keeper/index.go#L91

accNum := cbd.AccNumber(s.accountKeeper.GetAccount(ctx, addr).GetAccountNumber())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant