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

feat: bump cosmos-sdk to v0.50.9 and ignite to v28.5.3 #1

Merged
merged 78 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
2ed4610
bump. ignite
Pantani Oct 1, 2024
a06c2e4
add missing queries
Pantani Oct 2, 2024
2a47525
fix wrong logic
Pantani Oct 2, 2024
7339325
fix ibc scoped keeper for testutil
Pantani Oct 2, 2024
5185311
fix some tests cases
Pantani Oct 2, 2024
a50b17f
remove. unused test cases
Pantani Oct 2, 2024
6a04528
fix some test cases
Pantani Oct 2, 2024
8cf3dde
add ibc. methods
Pantani Oct 5, 2024
6f29d54
fix. some tests
Pantani Oct 10, 2024
787a201
fix. some query tests
Pantani Oct 10, 2024
e6574ac
account prefix
Pantani Oct 14, 2024
7405fbf
fix reward_distribution
Pantani Oct 14, 2024
5563291
project genesis test
Pantani Oct 14, 2024
2ba349e
fix some error assert
Pantani Oct 14, 2024
28829ed
genesis. test
Pantani Oct 14, 2024
c6b54b0
fix some test assertions
Pantani Oct 14, 2024
702afec
fix error assertion for signer
Pantani Oct 16, 2024
514efc0
fix. params. test vars
Pantani Oct 16, 2024
f1557fc
set redudancy keepers
Pantani Oct 16, 2024
7552c70
use pointer for some keeper modules
Pantani Oct 16, 2024
35580b4
fix ibc keeper pointer
Pantani Oct 16, 2024
1f3c57e
error assertions
Pantani Oct 16, 2024
4ca2d1b
fix launch hooks
Pantani Oct 16, 2024
c3fda74
fix. hooks
Pantani Oct 16, 2024
10e5050
fix. query_verified_client_id_test
Pantani Oct 16, 2024
0e352f7
fix consensus. tests
Pantani Oct 16, 2024
400ff0c
fix accaddress parse
Pantani Oct 16, 2024
7a40546
remove test. case
Pantani Oct 16, 2024
d810ac1
app.go
Pantani Oct 17, 2024
79e2e3c
customgetsigners
Pantani Oct 17, 2024
e06f4ac
custom get signers
Pantani Oct 17, 2024
19e8ec6
fix custom signers
Pantani Oct 18, 2024
122b1c4
fix. deps
Pantani Oct 18, 2024
73bfddb
fix makefile
Pantani Oct 18, 2024
a008634
fix dep
Pantani Oct 18, 2024
e34a0af
remove unused error
Pantani Oct 18, 2024
10c10e4
fix test coverage
Pantani Oct 18, 2024
441f5a2
remove scripts
Pantani Oct 18, 2024
bc826dc
add. tests. and fix genesis tests
Pantani Oct 19, 2024
5b6c93c
fix auto cli wrong params
Pantani Oct 19, 2024
432b98c
fix wrong fundraising genesis var
Pantani Oct 19, 2024
338ae9e
fix wrong mint module and config vars
Pantani Oct 19, 2024
19c0f21
fix. config
Pantani Oct 19, 2024
cdf2d4b
sort genesis template for can be more easy to compare
Pantani Oct 19, 2024
166534c
move proto vars to snake case
Pantani Oct 20, 2024
18f9298
update genesis. templates
Pantani Oct 20, 2024
5aab01c
fix. local. test genesis
Pantani Oct 20, 2024
115ee03
fix keyring for python delegate scripts
Pantani Oct 20, 2024
75a10ab
fix coordinator creator flags
Pantani Oct 20, 2024
d6557f7
add comments to cli methods
Pantani Oct 20, 2024
744b8b0
add missing rpc methods
Pantani Oct 20, 2024
ebbb978
add trigger launch tx
Pantani Oct 20, 2024
ef83525
add trigger launch cli
Pantani Oct 20, 2024
52e8bdf
fix launch time parse
Pantani Oct 20, 2024
840cf5f
fix monitoring cmd
Pantani Oct 20, 2024
baa4af9
rollback validator state json
Pantani Oct 20, 2024
d45f768
fix python cmd scritp
Pantani Oct 20, 2024
1ae560f
fix genesis time script
Pantani Oct 20, 2024
8c4b31c
fix vs.yaml parse
Pantani Oct 21, 2024
603c9be
fix hermes command
Pantani Oct 21, 2024
bb12c50
fix k.InitializeConsumerClient
Pantani Oct 21, 2024
e16e95c
fix nodes configs
Pantani Oct 21, 2024
226a3c6
fix errors handler instead panic
Pantani Oct 21, 2024
8463ad8
fix unit test suite
Pantani Oct 21, 2024
1cf35a5
fix missing genesis import/export
Pantani Oct 21, 2024
c1d4ea6
gs.MonitoringInfo genesis populate
Pantani Oct 21, 2024
fbe7aba
add begin blocker for monitoring consumer
Pantani Oct 21, 2024
145d300
fix montotingg genesis tests
Pantani Oct 21, 2024
f7fcb31
fix missing ibc keepers
Pantani Oct 21, 2024
c5a9d96
fix monitoringp keeper
Pantani Oct 21, 2024
edbf81f
fix testnet scripts config
Pantani Oct 21, 2024
7a4f7e2
update keys
Pantani Oct 24, 2024
43ceb5a
fix python scripts
Pantani Oct 24, 2024
105a4f3
fix scripts and withdrawal delay
Pantani Oct 24, 2024
f7b46d2
bump modules repo
Pantani Oct 24, 2024
e597d3b
fix run auction and sale scripts
Pantani Oct 24, 2024
7ece84e
bump modules repo
Pantani Oct 24, 2024
6b1f531
fix changelog
Pantani Oct 24, 2024
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
fix custom signers
  • Loading branch information
