Skip to content

Commit

Permalink
Move osmoassert into osmoutils, remove osmoutils twap dependence (bac…
Browse files Browse the repository at this point in the history
…kport #3817) (#3819)

* Move osmoassert into osmoutils, remove osmoutils twap dependence (#3817)

* Move osmoassert into osmoutils

* Remove twaptypes dependence

* Add changelog

(cherry picked from commit 4f04e73)

# Conflicts:
#	CHANGELOG.md
#	x/twap/logic_test.go
#	x/twap/strategy_test.go

* Fix conflicts

Co-authored-by: Dev Ojha <[email protected]>
Co-authored-by: Dev Ojha <[email protected]>
  • Loading branch information
3 people authored Dec 21, 2022
1 parent 9b03d09 commit fe9a701
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 23 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### API breaks

* [#3763](https://github.com/osmosis-labs/osmosis/pull/3763) Move binary search and error tolerance code from `osmoutils` into `osmomath`
* [#3817](https://github.com/osmosis-labs/osmosis/pull/3817) Move osmoassert from `app/apptesting/osmoassert` to `osmoutils/osmoassert`.


### Bug fixes

Expand Down
2 changes: 1 addition & 1 deletion osmoutils/module_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/cosmos/cosmos-sdk/types/address"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"

"github.com/osmosis-labs/osmosis/v13/app/apptesting/osmoassert"
"github.com/osmosis-labs/osmosis/v13/osmoutils"
"github.com/osmosis-labs/osmosis/v13/osmoutils/osmoassert"
)

func (s *TestSuite) TestCreateModuleAccount() {
Expand Down
File renamed without changes.
19 changes: 9 additions & 10 deletions osmoutils/store_helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ import (
paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"

"github.com/osmosis-labs/osmosis/v13/app/apptesting/osmoassert"
"github.com/osmosis-labs/osmosis/v13/osmoutils"
"github.com/osmosis-labs/osmosis/v13/osmoutils/noapptest"
twaptypes "github.com/osmosis-labs/osmosis/v13/x/twap/types"
"github.com/osmosis-labs/osmosis/v13/osmoutils/osmoassert"
)

// We need to setup a test suite with account keeper
Expand Down Expand Up @@ -800,7 +799,7 @@ func (s *TestSuite) TestMustGet() {

expectPanic: true,
},
"invalid proto Dec vs TwapRecord- error": {
"invalid proto Dec vs AuthParams- error": {
preSetKeyValues: map[string]proto.Message{
keyA: &sdk.DecProto{Dec: sdk.OneDec()},
},
Expand All @@ -809,7 +808,7 @@ func (s *TestSuite) TestMustGet() {
keyA: &sdk.DecProto{Dec: sdk.OneDec()},
},

actualResultProto: &twaptypes.TwapRecord{},
actualResultProto: &authtypes.Params{},

expectPanic: true,
},
Expand Down Expand Up @@ -884,7 +883,7 @@ func (s *TestSuite) TestGet() {

expectErr: false,
},
"invalid proto Dec vs TwapRecord - found but Unmarshal err": {
"invalid proto Dec vs AuthParams - found but Unmarshal err": {
preSetKeyValues: map[string]proto.Message{
keyA: &sdk.DecProto{Dec: sdk.OneDec()},
},
Expand All @@ -893,7 +892,7 @@ func (s *TestSuite) TestGet() {
keyA: &sdk.DecProto{Dec: sdk.OneDec()},
},

actualResultProto: &twaptypes.TwapRecord{},
actualResultProto: &authtypes.Params{},

expectFound: true,

Expand Down Expand Up @@ -951,13 +950,13 @@ func (s *TestSuite) TestMustSet() {

actualResultProto: &sdk.DecProto{},
},
"basic valid TwapRecord test": {
"basic valid AuthParams test": {
setKey: keyA,
setValue: &twaptypes.TwapRecord{
PoolId: 2,
setValue: &authtypes.Params{
MaxMemoCharacters: 600,
},

actualResultProto: &twaptypes.TwapRecord{},
actualResultProto: &authtypes.Params{},
},
"invalid set value": {
setKey: keyA,
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
coretypes "github.com/tendermint/tendermint/rpc/core/types"

"github.com/osmosis-labs/osmosis/v13/app/apptesting/osmoassert"
appparams "github.com/osmosis-labs/osmosis/v13/app/params"
"github.com/osmosis-labs/osmosis/v13/osmoutils/osmoassert"
"github.com/osmosis-labs/osmosis/v13/tests/e2e/configurer/config"
"github.com/osmosis-labs/osmosis/v13/tests/e2e/initialization"
)
Expand Down
2 changes: 1 addition & 1 deletion x/gamm/keeper/pool_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/osmosis-labs/osmosis/v13/app/apptesting/osmoassert"
"github.com/osmosis-labs/osmosis/v13/osmoutils/osmoassert"
"github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/balancer"
balancertypes "github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/balancer"
"github.com/osmosis-labs/osmosis/v13/x/gamm/types"
Expand Down
2 changes: 1 addition & 1 deletion x/gamm/pool-models/balancer/pool_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/stretchr/testify/suite"

"github.com/osmosis-labs/osmosis/v13/app/apptesting"
"github.com/osmosis-labs/osmosis/v13/app/apptesting/osmoassert"
v10 "github.com/osmosis-labs/osmosis/v13/app/upgrades/v10"
"github.com/osmosis-labs/osmosis/v13/osmoutils/osmoassert"
"github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/balancer"
"github.com/osmosis-labs/osmosis/v13/x/gamm/types"
)
Expand Down
2 changes: 1 addition & 1 deletion x/gamm/pool-models/balancer/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/require"

"github.com/osmosis-labs/osmosis/osmomath"
"github.com/osmosis-labs/osmosis/v13/app/apptesting/osmoassert"
"github.com/osmosis-labs/osmosis/v13/osmoutils/osmoassert"
"github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/balancer"
"github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/internal/test_helpers"
"github.com/osmosis-labs/osmosis/v13/x/gamm/types"
Expand Down
2 changes: 1 addition & 1 deletion x/gamm/pool-models/stableswap/amm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/suite"

"github.com/osmosis-labs/osmosis/osmomath"
"github.com/osmosis-labs/osmosis/v13/app/apptesting/osmoassert"
"github.com/osmosis-labs/osmosis/v13/osmoutils/osmoassert"
sdkrand "github.com/osmosis-labs/osmosis/v13/simulation/simtypes/random"
"github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/internal/cfmm_common"
"github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/internal/test_helpers"
Expand Down
2 changes: 1 addition & 1 deletion x/gamm/pool-models/stableswap/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/tendermint/tendermint/crypto/ed25519"

"github.com/osmosis-labs/osmosis/osmomath"
"github.com/osmosis-labs/osmosis/v13/app/apptesting/osmoassert"
"github.com/osmosis-labs/osmosis/v13/osmoutils/osmoassert"
"github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/internal/cfmm_common"
"github.com/osmosis-labs/osmosis/v13/x/gamm/types"
)
Expand Down
2 changes: 1 addition & 1 deletion x/mint/keeper/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"

"github.com/osmosis-labs/osmosis/v13/app/apptesting/osmoassert"
"github.com/osmosis-labs/osmosis/v13/osmoutils/osmoassert"
"github.com/osmosis-labs/osmosis/v13/x/mint/keeper"
"github.com/osmosis-labs/osmosis/v13/x/mint/types"
)
Expand Down
2 changes: 1 addition & 1 deletion x/mint/keeper/hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

osmoapp "github.com/osmosis-labs/osmosis/v13/app"
"github.com/osmosis-labs/osmosis/v13/app/apptesting/osmoassert"
"github.com/osmosis-labs/osmosis/v13/osmoutils/osmoassert"
"github.com/osmosis-labs/osmosis/v13/x/mint/keeper"
"github.com/osmosis-labs/osmosis/v13/x/mint/types"

Expand Down
2 changes: 1 addition & 1 deletion x/mint/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

"github.com/osmosis-labs/osmosis/v13/app/apptesting"
"github.com/osmosis-labs/osmosis/v13/app/apptesting/osmoassert"
"github.com/osmosis-labs/osmosis/v13/osmoutils/osmoassert"
"github.com/osmosis-labs/osmosis/v13/x/mint/keeper"
"github.com/osmosis-labs/osmosis/v13/x/mint/types"
poolincentivestypes "github.com/osmosis-labs/osmosis/v13/x/pool-incentives/types"
Expand Down
2 changes: 1 addition & 1 deletion x/twap/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/suite"

"github.com/osmosis-labs/osmosis/v13/app/apptesting"
"github.com/osmosis-labs/osmosis/v13/app/apptesting/osmoassert"
"github.com/osmosis-labs/osmosis/v13/osmoutils/osmoassert"
"github.com/osmosis-labs/osmosis/v13/x/twap"
"github.com/osmosis-labs/osmosis/v13/x/twap/types"
)
Expand Down
2 changes: 1 addition & 1 deletion x/twap/logic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/require"

"github.com/osmosis-labs/osmosis/v13/app/apptesting/osmoassert"
"github.com/osmosis-labs/osmosis/v13/osmoutils"
"github.com/osmosis-labs/osmosis/v13/osmoutils/osmoassert"
gammtypes "github.com/osmosis-labs/osmosis/v13/x/gamm/types"
"github.com/osmosis-labs/osmosis/v13/x/twap"
"github.com/osmosis-labs/osmosis/v13/x/twap/types"
Expand Down
2 changes: 1 addition & 1 deletion x/twap/types/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/require"

"github.com/osmosis-labs/osmosis/v13/app/apptesting/osmoassert"
"github.com/osmosis-labs/osmosis/v13/osmoutils/osmoassert"
"github.com/osmosis-labs/osmosis/v13/x/gamm/types"
)

Expand Down

0 comments on commit fe9a701

Please sign in to comment.