Skip to content

Commit

Permalink
v9 (#330)
Browse files Browse the repository at this point in the history
* v9 upgrade work

* Attempting to fix build error with specific alpine image

* Correct image version

* Reduce make parallelism

* Bump gravity-bridge dependency to v6.0.1

* Try splitting the build to fix resource constraint

* Restore original build step

* Tweak burn logic
  • Loading branch information
cbrit authored Jan 29, 2025
1 parent 1f5c6ce commit 43c564d
Show file tree
Hide file tree
Showing 259 changed files with 2,395 additions and 1,291 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.2-alpine AS build-env
FROM golang:1.22.11-alpine3.21 AS build-env

RUN apk add --no-cache curl make git libc-dev bash gcc linux-headers eudev-dev python3

Expand All @@ -14,7 +14,7 @@ RUN go mod download
COPY . .

# build Sommelier
RUN make install
RUN make install -j1

# Final image
FROM alpine:edge
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ e2e_auction_test: e2e_clean_slate
e2e_cellarfees_test: e2e_clean_slate
@E2E_SKIP_CLEANUP=true integration_tests/integration_tests.test -test.failfast -test.v -test.run IntegrationTestSuite -testify.m TestCellarFees || make -s fail

e2e_cellarfees_with_proceeds_test: e2e_clean_slate
@E2E_SKIP_CLEANUP=true integration_tests/integration_tests.test -test.failfast -test.v -test.run IntegrationTestSuite -testify.m TestProceeds || make -s fail

e2e_incentives_test: e2e_clean_slate
@E2E_SKIP_CLEANUP=true integration_tests/integration_tests.test -test.failfast -test.v -test.run IntegrationTestSuite -testify.m TestIncentives || make -s fail

Expand Down
73 changes: 41 additions & 32 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,37 +104,38 @@ import (
solomachine "github.com/cosmos/ibc-go/v7/modules/light-clients/06-solomachine"
ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
"github.com/gorilla/mux"
"github.com/peggyjv/gravity-bridge/module/v5/x/gravity"
gravityclient "github.com/peggyjv/gravity-bridge/module/v5/x/gravity/client"
gravitykeeper "github.com/peggyjv/gravity-bridge/module/v5/x/gravity/keeper"
gravitytypes "github.com/peggyjv/gravity-bridge/module/v5/x/gravity/types"
appParams "github.com/peggyjv/sommelier/v8/app/params"
v8 "github.com/peggyjv/sommelier/v8/app/upgrades/v8"
"github.com/peggyjv/sommelier/v8/x/addresses"
addresseskeeper "github.com/peggyjv/sommelier/v8/x/addresses/keeper"
addressestypes "github.com/peggyjv/sommelier/v8/x/addresses/types"
"github.com/peggyjv/sommelier/v8/x/auction"
auctionclient "github.com/peggyjv/sommelier/v8/x/auction/client"
auctionkeeper "github.com/peggyjv/sommelier/v8/x/auction/keeper"
auctiontypes "github.com/peggyjv/sommelier/v8/x/auction/types"
"github.com/peggyjv/sommelier/v8/x/axelarcork"
axelarcorkclient "github.com/peggyjv/sommelier/v8/x/axelarcork/client"
axelarcorkkeeper "github.com/peggyjv/sommelier/v8/x/axelarcork/keeper"
axelarcorktypes "github.com/peggyjv/sommelier/v8/x/axelarcork/types"
"github.com/peggyjv/sommelier/v8/x/cellarfees"
cellarfeeskeeper "github.com/peggyjv/sommelier/v8/x/cellarfees/keeper"
cellarfeestypes "github.com/peggyjv/sommelier/v8/x/cellarfees/types"
"github.com/peggyjv/sommelier/v8/x/cork"
corkclient "github.com/peggyjv/sommelier/v8/x/cork/client"
corkkeeper "github.com/peggyjv/sommelier/v8/x/cork/keeper"
corktypes "github.com/peggyjv/sommelier/v8/x/cork/types"
"github.com/peggyjv/sommelier/v8/x/incentives"
incentiveskeeper "github.com/peggyjv/sommelier/v8/x/incentives/keeper"
incentivestypes "github.com/peggyjv/sommelier/v8/x/incentives/types"
"github.com/peggyjv/sommelier/v8/x/pubsub"
pubsubclient "github.com/peggyjv/sommelier/v8/x/pubsub/client"
pubsubkeeper "github.com/peggyjv/sommelier/v8/x/pubsub/keeper"
pubsubtypes "github.com/peggyjv/sommelier/v8/x/pubsub/types"
"github.com/peggyjv/gravity-bridge/module/v6/x/gravity"
gravityclient "github.com/peggyjv/gravity-bridge/module/v6/x/gravity/client"
gravitykeeper "github.com/peggyjv/gravity-bridge/module/v6/x/gravity/keeper"
gravitytypes "github.com/peggyjv/gravity-bridge/module/v6/x/gravity/types"
appParams "github.com/peggyjv/sommelier/v9/app/params"
v8 "github.com/peggyjv/sommelier/v9/app/upgrades/v8"
v9 "github.com/peggyjv/sommelier/v9/app/upgrades/v9"
"github.com/peggyjv/sommelier/v9/x/addresses"
addresseskeeper "github.com/peggyjv/sommelier/v9/x/addresses/keeper"
addressestypes "github.com/peggyjv/sommelier/v9/x/addresses/types"
"github.com/peggyjv/sommelier/v9/x/auction"
auctionclient "github.com/peggyjv/sommelier/v9/x/auction/client"
auctionkeeper "github.com/peggyjv/sommelier/v9/x/auction/keeper"
auctiontypes "github.com/peggyjv/sommelier/v9/x/auction/types"
"github.com/peggyjv/sommelier/v9/x/axelarcork"
axelarcorkclient "github.com/peggyjv/sommelier/v9/x/axelarcork/client"
axelarcorkkeeper "github.com/peggyjv/sommelier/v9/x/axelarcork/keeper"
axelarcorktypes "github.com/peggyjv/sommelier/v9/x/axelarcork/types"
"github.com/peggyjv/sommelier/v9/x/cellarfees"
cellarfeeskeeper "github.com/peggyjv/sommelier/v9/x/cellarfees/keeper"
cellarfeestypes "github.com/peggyjv/sommelier/v9/x/cellarfees/types"
"github.com/peggyjv/sommelier/v9/x/cork"
corkclient "github.com/peggyjv/sommelier/v9/x/cork/client"
corkkeeper "github.com/peggyjv/sommelier/v9/x/cork/keeper"
corktypes "github.com/peggyjv/sommelier/v9/x/cork/types"
"github.com/peggyjv/sommelier/v9/x/incentives"
incentiveskeeper "github.com/peggyjv/sommelier/v9/x/incentives/keeper"
incentivestypes "github.com/peggyjv/sommelier/v9/x/incentives/types"
"github.com/peggyjv/sommelier/v9/x/pubsub"
pubsubclient "github.com/peggyjv/sommelier/v9/x/pubsub/client"
pubsubkeeper "github.com/peggyjv/sommelier/v9/x/pubsub/keeper"
pubsubtypes "github.com/peggyjv/sommelier/v9/x/pubsub/types"
"github.com/rakyll/statik/fs"

// unnamed import of statik for swagger UI support
Expand Down Expand Up @@ -226,7 +227,7 @@ var (
gravitytypes.ModuleName: {authtypes.Minter, authtypes.Burner},
cellarfeestypes.ModuleName: nil,
incentivestypes.ModuleName: nil,
axelarcorktypes.ModuleName: nil,
axelarcorktypes.ModuleName: {authtypes.Burner},
auctiontypes.ModuleName: {authtypes.Burner},
pubsubtypes.ModuleName: nil,
addressestypes.ModuleName: nil,
Expand Down Expand Up @@ -1092,4 +1093,12 @@ func (app *SommelierApp) setupUpgradeHandlers() {
&app.AccountKeeper,
),
)

app.UpgradeKeeper.SetUpgradeHandler(
v9.UpgradeName,
v9.CreateUpgradeHandler(
app.mm,
app.configurator,
),
)
}
2 changes: 1 addition & 1 deletion app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
appparams "github.com/peggyjv/sommelier/v8/app/params"
appparams "github.com/peggyjv/sommelier/v9/app/params"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion app/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package app

import (
"github.com/cosmos/cosmos-sdk/std"
"github.com/peggyjv/sommelier/v8/app/params"
"github.com/peggyjv/sommelier/v9/app/params"
)

// MakeEncodingConfig creates an EncodingConfig for testing. This function
Expand Down
6 changes: 3 additions & 3 deletions app/upgrades/v4/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
gravitytypes "github.com/peggyjv/gravity-bridge/module/v5/x/gravity/types"
cellarfeestypes "github.com/peggyjv/sommelier/v8/x/cellarfees/types"
corktypes "github.com/peggyjv/sommelier/v8/x/cork/types"
gravitytypes "github.com/peggyjv/gravity-bridge/module/v6/x/gravity/types"
cellarfeestypes "github.com/peggyjv/sommelier/v9/x/cellarfees/types"
corktypes "github.com/peggyjv/sommelier/v9/x/cork/types"
)