Pantani committed Oct 18, 2024
commit 19e8ec6758e31358e5b64355a9f1c8b124697c9e
14 changes: 10 additions & 4 deletions x/profile/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,23 @@ func ProvideModule(in ModuleInputs) ModuleOutputs {
return ModuleOutputs{ProfileKeeper: k, Module: m}
}

func ProvideCustomGetSigners() signing.CustomGetSigner {
func ProvideCustomGetSigners(cdc address.Codec) signing.CustomGetSigner {
return signing.CustomGetSigner{
MsgType: proto.MessageName(&profile1.MsgAddValidatorOperatorAddress{}),
Fn: func(msg proto.Message) ([][]byte, error) {
testMsg, ok := msg.(*profile1.MsgAddValidatorOperatorAddress)
if !ok {
return nil, fmt.Errorf("invalid message type: %T", msg)
}
validatorSigner := testMsg.ValidatorAddress
operatorSigner := testMsg.OperatorAddress
return [][]byte{[]byte(validatorSigner), []byte(operatorSigner)}, nil
validatorSigner, err := cdc.StringToBytes(testMsg.ValidatorAddress)
if err != nil {
return nil, err
}
operatorSigner, err := cdc.StringToBytes(testMsg.OperatorAddress)
if err != nil {
return nil, err
}
return [][]byte{validatorSigner, operatorSigner}, nil
},
}
}
60 changes: 60 additions & 0 deletions x/profile/simulation/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ package simulation
import (
"fmt"

cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/cosmos/cosmos-sdk/x/simulation"

"github.com/ignite/network/x/profile/keeper"
)
Expand All @@ -21,3 +24,60 @@ func FindAccount(k *keeper.Keeper, accs []simtypes.Account, address string) (sim
}
return simAccount, nil
}

// generate a Tx with more than one signature
func genAndDeliverTxWithSigners(txCtx simulation.OperationInput, accounts ...simtypes.Account) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
account := txCtx.AccountKeeper.GetAccount(txCtx.Context, txCtx.SimAccount.Address)
spendable := txCtx.Bankkeeper.SpendableCoins(txCtx.Context, account.GetAddress())

var (
accMap = make(map[string]struct{})
accNumbers = []uint64{account.GetAccountNumber()}
accSequences = []uint64{account.GetSequence()}
privs = []cryptotypes.PrivKey{txCtx.SimAccount.PrivKey}
)
accMap[txCtx.SimAccount.Address.String()] = struct{}{}
for _, acc := range accounts {
if _, ok := accMap[acc.Address.String()]; ok {
continue
}
accMap[acc.Address.String()] = struct{}{}
account := txCtx.AccountKeeper.GetAccount(txCtx.Context, acc.Address)
accNumbers = append(accNumbers, account.GetAccountNumber())
accSequences = append(accSequences, account.GetSequence())
privs = append(privs, acc.PrivKey)
}

// feePayer is the first signer
coins, hasNeg := spendable.SafeSub(txCtx.CoinsSpentInMsg...)
if hasNeg {
return simtypes.NoOpMsg(txCtx.ModuleName, sdk.MsgTypeURL(txCtx.Msg), "message doesn't leave room for fees"), nil, nil
}

