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

bump sdk 47, ibc v7, wasmd 40 #805

Merged
merged 77 commits into from
Nov 2, 2023
Merged
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
aab999b
bump sdk 47, ibc v7, wasmd 40
cgsingh33 Jul 6, 2023
7753f7a
refactored files
cgsingh33 Jul 6, 2023
fc3ab6a
version upgrade
cgsingh33 Jul 9, 2023
60d0ca1
version upgrade go, remove tendermint
cgsingh33 Jul 9, 2023
c66550e
workflow updated
cgsingh33 Jul 9, 2023
e80964b
yml fix
cgsingh33 Jul 10, 2023
80a6ab0
fixes added for app.go, upgrades, pool
cgsingh33 Jul 11, 2023
15813fa
testutil, ante, tx fixes
cgsingh33 Jul 12, 2023
abf2488
added simapp, fixed test and utils
cgsingh33 Jul 13, 2023
e880f28
ibc-hooks added
cgsingh33 Jul 18, 2023
74b5ab5
wasm keeper fix
cgsingh33 Jul 18, 2023
08f0260
icq keeper fix
cgsingh33 Jul 18, 2023
9f25cbd
keepers fixed
cgsingh33 Jul 18, 2023
3ba9ed0
ibc rate limit included
cgsingh33 Jul 30, 2023
0894ec3
ratelimit fix
cgsingh33 Jul 31, 2023
05ccb5c
liquidity fix
cgsingh33 Jul 31, 2023
f2e3129
sdk upgraded to v0.47.4
cgsingh33 Aug 1, 2023
3bf5a60
sdk replace removed
cgsingh33 Aug 1, 2023
31d8af8
icq updated
cgsingh33 Aug 2, 2023
22a5b7b
feature/dev pull
cgsingh33 Aug 2, 2023
0fbad60
icq keeper fix
cgsingh33 Aug 2, 2023
418b422
import latest changes from feature/dev
cgsingh33 Sep 3, 2023
d65a1f4
sdk upgraded to v47.5
cgsingh33 Sep 3, 2023
2167f60
ibc-go bump, test-suite fix, rate-limit removed
cgsingh33 Sep 3, 2023
8637a45
pb files fixed
cgsingh33 Sep 3, 2023
53aadc4
genutil fix
cgsingh33 Sep 16, 2023
63812e6
root fix
cgsingh33 Sep 16, 2023
253647e
codec, encoding fix
cgsingh33 Sep 20, 2023
fb0351a
consensus module added
cgsingh33 Sep 21, 2023
f4967bf
proto type fix in pb files
cgsingh33 Sep 25, 2023
bbc225b
register services fix
cgsingh33 Sep 25, 2023
e364158
upgrade code added
cgsingh33 Sep 25, 2023
51ce2b1
migration code for testnet
cgsingh33 Sep 26, 2023
e986622
cosmos proto added
cgsingh33 Sep 26, 2023
471f359
cosmos proto added
cgsingh33 Sep 26, 2023
783cda1
adding deposit cmd for collector module
pratikasr Sep 28, 2023
4e7ac44
updating test_helpers & refactoring app.go - fixing testcases
pratikasr Sep 28, 2023
34ced8f
updating helpers_test for wasm - fixing testcases
pratikasr Sep 28, 2023
aa87619
minor refactor
pratikasr Sep 28, 2023
5aa6817
updating testcases- vault & liquidity module
pratikasr Sep 28, 2023
637f151
fix- resolve wrong denom in debt auction
pratikasr Sep 29, 2023
bb7d57b
minor refactor
pratikasr Oct 4, 2023
8c3b156
amm pool mathematics refactored
vishnukumavat Oct 7, 2023
4269ec8
legacy sdk types replacement for liquidity amm
vishnukumavat Oct 9, 2023
b66adcb
proto-gen script modified
cgsingh33 Oct 9, 2023
90b0c10
proto gen script corrected
cgsingh33 Oct 9, 2023
48357ed
newer gRPC services
cgsingh33 Oct 9, 2023
9480f1f
pool test refactored for sdk 47 compatibility
vishnukumavat Oct 10, 2023
21d8d13
amm module refactor for 47 compatibility
vishnukumavat Oct 10, 2023
a84e5ca
buf yaml name fix
cgsingh33 Oct 10, 2023
4020149
paramKeyTable fix for wasm and upgrade
cgsingh33 Oct 10, 2023
5278e23
integration test suite for liquidity refactored
vishnukumavat Oct 10, 2023
2673658
printfs removal in liquidity amm's match_test
vishnukumavat Oct 10, 2023
6b39b7b
register msg services fix in module.go
cgsingh33 Oct 12, 2023
4fe1d48
upgrade code modified
cgsingh33 Oct 12, 2023
b8ec177
third_party not required for proto gen, so removed
cgsingh33 Oct 12, 2023
b5ccfb9
liquidity proto regenration and compatibility refactor
vishnukumavat Oct 13, 2023
e93cb55
Merge pull request #848 from comdex-official/debt-test
cgsingh33 Oct 16, 2023
acdcac9
20 block price feed changed to 40
cgsingh33 Oct 16, 2023
a911ff6
ibc client fix
cgsingh33 Oct 17, 2023
300b56f
refactored app.go
cgsingh33 Oct 19, 2023
8dbf8f8
upgrade refactored
cgsingh33 Oct 19, 2023
811cf6f
ibc changed to v7.2.0
cgsingh33 Oct 19, 2023
61b8b8c
updated logic for removing bad debt from commodo
pratikasr Oct 20, 2023
3831922
upgrade test-case added
cgsingh33 Oct 24, 2023
354db97
bandchain temp fork added
cgsingh33 Oct 24, 2023
3c8663d
bandoracle cdc changed
cgsingh33 Oct 25, 2023
0c11574
proto unmarshall code commented
cgsingh33 Oct 27, 2023
2c139be
fix testcase
pratikasr Oct 27, 2023
3a7b68a
discard height added for bandoracle
cgsingh33 Oct 27, 2023
ae4f500
error handling added
cgsingh33 Oct 29, 2023
83336d1
wasmd to 41
cgsingh33 Oct 30, 2023
9440926
todo removed
cgsingh33 Oct 30, 2023
80d4764
utils updated
vishnukumavat Nov 1, 2023
1726d2e
swap test fixed
vishnukumavat Nov 1, 2023
8addfa1
test cases fixed
vishnukumavat Nov 2, 2023
55abd9d
test yml fix
cgsingh33 Nov 2, 2023
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
Prev Previous commit
Next Next commit
added simapp, fixed test and utils
cgsingh33 committed Jul 13, 2023
commit abf24882e40761927bbef180ce0ffa398691064c
2 changes: 1 addition & 1 deletion app/decorators/gov_filter.go
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ func (gpsd GovPreventSpamDecorator) checkSpamSubmitProposalMsg(ctx sdk.Context,
validMsg := func(m sdk.Msg) error {
if msg, ok := m.(*govtypes.MsgSubmitProposal); ok {
// prevent spam gov msg
depositParams := gpsd.govKeeper.GetDepositParams(ctx)
depositParams := gpsd.govKeeper.GetParams(ctx)
miniumInitialDeposit := gpsd.calcMiniumInitialDeposit(depositParams.MinDeposit)
if msg.InitialDeposit.IsAllLT(miniumInitialDeposit) {
return sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "not enough initial deposit. required: %v", miniumInitialDeposit)
7 changes: 4 additions & 3 deletions app/test_helpers.go
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ package app
import (
"encoding/json"
"time"
simappparams "cosmossdk.io/simapp/params"

dbm "github.com/cometbft/cometbft-db"
abci "github.com/cometbft/cometbft/abci/types"
@@ -32,8 +33,8 @@ var DefaultConsensusParams = &tmproto.ConsensusParams{
},
}

func MakeTestEncodingConfig() simtestutil.EncodingConfig {
encodingConfig := simtestutil.MakeTestEncodingConfig()
func MakeTestEncodingConfig() simappparams.EncodingConfig {
encodingConfig := simappparams.MakeTestEncodingConfig()
std.RegisterLegacyAminoCodec(encodingConfig.Amino)
std.RegisterInterfaces(encodingConfig.InterfaceRegistry)
ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino)
@@ -46,7 +47,7 @@ func setup(withGenesis bool, invCheckPeriod uint) (*App, GenesisState) {
encCdc := MakeTestEncodingConfig()
app := New(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, invCheckPeriod, MakeEncodingConfig(), simtestutil.EmptyAppOptions{}, GetWasmEnabledProposals(), EmptyWasmOpts)
if withGenesis {
return app, NewDefaultGenesisState(encCdc.Marshaler)
return app, NewDefaultGenesisState(encCdc.Codec)
}
return app, GenesisState{}
}
14 changes: 12 additions & 2 deletions app/wasm/test/helpers_test.go
Original file line number Diff line number Diff line change
@@ -8,13 +8,15 @@ import (
"github.com/comdex-official/comdex/app/wasm/bindings"
assetTypes "github.com/comdex-official/comdex/x/asset/types"
tokenmintTypes "github.com/comdex-official/comdex/x/tokenmint/types"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"

"github.com/stretchr/testify/require"

"github.com/cometbft/cometbft/crypto"
"github.com/cometbft/cometbft/crypto/ed25519"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
// simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/comdex-official/comdex/app"
@@ -33,7 +35,7 @@ func CreateTestInput() (*app.App, *sdk.Context) {
}

func FundAccount(t *testing.T, ctx sdk.Context, comdex *app.App, acct sdk.AccAddress) {
err := simtestutil.FundAccount(comdex.BankKeeper, ctx, acct, sdk.NewCoins(
err := FundAccountFunc(comdex.BankKeeper, ctx, acct, sdk.NewCoins(
sdk.NewCoin("ucmdx", sdk.NewInt(10000000000)),
))
require.NoError(t, err)
@@ -235,3 +237,11 @@ func MsgMintNewTokens(app *app.App, ctx1 sdk.Context) {
fmt.Println(err)
}
}

func FundAccountFunc(bankKeeper bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, amounts sdk.Coins) error {
if err := bankKeeper.MintCoins(ctx, minttypes.ModuleName, amounts); err != nil {
return err
}

return bankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, addr, amounts)
}
4 changes: 2 additions & 2 deletions cmd/comdex/testnet.go
Original file line number Diff line number Diff line change
@@ -161,7 +161,7 @@ func InitTestnet(
memo := fmt.Sprintf("%s@%s:26656", nodeIDs[i], ip)
genFiles = append(genFiles, nodeConfig.GenesisFile())

kb, err := keyring.New(sdk.KeyringServiceName(), keyringBackend, nodeDir, inBuf)
kb, err := keyring.New(sdk.KeyringServiceName(), keyringBackend, nodeDir, inBuf, clientCtx.Codec)
if err != nil {
return err
}
@@ -325,7 +325,7 @@ func collectGenFiles(
return err
}

nodeAppState, err := genutil.GenAppStateFromConfig(clientCtx.Codec, clientCtx.TxConfig, nodeConfig, initCfg, *genDoc, genBalIterator)
nodeAppState, err := genutil.GenAppStateFromConfig(clientCtx.Codec, clientCtx.TxConfig, nodeConfig, initCfg, *genDoc, genBalIterator, genutiltypes.DefaultMessageValidator)
if err != nil {
return err
}
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ module github.com/comdex-official/comdex
go 1.20

require (
cosmossdk.io/simapp v0.0.0-20230323161446-0af178d721ff
github.com/CosmWasm/wasmd v0.40.2
github.com/CosmWasm/wasmvm v1.2.4
github.com/bandprotocol/bandchain-packet v0.0.3
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -567,6 +567,8 @@ cosmossdk.io/math v1.0.0-beta.4/go.mod h1:An0MllWJY6PxibUpnwGk8jOm+a/qIxlKmL5Zyp
cosmossdk.io/math v1.0.0-beta.6/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8=
cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg=
cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k=
cosmossdk.io/simapp v0.0.0-20230323161446-0af178d721ff h1:P1ialzTepD1oxdNPYc5N8Eggq3RdejZq3cJs8YYMs9Y=
cosmossdk.io/simapp v0.0.0-20230323161446-0af178d721ff/go.mod h1:AKzx6Mb544LjJ9RHmGFHjY9rEOLiUAi8I0F727TR0dY=
cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw=
cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
6 changes: 4 additions & 2 deletions types/utils.go
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/cosmos/cosmos-sdk/x/simulation"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
)

// GetShareValue multiplies with truncation by receiving int amount and decimal ratio and returns int result.
@@ -143,7 +144,8 @@ func RandomDec(r *rand.Rand, min, max sdk.Dec) sdk.Dec {
// GenAndDeliverTx generates a transactions and delivers it.
func GenAndDeliverTx(txCtx simulation.OperationInput, fees sdk.Coins, gas uint64) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
account := txCtx.AccountKeeper.GetAccount(txCtx.Context, txCtx.SimAccount.Address)
tx, err := helpers.GenTx(
tx, err := simtestutil.GenSignedMockTx(
rand.New(rand.NewSource(time.Now().UnixNano())),

Check warning

Code scanning / CodeQL

Calling the system time Warning

Calling the system time may be a possible source of non-determinism
cgsingh33 marked this conversation as resolved.
Show resolved Hide resolved
txCtx.TxGen,
[]sdk.Msg{txCtx.Msg},
fees,
@@ -157,7 +159,7 @@ func GenAndDeliverTx(txCtx simulation.OperationInput, fees sdk.Coins, gas uint64
return simtypes.NoOpMsg(txCtx.ModuleName, txCtx.MsgType, "unable to generate mock tx"), nil, err
}

_, _, err = txCtx.App.Deliver(txCtx.TxGen.TxEncoder(), tx)
_, _, err = txCtx.App.SimDeliver(txCtx.TxGen.TxEncoder(), tx)
if err != nil {
return simtypes.NoOpMsg(txCtx.ModuleName, txCtx.MsgType, "unable to deliver tx"), nil, err
}