-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(simulator): start simulator wiring * feat(simulator): progress * feat(simulator): set power * fix(simulator): lint * fix: error desc * feat(simulator): update params, remove validator & fix set power * fix: determinism and refactor * fix: lint * fix(simulator): account keeper only used for testing * fix(simulator): set power logic * fix(simulator): remove x/distribution module * fix(simulator): don't remove last validator * fix(simulator): balance must be gte two * Revert "fix(simulator): remove x/distribution module" This reverts commit 2bebf6a. * feat(simulator): antehandler disabling msg withdraw delegator rewards * feat(make): simulation support * chore(simulator): parameter file * doc(simulator): integration * fix(simulator): lint * ci(simulator): simulator support * fix: ante check * deps: sdk v0.50.8 * rm go.work.sum --------- Co-authored-by: Reece Williams <[email protected]>
- Loading branch information
1 parent
14cd114
commit 93d500b
Showing
20 changed files
with
732 additions
and
2,155 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Simulator tests | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out source | ||
uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.21" | ||
check-latest: true | ||
- name: Full application simulation (fixed seed) | ||
run: make sim-full-app | ||
- name: Simulation after state import (fixed seed) | ||
run: make sim-after-import | ||
# # Requires wiring v2 | ||
# # https://github.com/strangelove-ventures/poa/issues/199 | ||
# - name: Simulation export/import (fixed seed) | ||
# run: make sim-export-import | ||
- name: Simulate application state determinism (fixed seed) | ||
run: make sim-app-determinism |
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 |
---|---|---|
|
@@ -20,4 +20,6 @@ | |
# Depinject debug file | ||
debug_container.dot | ||
|
||
build/ | ||
build/ | ||
|
||
go.work.sum |
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,38 @@ | ||
package poaante | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" | ||
|
||
"github.com/strangelove-ventures/poa" | ||
) | ||
|
||
type MsgDisableWithdrawDelegatorRewards struct { | ||
} | ||
|
||
func NewPOADisableWithdrawDelegatorRewards() MsgDisableWithdrawDelegatorRewards { | ||
return MsgDisableWithdrawDelegatorRewards{} | ||
} | ||
|
||
func (mdwr MsgDisableWithdrawDelegatorRewards) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { | ||
currHeight := ctx.BlockHeight() | ||
if currHeight <= 1 { | ||
// allow GenTx to pass | ||
return next(ctx, tx, simulate) | ||
} | ||
|
||
if mdwr.hasWithdrawDelegatorRewardsMsg(tx.GetMsgs()) { | ||
return ctx, poa.ErrWithdrawDelegatorRewardsNotAllowed | ||
} | ||
|
||
return next(ctx, tx, simulate) | ||
} | ||
|
||
func (mdwr MsgDisableWithdrawDelegatorRewards) hasWithdrawDelegatorRewardsMsg(msgs []sdk.Msg) bool { | ||
for _, msg := range msgs { | ||
if _, ok := msg.(*distrtypes.MsgWithdrawDelegatorReward); ok { | ||
return true | ||
} | ||
} | ||
return false | ||
} |
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
Oops, something went wrong.