-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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(x/bank): app wiring migration #12032
Changes from 8 commits
8c8507e
2fc1cca
57cdf78
0a0b7cf
181c0a5
1fe3585
46016e6
02a266a
93562d1
0862140
526f390
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,17 @@ | ||||||
syntax = "proto3"; | ||||||
|
||||||
package cosmos.bank.module.v1; | ||||||
|
||||||
import "cosmos/app/v1alpha1/module.proto"; | ||||||
|
||||||
// Module is the config object of the params module. | ||||||
message Module { | ||||||
option (cosmos.app.v1alpha1.module) = { | ||||||
go_import: "github.com/cosmos/cosmos-sdk/x/bank" | ||||||
}; | ||||||
|
||||||
// blocked_module_accounts configures exceptional module accounts which should be blocked from receiving funds. | ||||||
// If left empty defaults to the list of account names supplied in the auth module configuration as | ||||||
// module_account_permissions | ||||||
repeated string blocked_module_accounts = 1; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,16 @@ modules: | |
- name: params | ||
config: | ||
"@type": cosmos.params.module.v1.Module | ||
|
||
- name: bank | ||
config: | ||
"@type": cosmos.bank.module.v1.Module | ||
# uncomment to provide a block list different from the modules mentioned in auth.module_account_permissions | ||
# blocked_module_accounts: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. above we have
does this mean they can receive funds? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default (existing) behavior is to disallow funds transfer to any of the module accounts in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The block that is commented out here is new functionality, providing a way to override There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should remove the commented out block. We shouldn't encourage anyone to override this for now I think. Or is there any module account which can receive sends? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My thinking was that it might be good to demonstrate the full functionality of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, we actually want to discourage this type of customization IMHO. This particular design issue has caused bugs. Honestly I can't wait to redesign it but for now we just need to limit damage |
||
# - fee_collector | ||
# - distribution | ||
# - mint | ||
# - bonded_tokens_pool | ||
# - not_bonded_tokens_pool | ||
# - gov | ||
# - nft |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ import ( | |
"encoding/hex" | ||
"encoding/json" | ||
"fmt" | ||
"github.com/cosmos/cosmos-sdk/depinject" | ||
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" | ||
"strconv" | ||
"testing" | ||
"time" | ||
|
@@ -505,3 +507,15 @@ type EmptyAppOptions struct{} | |
func (ao EmptyAppOptions) Get(o string) interface{} { | ||
return nil | ||
} | ||
|
||
// ModuleAccountAddrs provides a list of blocked module accounts from configuration in app.yaml | ||
// | ||
// Ported from SimApp | ||
func ModuleAccountAddrs() map[string]bool { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replaces |
||
var bk bankkeeper.Keeper | ||
err := depinject.Inject(AppConfig, &bk) | ||
if err != nil { | ||
panic("unable to load DI container") | ||
} | ||
return bk.GetBlockedAddresses() | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.