-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
register everything, add simulation etc
- Loading branch information
1 parent
e0360d0
commit afd556c
Showing
7 changed files
with
100 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package ibcratelimitmodule | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/baseapp" | ||
"github.com/cosmos/cosmos-sdk/testutil/sims" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation" | ||
"github.com/cosmos/cosmos-sdk/x/simulation" | ||
"github.com/neutron-org/neutron/v4/testutil/common/sample" | ||
ibcratelimitsimulation "github.com/neutron-org/neutron/v4/x/ibc-rate-limit/simulation" | ||
"github.com/neutron-org/neutron/v4/x/ibc-rate-limit/types" | ||
) | ||
|
||
// avoid unused import issue | ||
var ( | ||
_ = sample.AccAddress | ||
_ = ibcratelimitsimulation.FindAccount | ||
_ = sims.StakePerAccount | ||
_ = simulation.MsgEntryKind | ||
_ = baseapp.Paramspace | ||
) | ||
|
||
// GenerateGenesisState creates a randomized GenState of the module | ||
func (AppModule) GenerateGenesisState(simState *module.SimulationState) { | ||
accs := make([]string, len(simState.Accounts)) | ||
for i, acc := range simState.Accounts { | ||
accs[i] = acc.Address.String() | ||
} | ||
interchainqueriesGenesis := types.GenesisState{ | ||
Params: types.DefaultParams(), | ||
} | ||
simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&interchainqueriesGenesis) | ||
} | ||
|
||
// ProposalContents doesn't return any content functions for governance proposals | ||
func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { | ||
return nil | ||
} | ||
|
||
// RegisterStoreDecoder registers a decoder | ||
func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} | ||
|
||
// WeightedOperations returns the all the gov module operations with their respective weights. | ||
func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { | ||
operations := make([]simtypes.WeightedOperation, 0) | ||
|
||
return operations | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package simulation | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation" | ||
) | ||
|
||
// FindAccount find a specific address from an account list | ||
func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { | ||
creator, err := sdk.AccAddressFromBech32(address) | ||
if err != nil { | ||
panic(err) | ||
} | ||
return simtypes.FindAccount(accs, creator) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters