diff --git a/Makefile b/Makefile index b0f77847..ec0884fa 100644 --- a/Makefile +++ b/Makefile @@ -112,28 +112,27 @@ link-check: test-all: build # basic app tests @go test ./app -v - # basic simulation (seed "2" happens to not unbond all validators before reaching 100 blocks) - @go test ./app -run TestFullAppSimulation -Enabled -Commit -NumBlocks=100 -BlockSize=200 -Seed 2 -v -timeout 24h + # basic simulation (seed "4" happens to not unbond all validators before reaching 100 blocks) + @go test ./app -run TestFullAppSimulation -Enabled -Commit -NumBlocks=100 -BlockSize=200 -Seed 4 -v -timeout 24h # other sim tests - @go test ./app -run TestAppImportExport -Enabled -Commit -NumBlocks=100 -BlockSize=200 -Seed 2 -v -timeout 24h - @go test ./app -run TestAppSimulationAfterImport -Enabled -Commit -NumBlocks=100 -BlockSize=200 -Seed 2 -v -timeout 24h + @go test ./app -run TestAppImportExport -Enabled -Commit -NumBlocks=100 -BlockSize=200 -Seed 4 -v -timeout 24h + @go test ./app -run TestAppSimulationAfterImport -Enabled -Commit -NumBlocks=100 -BlockSize=200 -Seed 4 -v -timeout 24h @# AppStateDeterminism does not use Seed flag - @go test ./app -run TestAppStateDeterminism -Enabled -Commit -NumBlocks=100 -BlockSize=200 -Seed 2 -v -timeout 24h + @go test ./app -run TestAppStateDeterminism -Enabled -Commit -NumBlocks=100 -BlockSize=200 -Seed 4 -v -timeout 24h # run module tests and short simulations test-basic: test - # basic simulation (seed "2" happens to not unbond all validators before reaching 100 blocks) - @go test ./app -run TestFullAppSimulation -Enabled -Commit -NumBlocks=5 -BlockSize=200 -Seed 2 -v -timeout 2m + @go test ./app -run TestFullAppSimulation -Enabled -Commit -NumBlocks=5 -BlockSize=200 -Seed 4 -v -timeout 2m # other sim tests - @go test ./app -run TestAppImportExport -Enabled -Commit -NumBlocks=5 -BlockSize=200 -Seed 2 -v -timeout 2m - @go test ./app -run TestAppSimulationAfterImport -Enabled -Commit -NumBlocks=5 -BlockSize=200 -Seed 2 -v -timeout 2m + @go test ./app -run TestAppImportExport -Enabled -Commit -NumBlocks=5 -BlockSize=200 -Seed 4 -v -timeout 2m + @go test ./app -run TestAppSimulationAfterImport -Enabled -Commit -NumBlocks=5 -BlockSize=200 -Seed 4 -v -timeout 2m @# AppStateDeterminism does not use Seed flag - @go test ./app -run TestAppStateDeterminism -Enabled -Commit -NumBlocks=5 -BlockSize=200 -Seed 2 -v -timeout 2m + @go test ./app -run TestAppStateDeterminism -Enabled -Commit -NumBlocks=5 -BlockSize=200 -Seed 4 -v -timeout 2m test: @go test ./... -test_dredd: +test-rest: rest_test/./run_all_tests_from_make.sh test-cli: @@ -154,4 +153,4 @@ start-remote-sims: -—job-definition kava-sim-master \ -—container-override environment=[{SIM_NAME=master-$(VERSION)}] -.PHONY: all build-linux install clean build test test-cli test-all test_dredd test-basic start-remote-sims +.PHONY: all build-linux install clean build test test-cli test-all test-rest test-basic start-remote-sims diff --git a/x/cdp/simulation/operations/msgs.go b/x/cdp/simulation/operations/msgs.go index c4bacec8..4afe59b4 100644 --- a/x/cdp/simulation/operations/msgs.go +++ b/x/cdp/simulation/operations/msgs.go @@ -127,7 +127,7 @@ func SimulateMsgCdp(ak auth.AccountKeeper, k cdp.Keeper, pfk pricefeed.Keeper) s // given the current collateral value, calculate how much debt we could add while maintaining a valid liquidation ratio debt := existingCDP.Principal.AmountOf(randDebtParam.Denom).Add(totalFees) maxTotalDebt := collateralValue.Quo(randCollateralParam.LiquidationRatio) - maxDebt := maxTotalDebt.Sub(sdk.NewDecFromInt(debt)).TruncateInt() + maxDebt := (maxTotalDebt.Sub(sdk.NewDecFromInt(debt))).Mul(sdk.MustNewDecFromStr("0.95")).TruncateInt() if maxDebt.LTE(sdk.OneInt()) { // debt in cdp is maxed out return simulation.NewOperationMsgBasic(cdp.ModuleName, "no-operation", "cdp debt maxed out, cannot draw more debt", false, nil), nil, nil