-
Notifications
You must be signed in to change notification settings - Fork 249
refactor(cmd/testnetify): add multi-account support #2012
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,12 +41,13 @@ type ConsAddress struct { | |
| } | ||
|
|
||
| type TestnetValidator struct { | ||
| Moniker string `json:"moniker"` | ||
| Operator AccAddress `json:"operator"` | ||
| Bonded bool `json:"bonded"` | ||
| Commission stakingtypes.Commission `json:"commission"` | ||
| MinSelfDelegation sdk.Int `json:"min_self_delegation"` | ||
| Home string `json:"home"` | ||
| Moniker string `json:"moniker"` | ||
| Operator AccAddress `json:"operator"` | ||
| Status stakingtypes.BondStatus `json:"status"` | ||
| Commission stakingtypes.Commission `json:"commission"` | ||
| MinSelfDelegation sdk.Int `json:"min_self_delegation"` | ||
| Home string `json:"home"` | ||
| Delegations []akash.TestnetDelegation `json:"delegations"` | ||
|
|
||
| privValidator *pvm.FilePV | ||
| pubKey crypto.PubKey | ||
|
|
@@ -59,7 +60,7 @@ type TestnetValidators []TestnetValidator | |
| type TestnetConfig struct { | ||
| ChainID string `json:"chain_id"` | ||
| Validators TestnetValidators `json:"validators"` | ||
| Accounts []sdk.AccAddress `json:"accounts"` | ||
| Accounts []akash.TestnetAccount `json:"accounts"` | ||
| Gov akash.TestnetGovConfig `json:"gov"` | ||
|
Comment on lines
+63
to
64
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. Bech32 JSON parsing gap for Accounts/Delegations (sdk.AccAddress). cfg.Accounts uses app.TestnetAccount, which has sdk.AccAddress. Without a custom UnmarshalJSON, JSON expects base64, not bech32. Same for Delegations’ Address field. This will confuse users and likely break config loading. Two viable fixes (pick one):
I can draft the UnmarshalJSON implementations in app/testnet.go if you prefer. Would you like that? 🤖 Prompt for AI Agents |
||
| upgrade akash.TestnetUpgrade | ||
| } | ||
|
|
||
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.
Use sdk.Coins for Balances to match bank APIs.
Bank.MintCoins/SendCoinsFromModuleToAccount accept sdk.Coins. Using []sdk.Coin here causes friction and type mismatches elsewhere.
type TestnetAccount struct { Address sdk.AccAddress `json:"address"` - Balances []sdk.Coin `json:"balances"` + Balances sdk.Coins `json:"balances"` }📝 Committable suggestion