fees, err := simtypes.RandomFees(txCtx.R, txCtx.Context, coins)
if err != nil {
return simtypes.NoOpMsg(txCtx.ModuleName, sdk.MsgTypeURL(txCtx.Msg), "unable to generate fees"), nil, err
}

tx, err := simtestutil.GenSignedMockTx(
txCtx.R,
txCtx.TxGen,
[]sdk.Msg{txCtx.Msg},
fees,
simtestutil.DefaultGenTxGas,
txCtx.Context.ChainID(),
accNumbers,
accSequences,
privs...,
)
if err != nil {
return simtypes.NoOpMsg(txCtx.ModuleName, sdk.MsgTypeURL(txCtx.Msg), "unable to generate mock tx"), nil, err
}

_, _, err = txCtx.App.SimTxFinalizeBlock(txCtx.TxGen.TxEncoder(), tx)
if err != nil {
return simtypes.NoOpMsg(txCtx.ModuleName, sdk.MsgTypeURL(txCtx.Msg), "unable to deliver tx"), nil, err
}

return simtypes.NewOperationMsg(txCtx.Msg, true, ""), nil, nil
}
58 changes: 2 additions & 56 deletions x/profile/simulation/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/cosmos/cosmos-sdk/x/simulation"
Expand All @@ -15,67 +13,15 @@ import (
"github.com/ignite/network/x/profile/types"
)

// generate a Tx with 2 signatures if validator account is not equal to operator address account
func genAndDeliverTxWithRandFeesAddOpAddr(txCtx simulation.OperationInput, opSimAcc simtypes.Account) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
account := txCtx.AccountKeeper.GetAccount(txCtx.Context, txCtx.SimAccount.Address)
spendable := txCtx.Bankkeeper.SpendableCoins(txCtx.Context, account.GetAddress())
opAccout := txCtx.AccountKeeper.GetAccount(txCtx.Context, opSimAcc.Address)

accNumbers := []uint64{account.GetAccountNumber()}
accSequences := []uint64{account.GetSequence()}
privs := []cryptotypes.PrivKey{txCtx.SimAccount.PrivKey}
if account != opAccout {
accNumbers = append(accNumbers, opAccout.GetAccountNumber())
accSequences = append(accSequences, opAccout.GetSequence())
privs = append(privs, opSimAcc.PrivKey)
}

var fees sdk.Coins
var err error

coins, hasNeg := spendable.SafeSub(txCtx.CoinsSpentInMsg...)
if hasNeg {
return simtypes.NoOpMsg(txCtx.ModuleName, sdk.MsgTypeURL(txCtx.Msg), "message doesn't leave room for fees"), nil, err
}

fees, err = sample.Fees(txCtx.R, coins)
if err != nil {
return simtypes.NoOpMsg(txCtx.ModuleName, sdk.MsgTypeURL(txCtx.Msg), "unable to generate fees"), nil, err
}

tx, err := simtestutil.GenSignedMockTx(
txCtx.R,
txCtx.TxGen,
[]sdk.Msg{txCtx.Msg},
fees,
simtestutil.DefaultGenTxGas,
txCtx.Context.ChainID(),
accNumbers,
accSequences,
privs...,
)
if err != nil {
return simtypes.NoOpMsg(txCtx.ModuleName, sdk.MsgTypeURL(txCtx.Msg), "unable to generate mock tx"), nil, err
}

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

return simtypes.NewOperationMsg(txCtx.Msg, true, ""), nil, nil
}

func SimulateMsgAddValidatorOperatorAddress(
ak types.AccountKeeper,
bk types.BankKeeper,
txGen client.TxConfig,
) simtypes.Operation {
return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string,
) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
simAccount, _ := simtypes.RandomAcc(r, accs)

// choose two addresses that are not equal
simAccount, _ := simtypes.RandomAcc(r, accs)
opAccount, _ := simtypes.RandomAcc(r, accs)
for simAccount.Address.Equals(opAccount.Address) {
opAccount, _ = simtypes.RandomAcc(r, accs)
Expand All @@ -99,7 +45,7 @@ func SimulateMsgAddValidatorOperatorAddress(
ModuleName: types.ModuleName,
CoinsSpentInMsg: sdk.NewCoins(),
}
return genAndDeliverTxWithRandFeesAddOpAddr(txCtx, opAccount)
return genAndDeliverTxWithSigners(txCtx, opAccount)
}
}

Expand Down
Loading