func CreateUpgradeHandler(
Expand Down
6 changes: 3 additions & 3 deletions app/upgrades/v5/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
appparams "github.com/peggyjv/sommelier/v8/app/params"
incentiveskeeper "github.com/peggyjv/sommelier/v8/x/incentives/keeper"
incentivestypes "github.com/peggyjv/sommelier/v8/x/incentives/types"
appparams "github.com/peggyjv/sommelier/v9/app/params"
incentiveskeeper "github.com/peggyjv/sommelier/v9/x/incentives/keeper"
incentivestypes "github.com/peggyjv/sommelier/v9/x/incentives/types"
)

func CreateUpgradeHandler(
Expand Down
20 changes: 10 additions & 10 deletions app/upgrades/v7/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ import (
icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper"
icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types"
ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
auctionkeeper "github.com/peggyjv/sommelier/v8/x/auction/keeper"
auctiontypes "github.com/peggyjv/sommelier/v8/x/auction/types"
axelarcorkkeeper "github.com/peggyjv/sommelier/v8/x/axelarcork/keeper"
axelarcorktypes "github.com/peggyjv/sommelier/v8/x/axelarcork/types"
cellarfeeskeeper "github.com/peggyjv/sommelier/v8/x/cellarfees/keeper"
cellarfeestypes "github.com/peggyjv/sommelier/v8/x/cellarfees/types"
corkkeeper "github.com/peggyjv/sommelier/v8/x/cork/keeper"
corktypes "github.com/peggyjv/sommelier/v8/x/cork/types/v2"
pubsubkeeper "github.com/peggyjv/sommelier/v8/x/pubsub/keeper"
pubsubtypes "github.com/peggyjv/sommelier/v8/x/pubsub/types"
auctionkeeper "github.com/peggyjv/sommelier/v9/x/auction/keeper"
auctiontypes "github.com/peggyjv/sommelier/v9/x/auction/types"
axelarcorkkeeper "github.com/peggyjv/sommelier/v9/x/axelarcork/keeper"
axelarcorktypes "github.com/peggyjv/sommelier/v9/x/axelarcork/types"
cellarfeeskeeper "github.com/peggyjv/sommelier/v9/x/cellarfees/keeper"
cellarfeestypes "github.com/peggyjv/sommelier/v9/x/cellarfees/types"
corkkeeper "github.com/peggyjv/sommelier/v9/x/cork/keeper"
corktypes "github.com/peggyjv/sommelier/v9/x/cork/types/v2"
pubsubkeeper "github.com/peggyjv/sommelier/v9/x/pubsub/keeper"
pubsubtypes "github.com/peggyjv/sommelier/v9/x/pubsub/types"
)

func CreateUpgradeHandler(
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v8/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
ibctmmigrations "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint/migrations"
auctiontypes "github.com/peggyjv/sommelier/v8/x/auction/types"
auctiontypes "github.com/peggyjv/sommelier/v9/x/auction/types"
)

func CreateUpgradeHandler(
Expand Down
10 changes: 10 additions & 0 deletions app/upgrades/v9/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# v9 Upgrade

Security patch upgrade

## Summary of Changes

* Improve validation and sanitization of token balances in the in the axelarcork module account before sweeping.
* Allocate platform proceeds before auction start
* Bump cosmos-sdk to v0.47.15
* Bump gravity-bridge to v6
5 changes: 5 additions & 0 deletions app/upgrades/v9/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package v9

const (
UpgradeName = "v9"
)
21 changes: 21 additions & 0 deletions app/upgrades/v9/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package v9

import (
"github.com/cosmos/cosmos-sdk/types/module"

sdk "github.com/cosmos/cosmos-sdk/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

func CreateUpgradeHandler(mm *module.Manager, configurator module.Configurator) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
ctx.Logger().Info("v9 upgrade: entering handler and running migrations")

vm, err := mm.RunMigrations(ctx, configurator, vm)
if err != nil {
return nil, err
}

return vm, nil
}
}
6 changes: 3 additions & 3 deletions cmd/sommelier/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (
"github.com/spf13/cast"
"github.com/spf13/cobra"

bridgecmd "github.com/peggyjv/gravity-bridge/module/v5/cmd/gravity/cmd"
"github.com/peggyjv/sommelier/v8/app"
"github.com/peggyjv/sommelier/v8/app/params"
bridgecmd "github.com/peggyjv/gravity-bridge/module/v6/cmd/gravity/cmd"
"github.com/peggyjv/sommelier/v9/app"
"github.com/peggyjv/sommelier/v9/app/params"
)

// NewRootCmd creates a new root command for simd. It is called once in the
Expand Down
4 changes: 2 additions & 2 deletions cmd/sommelier/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

"github.com/cosmos/cosmos-sdk/server"
scmd "github.com/cosmos/cosmos-sdk/server/cmd"
"github.com/peggyjv/sommelier/v8/app"
"github.com/peggyjv/sommelier/v8/cmd/sommelier/cmd"
"github.com/peggyjv/sommelier/v9/app"
"github.com/peggyjv/sommelier/v9/cmd/sommelier/cmd"
)

