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

47 uptodate #2699

Closed
wants to merge 13 commits into from
Prev Previous commit
Next Next commit
updates
julienrbrt committed Nov 4, 2022
commit 854edf890a2a57975faa34a02aefccd97966458d
8 changes: 5 additions & 3 deletions e2e/go.mod
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@ go 1.18
replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

require (
// cosmos-sdk main @20448048a489 ≃ 0.47
github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20221103211459-20448048a489
github.com/cosmos/cosmos-sdk v0.46.1
github.com/cosmos/gogoproto v1.4.2
github.com/cosmos/ibc-go/v6 v6.0.0-alpha1
github.com/cosmos/interchain-accounts v0.4.0
github.com/docker/docker v20.10.17+incompatible
@@ -16,7 +16,6 @@ require (
go.uber.org/zap v1.21.0
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4
google.golang.org/grpc v1.50.1
github.com/cosmos/gogoproto v1.4.2
)

require (
@@ -237,3 +236,6 @@ replace github.com/cosmos/ibc-go/v6 => ../

// ibctest 0.47 @ https://github.com/strangelove-ventures/ibctest/pull/337
replace github.com/strangelove-ventures/ibctest/v6 => github.com/julienrbrt/ibctest/v6 v6.0.0-20221103221804-50f6c4c4fbdb

// cosmos-sdk main @20448048a489 ≃ 0.47
replace github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20221103211459-20448048a489
30 changes: 15 additions & 15 deletions testing/events.go
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@ func ParseClientIDFromEvents(events sdk.Events) (string, error) {
for _, ev := range events {
if ev.Type == clienttypes.EventTypeCreateClient {
for _, attr := range ev.Attributes {
if string(attr.Key) == clienttypes.AttributeKeyClientID {
return string(attr.Value), nil
if attr.Key == clienttypes.AttributeKeyClientID {
return attr.Value, nil
}
}
}
@@ -33,8 +33,8 @@ func ParseConnectionIDFromEvents(events sdk.Events) (string, error) {
if ev.Type == connectiontypes.EventTypeConnectionOpenInit ||
ev.Type == connectiontypes.EventTypeConnectionOpenTry {
for _, attr := range ev.Attributes {
if string(attr.Key) == connectiontypes.AttributeKeyConnectionID {
return string(attr.Value), nil
if attr.Key == connectiontypes.AttributeKeyConnectionID {
return attr.Value, nil
}
}
}
@@ -48,8 +48,8 @@ func ParseChannelIDFromEvents(events sdk.Events) (string, error) {
for _, ev := range events {
if ev.Type == channeltypes.EventTypeChannelOpenInit || ev.Type == channeltypes.EventTypeChannelOpenTry {
for _, attr := range ev.Attributes {
if string(attr.Key) == channeltypes.AttributeKeyChannelID {
return string(attr.Value), nil
if attr.Key == channeltypes.AttributeKeyChannelID {
return attr.Value, nil
}
}
}
@@ -64,40 +64,40 @@ func ParsePacketFromEvents(events sdk.Events) (channeltypes.Packet, error) {
if ev.Type == channeltypes.EventTypeSendPacket {
packet := channeltypes.Packet{}
for _, attr := range ev.Attributes {
switch string(attr.Key) {
switch attr.Key {
case channeltypes.AttributeKeyData: //nolint:staticcheck // DEPRECATED
packet.Data = []byte(attr.Value)

case channeltypes.AttributeKeySequence:
seq, err := strconv.ParseUint(string(attr.Value), 10, 64)
seq, err := strconv.ParseUint(attr.Value, 10, 64)
if err != nil {
return channeltypes.Packet{}, err
}

packet.Sequence = seq

case channeltypes.AttributeKeySrcPort:
packet.SourcePort = string(attr.Value)
packet.SourcePort = attr.Value

case channeltypes.AttributeKeySrcChannel:
packet.SourceChannel = string(attr.Value)
packet.SourceChannel = attr.Value

case channeltypes.AttributeKeyDstPort:
packet.DestinationPort = string(attr.Value)
packet.DestinationPort = attr.Value

case channeltypes.AttributeKeyDstChannel:
packet.DestinationChannel = string(attr.Value)
packet.DestinationChannel = attr.Value

case channeltypes.AttributeKeyTimeoutHeight:
height, err := clienttypes.ParseHeight(string(attr.Value))
height, err := clienttypes.ParseHeight(attr.Value)
if err != nil {
return channeltypes.Packet{}, err
}

packet.TimeoutHeight = height

case channeltypes.AttributeKeyTimeoutTimestamp:
timestamp, err := strconv.ParseUint(string(attr.Value), 10, 64)
timestamp, err := strconv.ParseUint(attr.Value, 10, 64)
if err != nil {
return channeltypes.Packet{}, err
}
@@ -121,7 +121,7 @@ func ParseAckFromEvents(events sdk.Events) ([]byte, error) {
for _, ev := range events {
if ev.Type == channeltypes.EventTypeWriteAck {
for _, attr := range ev.Attributes {
if string(attr.Key) == channeltypes.AttributeKeyAck { //nolint:staticcheck // DEPRECATED
if attr.Key == channeltypes.AttributeKeyAck { //nolint:staticcheck // DEPRECATED
return []byte(attr.Value), nil
}
}
37 changes: 22 additions & 15 deletions testing/simapp/app.go
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/capability"
capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
"github.com/cosmos/cosmos-sdk/x/consensus"
consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
"github.com/cosmos/cosmos-sdk/x/crisis"
@@ -163,6 +164,7 @@ var (
authzmodule.AppModuleBasic{},
vesting.AppModuleBasic{},
ibcfee.AppModuleBasic{},
consensus.AppModuleBasic{},
)

// module account permissions
@@ -273,7 +275,7 @@ func NewSimApp(
bApp.SetInterfaceRegistry(interfaceRegistry)

keys := sdk.NewKVStoreKeys(
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey,
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, crisistypes.StoreKey,
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
govtypes.StoreKey, group.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey,
evidencetypes.StoreKey, ibctransfertypes.StoreKey, icacontrollertypes.StoreKey, icahosttypes.StoreKey, capabilitytypes.StoreKey,
@@ -295,7 +297,6 @@ func NewSimApp(

app.ParamsKeeper = initParamsKeeper(appCodec, legacyAmino, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey])

// set the BaseApp's parameter store
// set the BaseApp's parameter store
app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[upgradetypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String())
bApp.SetParamStore(&app.ConsensusParamsKeeper)
@@ -327,11 +328,15 @@ func NewSimApp(
BlockedAddresses(),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
stakingKeeper := stakingkeeper.NewKeeper(

// register the staking hooks
// NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks
app.StakingKeeper = stakingkeeper.NewKeeper(
appCodec, keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

app.MintKeeper = mintkeeper.NewKeeper(
appCodec, keys[minttypes.StoreKey], stakingKeeper,
appCodec, keys[minttypes.StoreKey], app.StakingKeeper,
app.AccountKeeper, app.BankKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

@@ -341,18 +346,18 @@ func NewSimApp(
appCodec, legacyAmino, keys[slashingtypes.StoreKey], app.StakingKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

// register the staking hooks
// NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks
app.StakingKeeper.SetHooks(
stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks()),
)

app.CrisisKeeper = crisiskeeper.NewKeeper(appCodec, keys[crisistypes.StoreKey], invCheckPeriod,
app.BankKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String())

app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegrant.StoreKey], app.AccountKeeper)
app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String())

// register the staking hooks
// NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks
app.StakingKeeper = stakingkeeper.NewKeeper(
appCodec, keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

app.AuthzKeeper = authzkeeper.NewKeeper(keys[authzkeeper.StoreKey], appCodec, app.MsgServiceRouter(), app.AccountKeeper)

// IBC Keepers
@@ -375,7 +380,7 @@ func NewSimApp(
*/
govKeeper := govkeeper.NewKeeper(
appCodec, keys[govtypes.StoreKey], app.AccountKeeper, app.BankKeeper,
stakingKeeper, app.MsgServiceRouter(), govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String(),
app.StakingKeeper, app.MsgServiceRouter(), govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

app.GovKeeper = *govKeeper.SetHooks(
@@ -539,11 +544,13 @@ func NewSimApp(
staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)),
upgrade.NewAppModule(app.UpgradeKeeper),
evidence.NewAppModule(app.EvidenceKeeper),
ibc.NewAppModule(app.IBCKeeper),
params.NewAppModule(app.ParamsKeeper),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper),

// IBC modules
ibc.NewAppModule(app.IBCKeeper),
transfer.NewAppModule(app.TransferKeeper),
ibcfee.NewAppModule(app.IBCFeeKeeper),
ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper),
@@ -559,13 +566,13 @@ func NewSimApp(
upgradetypes.ModuleName, capabilitytypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName,
evidencetypes.ModuleName, stakingtypes.ModuleName, ibchost.ModuleName, ibctransfertypes.ModuleName, authtypes.ModuleName,
banktypes.ModuleName, govtypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, authz.ModuleName, feegrant.ModuleName,
paramstypes.ModuleName, vestingtypes.ModuleName, icatypes.ModuleName, ibcfeetypes.ModuleName, ibcmock.ModuleName, group.ModuleName,
paramstypes.ModuleName, vestingtypes.ModuleName, icatypes.ModuleName, ibcfeetypes.ModuleName, ibcmock.ModuleName, group.ModuleName, consensusparamtypes.ModuleName,
)
app.mm.SetOrderEndBlockers(
crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, ibchost.ModuleName, ibctransfertypes.ModuleName,
capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName,
minttypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName, feegrant.ModuleName, paramstypes.ModuleName,
upgradetypes.ModuleName, vestingtypes.ModuleName, icatypes.ModuleName, ibcfeetypes.ModuleName, ibcmock.ModuleName, group.ModuleName,
upgradetypes.ModuleName, vestingtypes.ModuleName, icatypes.ModuleName, ibcfeetypes.ModuleName, ibcmock.ModuleName, group.ModuleName, consensusparamtypes.ModuleName,
)

// NOTE: The genutils module must occur after staking so that pools are
@@ -578,7 +585,7 @@ func NewSimApp(
slashingtypes.ModuleName, govtypes.ModuleName, minttypes.ModuleName, crisistypes.ModuleName,
ibchost.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName, ibctransfertypes.ModuleName,
icatypes.ModuleName, ibcfeetypes.ModuleName, ibcmock.ModuleName, feegrant.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName,
vestingtypes.ModuleName, group.ModuleName,
vestingtypes.ModuleName, group.ModuleName, consensusparamtypes.ModuleName,
)

app.mm.RegisterInvariants(app.CrisisKeeper)