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

Make wasm hooks importable #3747

Closed
wants to merge 140 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
06a4db1
initial tests
nicolaslara Nov 22, 2022
7132388
added tests of contracts up to transfer message
nicolaslara Nov 23, 2022
02cbae6
Merge branch 'main' into nicolas/crosschain-swaps-new
nicolaslara Nov 23, 2022
6d9d71f
remove wasmd override
nicolaslara Nov 23, 2022
b7fc5c2
working crosschain swap test via IBC
nicolaslara Nov 23, 2022
5eb319c
added acks to tests and spec for handling packet acks.
nicolaslara Nov 24, 2022
39ac521
remove ack override as I think we can get everything we need via queries
nicolaslara Nov 24, 2022
dc6119f
cleaner tests
nicolaslara Nov 25, 2022
4cd0b91
added bad ack test
nicolaslara Nov 25, 2022
0f178b4
added initial implementation of ack reporting to listeners
nicolaslara Nov 25, 2022
7a6c216
added ack listeners
nicolaslara Nov 28, 2022
c6f6b0b
added missing channel and refactored ack success
nicolaslara Nov 28, 2022
42dabdc
added recovery test
nicolaslara Nov 28, 2022
bf08ea3
added keeper and refactored types
nicolaslara Nov 30, 2022
f800288
cleanner acks with state in go
nicolaslara Nov 30, 2022
1b43cfc
removed unnecessary listeners
nicolaslara Nov 30, 2022
7d167c6
added IBC stargate message
nicolaslara Dec 1, 2022
955daf2
latest wasm
nicolaslara Dec 1, 2022
1d7351f
Merge branch 'main' into nicolas/crosschain-swaps-new
nicolaslara Dec 1, 2022
2f48bf0
added ack callbacks
nicolaslara Dec 1, 2022
41de1b3
Merge branch 'nicolas/transfer-ack-callback' into nicolas/crosschain-…
nicolaslara Dec 1, 2022
a119e98
updated bad import in tests
nicolaslara Dec 1, 2022
1b88cc7
Merge branch 'nicolas/transfer-ack-callback' into nicolas/crosschain-…
nicolaslara Dec 1, 2022
a99bee2
gofumpt
nicolaslara Dec 1, 2022
d620ef2
Merge branch 'nicolas/transfer-ack-callback' into nicolas/crosschain-…
nicolaslara Dec 1, 2022
c1f2c01
gofumpt
nicolaslara Dec 1, 2022
eff6127
remove unused file
nicolaslara Dec 1, 2022
3d67f77
Merge branch 'nicolas/transfer-ack-callback' into nicolas/crosschain-…
nicolaslara Dec 1, 2022
696bc72
removed memo on callback packets and add tests for acks
nicolaslara Dec 2, 2022
ce4ef41
only removing the memo if the only key is the callback
nicolaslara Dec 2, 2022
832f251
Merge branch 'nicolas/transfer-ack-callback' into nicolas/crosschain-…
nicolaslara Dec 2, 2022
a8dc7e6
added support for optional ack tracking
nicolaslara Dec 2, 2022
995e2b9
testing both paths
nicolaslara Dec 2, 2022
3be7e8d
added hardcoded channels
nicolaslara Dec 5, 2022
1646ea3
added crosschainswaps and swaprouter contracts
nicolaslara Dec 6, 2022
fb462a3
contract structure cleanup
nicolaslara Dec 7, 2022
4cbf3f5
reviewed swaprouter with new v13 params
nicolaslara Dec 7, 2022
db4b964
storing channels in state
nicolaslara Dec 7, 2022
dd65dff
simplified interface
nicolaslara Dec 7, 2022
2b33936
docs and removed optional key
nicolaslara Dec 7, 2022
1e131c1
fixed twap price base/quote asset
nicolaslara Dec 7, 2022
744c2ad
updated dependencies
nicolaslara Dec 9, 2022
dc74a03
added cleaner erroring for potential "reentrancy". Thanks @boss for t…
nicolaslara Dec 9, 2022
9236ddd
added next memo to the ibc packet
nicolaslara Dec 9, 2022
2e2f0aa
cleaned up errors
nicolaslara Dec 10, 2022
d44c9f7
renamed ibc_hooks to ibchooks
nicolaslara Dec 10, 2022
a03d6bb
renaming helper method
nicolaslara Dec 10, 2022
f289823
Merge branch 'main' into nicolas/transfer-ack-callback
nicolaslara Dec 10, 2022
9f41d4f
Merge branch 'nicolas/transfer-ack-callback' into nicolas/crosschain-…
nicolaslara Dec 12, 2022
198a2b6
testing nested memo
nicolaslara Dec 12, 2022
c5eca71
Tiny PR to rename slipage variable to Slippage (#3669)
njerschow Dec 13, 2022
d5f5fe2
replace slippage on new tests
nicolaslara Dec 13, 2022
4e97d4f
new bytecode
nicolaslara Dec 13, 2022
cc3189c
make tests pass without ibc testing for now
nicolaslara Dec 13, 2022
004bb2b
added x86 bytecode
nicolaslara Dec 13, 2022
67d19cc
Merge branch 'main' into nicolas/crosschain-swaps-new
nicolaslara Dec 13, 2022
19e02ae
added x86 version of swaprouter
nicolaslara Dec 13, 2022
1a2d640
gofumpt
nicolaslara Dec 13, 2022
5bdeb31
renamed callback key
nicolaslara Dec 13, 2022
1a1931a
added testing steps to readme
nicolaslara Dec 13, 2022
981dad6
Merge branch 'main' into nicolas/transfer-ack-callback
nicolaslara Dec 14, 2022
4987812
added missing store key to upgrade
nicolaslara Dec 14, 2022
bccc9a4
added apline debug image so that sh is available
nicolaslara Dec 14, 2022
0bfa4a3
fixed callback param
nicolaslara Dec 14, 2022
41157d9
Merge branch 'nicolas/transfer-ack-callback' into nicolas/crosschain-…
nicolaslara Dec 14, 2022
87be57b
updated callback key
nicolaslara Dec 14, 2022
6efbaa7
remove old check
nicolaslara Dec 14, 2022
5c984c0
removing the directive to test
nicolaslara Dec 14, 2022
623b464
removing the second check as it breaks the yml file
nicolaslara Dec 14, 2022
4c19467
updated dependencies
nicolaslara Dec 14, 2022
7eb273b
only running on rust changes
nicolaslara Dec 14, 2022
b48a95d
better derives and fixed clippy warnings
nicolaslara Dec 15, 2022
abc5fa6
Merge branch 'nicolas/contract-checks-fix' into nicolas/crosschain-sw…
nicolaslara Dec 15, 2022
37c80f4
fixed readme
nicolaslara Dec 15, 2022
05fe3ae
Update x/ibc-hooks/wasm_hook.go
nicolaslara Dec 15, 2022
7d3566c
added test for empty memo
nicolaslara Dec 15, 2022
f83a3e2
renamed ibc hooks keeper
nicolaslara Dec 15, 2022
ade5cdd
Merge branch 'main' into nicolas/transfer-ack-callback
nicolaslara Dec 15, 2022
830cc72
updated deps
nicolaslara Dec 15, 2022
aadb41f
removed unused import
nicolaslara Dec 15, 2022
ba8bf7b
fofumpt
nicolaslara Dec 15, 2022
31821df
Merge branch 'nicolas/transfer-ack-callback' into nicolas/crosschain-…
nicolaslara Dec 15, 2022
c889d43
fixed if
nicolaslara Dec 15, 2022
0a9ac6b
deleting the key once it's no longer needed
nicolaslara Dec 15, 2022
f000ded
added x86 contract
nicolaslara Dec 15, 2022
171a2d5
added x86 contract
nicolaslara Dec 15, 2022
6aeef7b
Update x/ibc-hooks/README.md
nicolaslara Dec 16, 2022
3857b43
Update x/ibc-hooks/README.md
nicolaslara Dec 16, 2022
7001f1e
Update x/ibc-hooks/README.md
nicolaslara Dec 16, 2022
ff8ea2f
renamed packet without memo
nicolaslara Dec 16, 2022
4744e5f
moving the tests out of the hooks and turning it into its own package…
nicolaslara Dec 16, 2022
68f4a39
Move osmomath into its own go.mod
ValarDragon Dec 16, 2022
490e663
Fix go mods
ValarDragon Dec 16, 2022
f0e1bec
fix osmomath test build
ValarDragon Dec 16, 2022
00cf73f
Tryfix e2e test
ValarDragon Dec 16, 2022
ebc4bfa
Try removing osmomath from the copy line?
ValarDragon Dec 16, 2022
b0558d6
Add osmomath to first copy
ValarDragon Dec 16, 2022
3db2ef8
Try another layer
ValarDragon Dec 16, 2022
c0d1596
Merge branch 'main' into nicolas/crosschain-swaps-new
nicolaslara Dec 19, 2022
c0df497
added transfer ownership to swaprouter
nicolaslara Dec 19, 2022
7551c5f
added transfer tests (and fix transfer)
nicolaslara Dec 19, 2022
cbde59b
Merge branch 'nicolas/crosschain-swaps-new' into nicolas/importable-h…
nicolaslara Dec 19, 2022
7a32bf2
Merge branch 'dev/move_osmomath_into_own_mod' into nicolas/importable…
nicolaslara Dec 19, 2022
46b40a8
renamed ibc-hooks
nicolaslara Dec 19, 2022
aef5eda
added ibc hooks to workspaces
nicolaslara Dec 19, 2022
22084d5
reorg
nicolaslara Dec 19, 2022
1b9ed60
Merge branch 'main' into nicolas/move_osmoutils_into_own_mod
nicolaslara Dec 19, 2022
276c7fd
initial setup of osmoutils on its own mod
nicolaslara Dec 19, 2022
032e628
reorganized osmoutils to work together with osmomath
nicolaslara Dec 19, 2022
b5112a2
fix tests
nicolaslara Dec 19, 2022
f3db6c3
fix remaining test
nicolaslara Dec 19, 2022
08d8d8b
moved stores to the global module
nicolaslara Dec 19, 2022
9c3c75f
gofumpt
nicolaslara Dec 19, 2022
f38babc
added missing replaces to the dockerfile
nicolaslara Dec 19, 2022
7292379
go.mod needs to be copied before wasm
nicolaslara Dec 19, 2022
8e1bf11
gofumpt
nicolaslara Dec 19, 2022
f8f2848
correct order in dockerfile
nicolaslara Dec 19, 2022
d61ca91
Make build work off of tagged releases
ValarDragon Dec 19, 2022
542f159
Switch prod and E2E builds to ignore go work
ValarDragon Dec 19, 2022
4f8169d
Merge branch 'main' into dev/move_osmomath_into_own_mod
ValarDragon Dec 19, 2022
8c0745d
Fix merge conflict
ValarDragon Dec 19, 2022
1eb3d79
Add root dir to go work
ValarDragon Dec 19, 2022
f92e58d
Make osmoutils store + module account tests not import osmosis (#3775)
ValarDragon Dec 19, 2022
5f47809
remove osmostores
nicolaslara Dec 19, 2022
a041014
Merge branch 'main' into nicolas/move_osmoutils_into_own_mod
nicolaslara Dec 19, 2022
50b0cc6
go fumpt
nicolaslara Dec 19, 2022
b303736
reverted formatting to make proto checks pass
nicolaslara Dec 19, 2022
c66bd4d
Merge branch 'nicolas/move_osmoutils_into_own_mod' into nicolas/impor…
nicolaslara Dec 20, 2022
5a17898
Merge branch 'main' into nicolas/importable-hooks
nicolaslara Dec 20, 2022
5fd28ce
bring back tests
nicolaslara Dec 20, 2022
61ca24a
Merge branch 'main' into nicolas/importable-hooks
nicolaslara Dec 20, 2022
6c19124
merged main and fixed issues
nicolaslara Dec 20, 2022
a5f3f54
Merge branch 'main' into nicolas/move_osmoutils_into_own_mod
nicolaslara Dec 20, 2022
fec010c
merged main properly
nicolaslara Dec 20, 2022
973328c
Merge branch 'dev/move_osmomath_into_own_mod' into nicolas/importable…
nicolaslara Dec 21, 2022
480186a
Merge branch 'dev/move_osmomath_into_own_mod' into nicolas/move_osmou…
nicolaslara Dec 21, 2022
933d191
Merge branch 'nicolas/move_osmoutils_into_own_mod' into nicolas/impor…
nicolaslara Dec 21, 2022
1e23efb
go.work.sum
nicolaslara Dec 21, 2022
2527a38
Merge branch 'main' into nicolas/move_osmoutils_into_own_mod
nicolaslara Dec 21, 2022
bec0ab7
Merge branch 'nicolas/move_osmoutils_into_own_mod' into nicolas/impor…
nicolaslara Dec 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
contract: [{workdir: ./x/ibc-rate-limit/, output: bytecode/rate_limiter.wasm, build: artifacts/rate_limiter.wasm, name: rate_limiter}]
contract: [
{workdir: ./x/ibc-rate-limit/, output: bytecode/rate_limiter.wasm, build: artifacts/rate_limiter.wasm, name: rate_limiter},
{workdir: ./x/ibc-hooks/, output: bytecode/crosschain_swaps.wasm, build: artifacts/crosschain_swaps.wasm, name: crosschain_swaps},
{workdir: ./x/ibc-hooks/, output: bytecode/swaprouter.wasm, build: artifacts/swaprouter.wasm, name: swaprouter},
]

steps:
- name: Checkout sources
Expand Down Expand Up @@ -82,7 +86,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
workdir: [./x/ibc-rate-limit]
workdir: [./x/ibc-rate-limit, ./x/ibc-hooks/]

steps:
- name: Checkout sources
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ BUILD_TARGETS := build install
build: BUILD_ARGS=-o $(BUILDDIR)/

$(BUILD_TARGETS): check_version go.sum $(BUILDDIR)/
go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./...
GOWORK=off go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./...

$(BUILDDIR)/:
mkdir -p $(BUILDDIR)/
Expand Down Expand Up @@ -238,7 +238,7 @@ run-querygen:
### Tests & Simulation ###
###############################################################################

PACKAGES_UNIT=$(shell go list ./... | grep -E -v 'tests/simulator|e2e')
PACKAGES_UNIT=$(shell go list ./... | grep -E -v 'tests/simulator|e2e' && go list ./tests/ibc-hooks/...)
PACKAGES_E2E=$(shell go list ./... | grep '/e2e')
PACKAGES_SIM=$(shell go list ./... | grep '/tests/simulator')
TEST_PACKAGES=./...
Expand Down
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import (
v8 "github.com/osmosis-labs/osmosis/v13/app/upgrades/v8"
v9 "github.com/osmosis-labs/osmosis/v13/app/upgrades/v9"
_ "github.com/osmosis-labs/osmosis/v13/client/docs/statik"
ibc_hooks "github.com/osmosis-labs/osmosis/v13/x/ibc-hooks"
ibchooks "github.com/osmosis-labs/osmosis/x/ibc-hooks"
)

const appName = "OsmosisApp"
Expand All @@ -72,7 +72,7 @@ var (
maccPerms = moduleAccountPermissions

// module accounts that are allowed to receive tokens.
allowedReceivingModAcc = map[string]bool{ibc_hooks.WasmHookModuleAccountAddr.String(): true}
allowedReceivingModAcc = map[string]bool{ibchooks.WasmHookModuleAccountAddr.String(): true}

// TODO: Refactor wasm items into a wasm.go file
// WasmProposalsEnabled enables all x/wasm proposals when it's value is "true"
Expand Down
2 changes: 1 addition & 1 deletion app/apptesting/gamm.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package apptesting
import (
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/osmosis-labs/osmosis/v13/osmomath"
"github.com/osmosis-labs/osmosis/osmomath"
gammkeeper "github.com/osmosis-labs/osmosis/v13/x/gamm/keeper"
"github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/balancer"
"github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/stableswap"
Expand Down
6 changes: 3 additions & 3 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ import (

downtimedetector "github.com/osmosis-labs/osmosis/v13/x/downtime-detector"
downtimetypes "github.com/osmosis-labs/osmosis/v13/x/downtime-detector/types"
ibchooks "github.com/osmosis-labs/osmosis/v13/x/ibc-hooks"
ibchookskeeper "github.com/osmosis-labs/osmosis/v13/x/ibc-hooks/keeper"
ibchookstypes "github.com/osmosis-labs/osmosis/v13/x/ibc-hooks/types"
ibcratelimit "github.com/osmosis-labs/osmosis/v13/x/ibc-rate-limit"
ibcratelimittypes "github.com/osmosis-labs/osmosis/v13/x/ibc-rate-limit/types"
"github.com/osmosis-labs/osmosis/v13/x/swaprouter"
swaproutertypes "github.com/osmosis-labs/osmosis/v13/x/swaprouter/types"
ibchooks "github.com/osmosis-labs/osmosis/x/ibc-hooks"
ibchookskeeper "github.com/osmosis-labs/osmosis/x/ibc-hooks/keeper"
ibchookstypes "github.com/osmosis-labs/osmosis/x/ibc-hooks/types"

icahost "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host"
icahostkeeper "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/keeper"
Expand Down
2 changes: 1 addition & 1 deletion app/keepers/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
downtimemodule "github.com/osmosis-labs/osmosis/v13/x/downtime-detector/module"
"github.com/osmosis-labs/osmosis/v13/x/epochs"
"github.com/osmosis-labs/osmosis/v13/x/gamm"
ibc_hooks "github.com/osmosis-labs/osmosis/v13/x/ibc-hooks"
ibc_rate_limit "github.com/osmosis-labs/osmosis/v13/x/ibc-rate-limit"
"github.com/osmosis-labs/osmosis/v13/x/incentives"
"github.com/osmosis-labs/osmosis/v13/x/lockup"
Expand All @@ -46,6 +45,7 @@ import (
"github.com/osmosis-labs/osmosis/v13/x/twap/twapmodule"
"github.com/osmosis-labs/osmosis/v13/x/txfees"
valsetprefmodule "github.com/osmosis-labs/osmosis/v13/x/valset-pref/valpref-module"
ibc_hooks "github.com/osmosis-labs/osmosis/x/ibc-hooks"
)

// AppModuleBasics returns ModuleBasics for the module BasicManager.
Expand Down
6 changes: 3 additions & 3 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ import (
ibc "github.com/cosmos/ibc-go/v3/modules/core"
ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper"
ibchookstypes "github.com/osmosis-labs/osmosis/v13/x/ibc-hooks/types"
"github.com/osmosis-labs/osmosis/osmoutils/partialord"
ibchookstypes "github.com/osmosis-labs/osmosis/x/ibc-hooks/types"

ica "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts"
icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types"

downtimemodule "github.com/osmosis-labs/osmosis/v13/x/downtime-detector/module"
downtimetypes "github.com/osmosis-labs/osmosis/v13/x/downtime-detector/types"

ibc_hooks "github.com/osmosis-labs/osmosis/v13/x/ibc-hooks"
ibc_hooks "github.com/osmosis-labs/osmosis/x/ibc-hooks"

"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/auth"
Expand Down Expand Up @@ -51,7 +52,6 @@ import (

appparams "github.com/osmosis-labs/osmosis/v13/app/params"
_ "github.com/osmosis-labs/osmosis/v13/client/docs/statik"
"github.com/osmosis-labs/osmosis/v13/osmoutils/partialord"
"github.com/osmosis-labs/osmosis/v13/simulation/simtypes"
"github.com/osmosis-labs/osmosis/v13/x/epochs"
epochstypes "github.com/osmosis-labs/osmosis/v13/x/epochs/types"
Expand Down
10 changes: 5 additions & 5 deletions app/upgrades/v13/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package v13_test

import (
"fmt"
ibchookstypes "github.com/osmosis-labs/osmosis/v13/x/ibc-hooks/types"
ibchookstypes "github.com/osmosis-labs/osmosis/x/ibc-hooks/types"
"testing"

ibcratelimittypes "github.com/osmosis-labs/osmosis/v13/x/ibc-rate-limit/types"
Expand All @@ -13,7 +13,7 @@ import (
abci "github.com/tendermint/tendermint/abci/types"

"github.com/osmosis-labs/osmosis/v13/app/apptesting"
ibc_hooks "github.com/osmosis-labs/osmosis/v13/x/ibc-hooks"
ibchooks "github.com/osmosis-labs/osmosis/x/ibc-hooks"
)

type UpgradeTestSuite struct {
Expand Down Expand Up @@ -55,7 +55,7 @@ func (suite *UpgradeTestSuite) TestUpgrade() {
{
"Test that the upgrade succeeds",
func() {
acc := suite.App.AccountKeeper.GetAccount(suite.Ctx, ibc_hooks.WasmHookModuleAccountAddr)
acc := suite.App.AccountKeeper.GetAccount(suite.Ctx, ibchooks.WasmHookModuleAccountAddr)
suite.App.AccountKeeper.RemoveAccount(suite.Ctx, acc)
// Because of SDK version map bug, we can't do the following, and instaed do a massive hack
// vm := suite.App.UpgradeKeeper.GetModuleVersionMap(suite.Ctx)
Expand All @@ -68,12 +68,12 @@ func (suite *UpgradeTestSuite) TestUpgrade() {
versionStore := prefix.NewStore(store, []byte{upgradetypes.VersionMapByte})
versionStore.Delete([]byte(ibchookstypes.ModuleName))

hasAcc := suite.App.AccountKeeper.HasAccount(suite.Ctx, ibc_hooks.WasmHookModuleAccountAddr)
hasAcc := suite.App.AccountKeeper.HasAccount(suite.Ctx, ibchooks.WasmHookModuleAccountAddr)
suite.Require().False(hasAcc)
},
func() { dummyUpgrade(suite) },
func() {
hasAcc := suite.App.AccountKeeper.HasAccount(suite.Ctx, ibc_hooks.WasmHookModuleAccountAddr)
hasAcc := suite.App.AccountKeeper.HasAccount(suite.Ctx, ibchooks.WasmHookModuleAccountAddr)
suite.Require().True(hasAcc)
},
},
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v14/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package v14

import (
store "github.com/cosmos/cosmos-sdk/store/types"
ibchookstypes "github.com/osmosis-labs/osmosis/v13/x/ibc-hooks/types"
ibchookstypes "github.com/osmosis-labs/osmosis/x/ibc-hooks/types"

"github.com/osmosis-labs/osmosis/v13/app/upgrades"
downtimetypes "github.com/osmosis-labs/osmosis/v13/x/downtime-detector/types"
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v8/incentive_props.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package v8

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/osmosis-labs/osmosis/v13/osmoutils"
"github.com/osmosis-labs/osmosis/osmoutils"
poolincentiveskeeper "github.com/osmosis-labs/osmosis/v13/x/pool-incentives/keeper"
poolincentivestypes "github.com/osmosis-labs/osmosis/v13/x/pool-incentives/types"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/osmosisd/cmd/balances_from_state_export.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
tmjson "github.com/tendermint/tendermint/libs/json"
tmtypes "github.com/tendermint/tendermint/types"

"github.com/osmosis-labs/osmosis/osmoutils"
appparams "github.com/osmosis-labs/osmosis/v13/app/params"
"github.com/osmosis-labs/osmosis/v13/osmoutils"
gammtypes "github.com/osmosis-labs/osmosis/v13/x/gamm/types"
lockuptypes "github.com/osmosis-labs/osmosis/v13/x/lockup/types"

Expand Down
7 changes: 5 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ module github.com/osmosis-labs/osmosis/v13
go 1.18

require (
github.com/CosmWasm/wasmd v0.29.2-osmo-v13
github.com/CosmWasm/wasmd v0.29.2
github.com/cosmos/cosmos-proto v1.0.0-alpha8
github.com/cosmos/cosmos-sdk v0.46.7
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/iavl v0.19.4
github.com/cosmos/ibc-go/v3 v3.4.0
github.com/gogo/protobuf v1.3.3
github.com/golang/mock v1.6.0
Expand All @@ -18,6 +17,9 @@ require (
github.com/mattn/go-sqlite3 v1.14.16
github.com/ory/dockertest/v3 v3.9.1
github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3
github.com/osmosis-labs/osmosis/osmomath v0.0.1
github.com/osmosis-labs/osmosis/osmoutils v0.0.1
github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.1
github.com/pkg/errors v0.9.1
github.com/rakyll/statik v0.1.7
github.com/spf13/cast v1.5.0
Expand All @@ -41,6 +43,7 @@ require (
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect
github.com/alingse/asasalint v0.0.11 // indirect
github.com/cosmos/gogoproto v1.4.2 // indirect
github.com/cosmos/iavl v0.19.4 // indirect
github.com/creachadair/taskgroup v0.3.2 // indirect
github.com/curioswitch/go-reassign v0.2.0 // indirect
github.com/felixge/httpsnoop v1.0.1 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,8 @@ github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20221118211718-545aed73e94e h1:A3by
github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20221118211718-545aed73e94e/go.mod h1:rud0OaBIuq3+qOqtwT4SR7Q7iSzRp7w41fjninTjfnQ=
github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3 h1:YlmchqTmlwdWSmrRmXKR+PcU96ntOd8u10vTaTZdcNY=
github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3/go.mod h1:lV6KnqXYD/ayTe7310MHtM3I2q8Z6bBfMAi+bhwPYtI=
github.com/osmosis-labs/osmosis/osmomath v0.0.1 h1:23X7pPCnyzQHEYCY0YbbVVESq84cGftvacO/Wswd3A0=
github.com/osmosis-labs/osmosis/osmomath v0.0.1/go.mod h1:IpoXO7lvmfsBFfQzaqovs541hpqtrnM+GJSZDi/TZtc=
github.com/osmosis-labs/wasmd v0.29.2-osmo-v13 h1:HvxAks1ctB3nBx1cXqcmfA0g0BKe7Og77OA2j2rxaJk=
github.com/osmosis-labs/wasmd v0.29.2-osmo-v13/go.mod h1:UlLBU5vuHncwQUM9W8lw+2mEptEMFxxfVWupZ6sXtn4=
github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw=
Expand Down
8 changes: 8 additions & 0 deletions go.work
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
go 1.18

use (
./osmomath
./osmoutils
./x/ibc-hooks
.
)
45 changes: 45 additions & 0 deletions go.work.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
github.com/CosmWasm/wasmvm v1.1.1 h1:0xtdrmmsP9fibe+x42WcMkp5aQ738BICgcH3FNVLzm4=
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw=
github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSaq37xZZh7Yig=
github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I=
github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=
github.com/cenkalti/backoff/v4 v4.1.1 h1:G2HAfAmvm/GcKan2oOQpBXOd2tT2G57ZnZGWa1PxPBQ=
github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4=
github.com/coinbase/rosetta-sdk-go v0.7.0 h1:lmTO/JEpCvZgpbkOITL95rA80CPKb5CtMzLaqF2mCNg=
github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg=
github.com/cosmos/gogoproto v1.4.2 h1:UeGRcmFW41l0G0MiefWhkPEVEwvu78SZsHBvI78dAYw=
github.com/cosmos/ibc-go/v3 v3.4.0 h1:ha3cqEG36pqMWqA1D+kxDWBTZXpeFMd/aZIQF7I0xro=
github.com/creachadair/taskgroup v0.3.2 h1:zlfutDS+5XG40AOxcHDSThxKzns8Tnr9jnr6VqkYlkM=
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I=
github.com/docker/cli v20.10.17+incompatible h1:eO2KS7ZFeov5UJeaDmIs1NFEDRf32PaqRpvoEkKBy5M=
github.com/docker/docker v20.10.19+incompatible h1:lzEmjivyNHFHMNAFLXORMBXyGIhw/UP4DvJwvyKYq64=
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ=
github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=
github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g=
github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae h1:O4SWKdcHVCvYqyDV+9CJA1fcDN2L11Bule0iFy3YlAI=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034=
github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w=
github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA=
github.com/ory/dockertest/v3 v3.9.1 h1:v4dkG+dlu76goxMiTT2j8zV7s4oPPEppKT8K8p2f1kY=
github.com/otiai10/copy v1.7.0 h1:hVoPiN+t+7d2nzzwMiDHPSOogsWAStewq3TwU05+clE=
github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U=
github.com/rs/zerolog v1.27.0 h1:1T7qCieN22GVc8S4Q2yuexzBb1EqjbgjSH9RohbMjKs=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8=
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k=
nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g=
11 changes: 5 additions & 6 deletions osmomath/decimal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import (
"github.com/stretchr/testify/suite"
"gopkg.in/yaml.v2"

"github.com/osmosis-labs/osmosis/v13/osmomath"
gammtypes "github.com/osmosis-labs/osmosis/v13/x/gamm/types"
"github.com/osmosis-labs/osmosis/osmomath"
)

type decimalTestSuite struct {
Expand Down Expand Up @@ -719,7 +718,7 @@ func (s *decimalTestSuite) TestLog2() {
expected: osmomath.MustNewDecFromStr("99.525973560175362367047484597337715868"),
},
"log_2{Max Spot Price} = 128": {
initialValue: osmomath.BigDecFromSDKDec(gammtypes.MaxSpotPrice), // 2^128 - 1
initialValue: osmomath.BigDecFromSDKDec(osmomath.MaxSpotPrice), // 2^128 - 1
// From: https://www.wolframalpha.com/input?i=log+base+2+of+%28%282%5E128%29+-+1%29+38+digits
expected: osmomath.MustNewDecFromStr("128"),
},
Expand Down Expand Up @@ -1062,21 +1061,21 @@ func (s *decimalTestSuite) TestPowerInteger() {
"geom twap overflow: 2^log_2{max spot price + 1}": {
base: osmomath.TwoBigDec,
// add 1 for simplicity of calculation to isolate overflow.
exponent: uint64(osmomath.BigDecFromSDKDec(gammtypes.MaxSpotPrice).Add(osmomath.OneDec()).LogBase2().TruncateInt().Uint64()),
exponent: uint64(osmomath.BigDecFromSDKDec(osmomath.MaxSpotPrice).Add(osmomath.OneDec()).LogBase2().TruncateInt().Uint64()),

// https://www.wolframalpha.com/input?i=2%5E%28floor%28+log+base+2+%282%5E128%29%29%29+++39+digits
expectedResult: osmomath.MustNewDecFromStr("340282366920938463463374607431768211456"),
},
"geom twap overflow: 2^log_2{max spot price}": {
base: osmomath.TwoBigDec,
exponent: uint64(osmomath.BigDecFromSDKDec(gammtypes.MaxSpotPrice).LogBase2().TruncateInt().Uint64()),
exponent: uint64(osmomath.BigDecFromSDKDec(osmomath.MaxSpotPrice).LogBase2().TruncateInt().Uint64()),

// https://www.wolframalpha.com/input?i=2%5E%28floor%28+log+base+2+%282%5E128+-+1%29%29%29+++39+digits
expectedResult: osmomath.MustNewDecFromStr("170141183460469231731687303715884105728"),
},
"geom twap overflow: 2^log_2{max spot price / 2 - 2017}": { // 2017 is prime.
base: osmomath.TwoBigDec,
exponent: uint64(osmomath.BigDecFromSDKDec(gammtypes.MaxSpotPrice.Quo(sdk.NewDec(2)).Sub(sdk.NewDec(2017))).LogBase2().TruncateInt().Uint64()),
exponent: uint64(osmomath.BigDecFromSDKDec(osmomath.MaxSpotPrice.Quo(sdk.NewDec(2)).Sub(sdk.NewDec(2017))).LogBase2().TruncateInt().Uint64()),

// https://www.wolframalpha.com/input?i=e%5E10+41+digits
expectedResult: osmomath.MustNewDecFromStr("85070591730234615865843651857942052864"),
Expand Down
8 changes: 4 additions & 4 deletions osmomath/exp2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,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/osmomath"
"github.com/osmosis-labs/osmosis/osmomath"
"github.com/osmosis-labs/osmosis/osmoutils/osmoassert"
)

var (
Expand Down Expand Up @@ -155,7 +155,7 @@ func TestExp2ChebyshevRationalApprox(t *testing.T) {
for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
osmoassert.ConditionalPanic(t, tc.expectPanic, func() {
osmomath.ConditionalPanic(t, tc.expectPanic, func() {
// System under test.
result := osmomath.Exp2ChebyshevRationalApprox(tc.exponent)

Expand Down Expand Up @@ -289,7 +289,7 @@ func TestExp2(t *testing.T) {
for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
osmoassert.ConditionalPanic(t, tc.expectPanic, func() {
osmomath.ConditionalPanic(t, tc.expectPanic, func() {

// System under test.
result := osmomath.Exp2(tc.exponent)
Expand Down
Loading