func main() {
Expand Down
9 changes: 4 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/peggyjv/sommelier/v8
module github.com/peggyjv/sommelier/v9

go 1.22

Expand All @@ -7,11 +7,11 @@ toolchain go1.22.1
require (
cosmossdk.io/api v0.3.1
cosmossdk.io/errors v1.0.1
cosmossdk.io/math v1.3.0
cosmossdk.io/math v1.4.0
github.com/cometbft/cometbft v0.37.5
github.com/cometbft/cometbft-db v0.11.0
github.com/cosmos/cosmos-proto v1.0.0-beta.5
github.com/cosmos/cosmos-sdk v0.47.14
github.com/cosmos/cosmos-sdk v0.47.15
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/gogoproto v1.7.0
github.com/cosmos/ibc-go/v7 v7.8.0
Expand All @@ -23,9 +23,8 @@ require (
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/miguelmota/go-ethereum-hdwallet v0.1.1
github.com/ory/dockertest/v3 v3.10.0
github.com/peggyjv/gravity-bridge/module/v5 v5.0.0-20241023135054-397d3b1298c8
github.com/peggyjv/gravity-bridge/module/v6 v6.0.1
github.com/rakyll/statik v0.1.7
github.com/regen-network/cosmos-proto v0.3.1
github.com/spf13/cast v1.6.0
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.18.2
Expand Down
14 changes: 6 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,8 @@ cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0=
cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U=
cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM=
cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU=
cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE=
cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k=
cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ=
cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk=
cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw=
cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw=
filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek=
Expand Down Expand Up @@ -749,8 +749,8 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk=
github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis=
github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA=
github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec=
github.com/cosmos/cosmos-sdk v0.47.14 h1:vD9JyIdlbVaXMOE/BLamViQvylfUq0E0FpqdPVv/fWw=
github.com/cosmos/cosmos-sdk v0.47.14/go.mod h1:GrDj/zd9Tiuy8ZpG9PbUbhghCVU7lwyH0GS7CpxHpyM=
github.com/cosmos/cosmos-sdk v0.47.15 h1:xuIkX4IgpnRydiwxY2fI5nWy0SkRVvWvumWtGigwJdk=
github.com/cosmos/cosmos-sdk v0.47.15/go.mod h1:6L16fRG0ZinyyYMclrVAGqTUyb5UGu/hlx5oZEI6NAY=
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
Expand Down Expand Up @@ -1412,8 +1412,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/peggyjv/gravity-bridge/module/v5 v5.0.0-20241023135054-397d3b1298c8 h1:jj4hxYu473+F19IQU1L11lyLOgqnUKMSNJX2kKtWdbk=
github.com/peggyjv/gravity-bridge/module/v5 v5.0.0-20241023135054-397d3b1298c8/go.mod h1:/vcYmGnfzHn2d7Ptxq1PLLC3gpuMJz46r2tZXFSCC6k=
github.com/peggyjv/gravity-bridge/module/v6 v6.0.1 h1:m+NfLel2Uk+6513T6655zADDX6OuAGm5gh2D+nhq8RI=
github.com/peggyjv/gravity-bridge/module/v6 v6.0.1/go.mod h1:Ctc0dC9eapsmbP44sunV64A0xbL630ad67bGC5RvADY=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
Expand Down Expand Up @@ -1486,8 +1486,6 @@ github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Ung
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg=
github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM=
github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4=
github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/addresses_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"time"

"github.com/ethereum/go-ethereum/common"
"github.com/peggyjv/sommelier/v8/x/addresses/types"
"github.com/peggyjv/sommelier/v9/x/addresses/types"
)

func (s *IntegrationTestSuite) TestAddresses() {
Expand Down
4 changes: 2 additions & 2 deletions integration_tests/auction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
govtypesv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/peggyjv/sommelier/v8/x/auction/types"
cellarfees "github.com/peggyjv/sommelier/v8/x/cellarfees/types"
"github.com/peggyjv/sommelier/v9/x/auction/types"
cellarfees "github.com/peggyjv/sommelier/v9/x/cellarfees/types"
)

func (s *IntegrationTestSuite) TestAuction() {
Expand Down
15 changes: 12 additions & 3 deletions integration_tests/axelarcork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
govtypesv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/ethereum/go-ethereum/common"
"github.com/golang/protobuf/proto" //nolint:staticcheck
"github.com/peggyjv/sommelier/v8/x/axelarcork/types"
pubsubtypes "github.com/peggyjv/sommelier/v8/x/pubsub/types"
"github.com/peggyjv/sommelier/v9/x/axelarcork/types"
pubsubtypes "github.com/peggyjv/sommelier/v9/x/pubsub/types"
)

func (s *IntegrationTestSuite) TestAxelarCork() {
Expand Down Expand Up @@ -493,6 +493,7 @@ func (s *IntegrationTestSuite) TestAxelarCork() {
usommToSend := sdk.NewCoin(testDenom, math.NewInt(1000))
found, sweepDenomToSend := orch0Balances.Find(axelarSweepDenom)
s.Require().True(found, "orch0 doesn't have any sweep test denom funds")

orch0SweepFunds := sdk.Coins{
sweepDenomToSend,
usommToSend,
Expand All @@ -509,13 +510,21 @@ func (s *IntegrationTestSuite) TestAxelarCork() {
s.Require().NoError(err)
s.Require().Zero(sendResponse.Code, "raw log: %s", sendResponse.RawLog)

s.T().Log("Verifying distribution community pool balances includes the swept funds")
s.T().Log("Verifying distribution community pool balances includes the swept funds (excluding overflow)")
poolAfterSweep := initialPool.Add(sdk.NewDecCoinsFromCoins(usommToSend)...).Add(sdk.NewDecCoinsFromCoins(sweepDenomToSend)...)
s.Require().Eventually(func() bool {
distributionCommunityPoolResponse, err := distributionQueryClient.CommunityPool(context.Background(), &distributiontypes.QueryCommunityPoolRequest{})
s.Require().NoError(err)
return poolAfterSweep.IsEqual(distributionCommunityPoolResponse.Pool)
}, time.Second*60, time.Second*5, "swept funds never reached community pool")

s.T().Log("Verifying overflow denom was burned")
moduleBalanceResponse, err := bankQueryClient.Balance(context.Background(), &banktypes.QueryBalanceRequest{
Address: axelarcorkModuleAddress.String(),
Denom: "overflow",
})
s.Require().NoError(err)
s.Require().True(moduleBalanceResponse.Balance.IsZero(), "overflow denom was not burned")
})
}

Expand Down
Loading

0 comments on commit 43c564d

Please sign in to comment.