We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The sdk sims have the secp256k1 key hardcoded for generating random accounts, preventing from running sims on other chains which use custom keys.
secp256k1
// types/simulation/account.go // RandomAccounts generates n random accounts func RandomAccounts(r *rand.Rand, n int) []Account { accs := make([]Account, n) for i := 0; i < n; i++ { // don't need that much entropy for simulation privkeySeed := make([]byte, 15) r.Read(privkeySeed) accs[i].PrivKey = secp256k1.GenPrivKeyFromSecret(privkeySeed) accs[i].PubKey = accs[i].PrivKey.PubKey() accs[i].Address = sdk.AccAddress(accs[i].PubKey.Address()) accs[i].ConsKey = ed25519.GenPrivKeyFromSecret(privkeySeed) } return accs }
The easy solution I see is to pass in an argument to the SimulateFromSeed that generates a random account:
SimulateFromSeed
type RandomAccountFn func(r *rand.Rand, n int) []Account
func SimulateFromSeed( tb testing.TB, w io.Writer, app *baseapp.BaseApp, appStateFn simulation.AppStateFn, randAccFn simulation.RandomAccountFn, ops WeightedOperations, blackListedAccs map[string]bool, config simulation.Config, ) (stopEarly bool, exportedParams Params, err error) {
The text was updated successfully, but these errors were encountered:
fedekunze
Successfully merging a pull request may close this issue.
Summary of Bug
The sdk sims have the
secp256k1
key hardcoded for generating random accounts, preventing from running sims on other chains which use custom keys.The easy solution I see is to pass in an argument to the
SimulateFromSeed
that generates a random account:For Admin Use
The text was updated successfully, but these errors were encountered: