DefaultConfig returns a default configuration suitable for nearly all testing requirements.
(factory TestFixtureFactory, opts ...ConfigOption)
| 610 | // DefaultConfig returns a default configuration suitable for nearly all |
| 611 | // testing requirements. |
| 612 | func DefaultConfig(factory TestFixtureFactory, opts ...ConfigOption) Config { |
| 613 | fixture := factory() |
| 614 | |
| 615 | cfg := &networkConfigOptions{} |
| 616 | for _, opt := range opts { |
| 617 | opt(cfg) |
| 618 | } |
| 619 | |
| 620 | cdc := fixture.EncodingConfig.Codec |
| 621 | genesisState := app.NewDefaultGenesisState(cdc) |
| 622 | |
| 623 | if cfg.interceptState != nil { |
| 624 | for k, v := range genesisState { |
| 625 | res := cfg.interceptState(cdc, k, v) |
| 626 | if res != nil { |
| 627 | genesisState[k] = res |
| 628 | } |
| 629 | } |
| 630 | } |
| 631 | |
| 632 | fixture.GenesisState = genesisState |
| 633 | |
| 634 | const coinDenom = "uakt" |
| 635 | const actDenom = "uact" |
| 636 | |
| 637 | return Config{ |
| 638 | Codec: fixture.EncodingConfig.Codec, |
| 639 | TxConfig: fixture.EncodingConfig.TxConfig, |
| 640 | LegacyAmino: fixture.EncodingConfig.Amino, |
| 641 | InterfaceRegistry: fixture.EncodingConfig.InterfaceRegistry, |
| 642 | AccountRetriever: authtypes.AccountRetriever{}, |
| 643 | AppConstructor: fixture.AppConstructor, |
| 644 | GenesisState: fixture.GenesisState, |
| 645 | TimeoutCommit: 2 * time.Second, |
| 646 | ChainID: "chain-" + tmrand.NewRand().Str(6), |
| 647 | NumValidators: 4, |
| 648 | BondDenom: coinDenom, |
| 649 | Denoms: []string{ |
| 650 | coinDenom, |
| 651 | actDenom, |
| 652 | "ibc/12C6A0C374171B595A0A9E18B83FA09D295FB1F2D8C6DAA3AC28683471752D84", |
| 653 | }, |
| 654 | MinGasPrices: fmt.Sprintf("0.000006%s", coinDenom), |
| 655 | AccountTokens: sdk.TokensFromConsensusPower(1000000000000, sdk.DefaultPowerReduction), |
| 656 | StakingTokens: sdk.TokensFromConsensusPower(100000, sdk.DefaultPowerReduction), |
| 657 | BondedTokens: sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction), |
| 658 | PruningStrategy: pruningtypes.PruningOptionNothing, |
| 659 | CleanupDir: true, |
| 660 | SigningAlgo: string(hd.Secp256k1Type), |
| 661 | KeyringOptions: []keyring.Option{}, |
| 662 | } |
| 663 | } |