Skip to content
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

Delete unused simulator code #1671

Merged
merged 6 commits into from
Jun 6, 2022
Merged

Conversation

ValarDragon
Copy link
Member

@ValarDragon ValarDragon commented Jun 5, 2022

What is the purpose of the change

Remove unused boilerplate / noise from our code, for modules that don't use the simulator, or left it in unused states.

This is a change that deletes 1% of the non-generated file code in the x/ package.

Brief Changelog

  • Remove methods that constitute the AppModuleSimulation API for several modules' AppModule.
  • Add hourly epochs to the x/epochs DefaultGenesis

Testing and Verifying

make test-sim still passes

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes? yes
  • Is a relevant changelog entry added to the Unreleased section in CHANGELOG.md? yes
  • How is the feature or change documented? not applicable

@ValarDragon ValarDragon requested a review from a team June 5, 2022 04:25
@github-actions github-actions bot added C:app-wiring Changes to the app folder C:x/epochs C:x/gamm Changes, features and bugs related to the gamm module. C:x/mint C:x/txfees labels Jun 5, 2022
epochInfo := types.EpochInfo{
Identifier: "monthly",
StartTime: time.Time{},
Duration: time.Hour * 24 * 30,
CurrentEpoch: 0,
CurrentEpochStartTime: time.Time{},
EpochCountingStarted: false,
}
epochInfo := types.NewGenesisEpochInfo("monthly", time.Hour*24*30)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Driveby cleanup

Comment on lines 24 to +30

require.Equal(t, genesis.Epochs[0].Identifier, "day")
require.Equal(t, genesis.Epochs[0].StartTime, chainStartTime)
require.Equal(t, genesis.Epochs[0].Duration, time.Hour*24)
require.Equal(t, genesis.Epochs[0].CurrentEpoch, int64(0))
require.Equal(t, genesis.Epochs[0].CurrentEpochStartHeight, chainStartHeight)
require.Equal(t, genesis.Epochs[0].CurrentEpochStartTime, chainStartTime)
require.Equal(t, genesis.Epochs[0].EpochCountingStarted, false)
require.Equal(t, genesis.Epochs[1].Identifier, "week")
require.Equal(t, genesis.Epochs[1].StartTime, chainStartTime)
require.Equal(t, genesis.Epochs[1].Duration, time.Hour*24*7)
require.Equal(t, genesis.Epochs[1].CurrentEpoch, int64(0))
require.Equal(t, genesis.Epochs[1].CurrentEpochStartHeight, chainStartHeight)
require.Equal(t, genesis.Epochs[1].CurrentEpochStartTime, chainStartTime)
require.Equal(t, genesis.Epochs[1].EpochCountingStarted, false)
expectedEpochs := types.DefaultGenesis().Epochs
for i := 0; i < len(expectedEpochs); i++ {
expectedEpochs[i].CurrentEpochStartHeight = chainStartHeight
expectedEpochs[i].CurrentEpochStartTime = chainStartTime
}
require.Equal(t, expectedEpochs, genesis.Epochs)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Driveby cleanup

@ValarDragon ValarDragon merged commit f21e29e into main Jun 6, 2022
@ValarDragon ValarDragon deleted the dev/delete_unused_simulation_code branch June 6, 2022 18:36
vuong177 added a commit that referenced this pull request Jun 6, 2022
* refactor wasmbing

* refactor in wasmbinding/test

* change wasmbinding file path in simapp test

* README in wasmbinding

* minor

* remove Why Osmosis from README (#1690)

* Fix make format (#1693)

## What is the purpose of the change

Fixes `make format`, needed `mvdan.cc` added to tools directory.

## Brief Changelog

* Add mvdan.cc/gofumpt to tools folder
* Restrict it to only run on `app/ x/ ante/`, it has this annoying problem that it cannot run on the entire root folder because it reads the `.git` folder. It inherits the problem from `gofmt` that it cannot ignore a particular directory.

## Testing and Verifying

This change is a trivial rework / code cleanup without any test coverage.

## Documentation and Release Note

  - Does this pull request introduce a new feature or user-facing behavior changes? no
  - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? no
  - How is the feature or change documented? Should land into contributing.md once its here

* Delete unused simulator code (#1671)

* Delete unused simulator code

* Add hourly epochs to the x/epochs DefaultGenesis

* Add changelog

* Delete the unused x/gamm/simulation folder

* Fix epochs module tests for updated DefaultGenesis

* update CHANGELOG

* minor

Co-authored-by: alpo <[email protected]>
Co-authored-by: Dev Ojha <[email protected]>
@AlpinYukseloglu AlpinYukseloglu added the A:backport/v10.x backport patches to v10.x branch label Jul 19, 2022
mergify bot pushed a commit that referenced this pull request Jul 19, 2022
* Delete unused simulator code

* Add hourly epochs to the x/epochs DefaultGenesis

* Add changelog

* Delete the unused x/gamm/simulation folder

* Fix epochs module tests for updated DefaultGenesis

(cherry picked from commit f21e29e)

# Conflicts:
#	CHANGELOG.md
#	x/epochs/module.go
#	x/epochs/simulation/genesis.go
#	x/gamm/module.go
#	x/gamm/simulation/operations.go
#	x/mint/simulation/params_test.go
ValarDragon added a commit that referenced this pull request Jul 20, 2022
* Delete unused simulator code (#1671)

* Delete unused simulator code

* Add hourly epochs to the x/epochs DefaultGenesis

* Add changelog

* Delete the unused x/gamm/simulation folder

* Fix epochs module tests for updated DefaultGenesis

(cherry picked from commit f21e29e)

# Conflicts:
#	CHANGELOG.md
#	x/epochs/module.go
#	x/epochs/simulation/genesis.go
#	x/gamm/module.go
#	x/gamm/simulation/operations.go
#	x/mint/simulation/params_test.go

* fix conflicts and align backport with actual PR

* fix changelog conflict

Co-authored-by: Dev Ojha <[email protected]>
Co-authored-by: alpo <[email protected]>
Co-authored-by: alpo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v10.x backport patches to v10.x branch C:app-wiring Changes to the app folder C:x/epochs C:x/gamm Changes, features and bugs related to the gamm module. C:x/mint C:x/txfees
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants