Skip to content

Commit

Permalink
6.3.1 up
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat committed Dec 20, 2023
1 parent 3dae0a5 commit c31f02a
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 29 deletions.
10 changes: 5 additions & 5 deletions app/ante/ante.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package ante

import (
tfmwKeeper "github.com/notional-labs/composable/v6/x/transfermiddleware/keeper"
txBoundaryAnte "github.com/notional-labs/composable/v6/x/tx-boundary/ante"
tfmwkeeper "github.com/notional-labs/composable/v6/x/transfermiddleware/keeper"
txboundaryante "github.com/notional-labs/composable/v6/x/tx-boundary/ante"
txBoundaryKeeper "github.com/notional-labs/composable/v6/x/tx-boundary/keeper"

"github.com/cosmos/cosmos-sdk/codec"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
ante "github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/cosmos-sdk/x/auth/signing"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"

Expand All @@ -27,7 +27,7 @@ func NewAnteHandler(
sigGasConsumer ante.SignatureVerificationGasConsumer,
signModeHandler signing.SignModeHandler,
channelKeeper *ibckeeper.Keeper,
tfmwKeeper tfmwKeeper.Keeper,
tfmwKeeper tfmwkeeper.Keeper,
txBoundaryKeeper txBoundaryKeeper.Keeper,
codec codec.BinaryCodec,
) sdk.AnteHandler {
Expand All @@ -40,7 +40,7 @@ func NewAnteHandler(
ante.NewValidateMemoDecorator(ak),
ante.NewConsumeGasForTxSizeDecorator(ak),
NewIBCPermissionDecorator(codec, tfmwKeeper),
txBoundaryAnte.NewStakingPermissionDecorator(codec, txBoundaryKeeper),
txboundaryante.NewStakingPermissionDecorator(codec, txBoundaryKeeper),
ante.NewSetPubKeyDecorator(ak), // SetPubKeyDecorator must be called before all signature verification decorators
ante.NewValidateSigCountDecorator(ak),
ante.NewSigGasConsumeDecorator(ak, sigGasConsumer),
Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func NewComposableApp(
icqModule := icq.NewAppModule(app.ICQKeeper)
ibcHooksModule := ibc_hooks.NewAppModule()
icaModule := ica.NewAppModule(nil, &app.ICAHostKeeper) // Only ICA Host
/**** Module Options ****/
// **** Module Options ****/

// NOTE: we may consider parsing `appOpts` inside module constructors. For the moment
// we prefer to be more strict in what arguments the modules expect.
Expand Down
6 changes: 5 additions & 1 deletion app/ibctesting/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,15 @@ func (endpoint *Endpoint) CreateClient() (err error) {
tmConfig, ok := endpoint.ClientConfig.(*ibctesting.TendermintConfig)
require.True(endpoint.Chain.t, ok)

height := endpoint.Counterparty.Chain.LastHeader.GetHeight().(clienttypes.Height)
height, ok := endpoint.Counterparty.Chain.LastHeader.GetHeight().(clienttypes.Height)
if !ok {
return fmt.Errorf("type assertion to clienttypes.Height failed")
}
clientState = ibctmtypes.NewClientState(
endpoint.Counterparty.Chain.ChainID, tmConfig.TrustLevel, tmConfig.TrustingPeriod, tmConfig.UnbondingPeriod, tmConfig.MaxClockDrift,
height, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath,
)

consensusState = endpoint.Counterparty.Chain.LastHeader.ConsensusState()
case exported.Solomachine:
// TODO
Expand Down
2 changes: 1 addition & 1 deletion app/ibctesting/event_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func getAckPackets(evts []abci.Event) []PacketAck {
// for _, attr := range evt.Attributes {
// fmt.Printf(" %s = %s\n", string(attr.Key), string(attr.Value))
// }
//}
// }

func parsePacketFromEvent(evt abci.Event) channeltypes.Packet {
return channeltypes.Packet{
Expand Down
5 changes: 3 additions & 2 deletions app/ibctesting/simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
simappupgrades "github.com/notional-labs/composable/v6/app/ibctesting/simapp/upgrades"
v6 "github.com/notional-labs/composable/v6/app/ibctesting/simapp/upgrades/v6"
v7 "github.com/notional-labs/composable/v6/app/ibctesting/simapp/upgrades/v7"

// TODO: mint module not complete yet,
"github.com/notional-labs/composable/v6/x/mint"
mintkeeper "github.com/notional-labs/composable/v6/x/mint/keeper"
Expand Down Expand Up @@ -556,7 +557,7 @@ func NewSimApp(
// If evidence needs to be handled for the app, set routes in router here and seal
app.EvidenceKeeper = *evidenceKeeper

/**** Module Options ****/
// **** Module Options ****/

// NOTE: we may consider parsing `appOpts` inside module constructors. For the moment
// we prefer to be more strict in what arguments the modules expect.
Expand Down Expand Up @@ -856,7 +857,7 @@ func (app *SimApp) SimulationManager() *module.SimulationManager {

// RegisterAPIRoutes registers all application module routes with the provided
// API server.
func (app *SimApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {
func (*SimApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {
clientCtx := apiSvr.ClientCtx
// Register new tx routes from grpc-gateway.
authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
Expand Down
6 changes: 3 additions & 3 deletions x/transfermiddleware/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) {
}

// EndBlock implements the AppModule interface
func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
return []abci.ValidatorUpdate{}
}

Expand All @@ -145,9 +145,9 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP
}

// RegisterStoreDecoder registers a decoder for router module's types
func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {}
func (AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {}

// WeightedOperations returns the all the router module operations with their respective weights.
func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation {
func (AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation {
return nil
}
2 changes: 1 addition & 1 deletion x/transfermiddleware/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package types
const (
EventAddParachainIBCTokenInfo = "add-parachain-token-info" // #nosec G101
EventRemoveParachainIBCTokenInfo = "remove-parachain-token-info" // #nosec G101
EventAddRlyToAllowList = "add-rly-to-allow-list" //#nosec G101
EventAddRlyToAllowList = "add-rly-to-allow-list" // #nosec G101

AttributeKeyNativeDenom = "native-denom"
AttributeKeyIbcDenom = "ibc-denom"
Expand Down
12 changes: 6 additions & 6 deletions x/transfermiddleware/types/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ func NewMsgAddParachainIBCTokenInfo(
}

// Route Implements Msg.
func (msg MsgAddParachainIBCTokenInfo) Route() string { return RouterKey }
func (MsgAddParachainIBCTokenInfo) Route() string { return RouterKey }

// Type Implements Msg.
func (msg MsgAddParachainIBCTokenInfo) Type() string { return TypeMsgAddParachainIBCTokenInfo }
func (MsgAddParachainIBCTokenInfo) Type() string { return TypeMsgAddParachainIBCTokenInfo }

// GetSignBytes implements the LegacyMsg interface.
func (msg MsgAddParachainIBCTokenInfo) GetSignBytes() []byte {
Expand Down Expand Up @@ -84,10 +84,10 @@ func NewMsgRemoveParachainIBCTokenInfo(
}

// Route Implements Msg.
func (msg MsgRemoveParachainIBCTokenInfo) Route() string { return RouterKey }
func (MsgRemoveParachainIBCTokenInfo) Route() string { return RouterKey }

// Type Implements Msg.
func (msg MsgRemoveParachainIBCTokenInfo) Type() string { return TypeMsgRemoveParachainIBCTokenInfo }
func (MsgRemoveParachainIBCTokenInfo) Type() string { return TypeMsgRemoveParachainIBCTokenInfo }

// GetSignBytes implements the LegacyMsg interface.
func (msg MsgRemoveParachainIBCTokenInfo) GetSignBytes() []byte {
Expand Down Expand Up @@ -122,10 +122,10 @@ func NewMsgAddRlyAddress(
}

// Route Implements Msg.
func (msg MsgAddRlyAddress) Route() string { return RouterKey }
func (MsgAddRlyAddress) Route() string { return RouterKey }

// Type Implements Msg.
func (msg MsgAddRlyAddress) Type() string { return TypeMsgAddRlyAddress }
func (MsgAddRlyAddress) Type() string { return TypeMsgAddRlyAddress }

// GetSignBytes implements the LegacyMsg interface.
func (msg MsgAddRlyAddress) GetSignBytes() []byte {
Expand Down
8 changes: 4 additions & 4 deletions x/tx-boundary/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (k Keeper) GetAuthority() string {
}

// Logger returns logger
func (k Keeper) Logger(ctx sdk.Context) log.Logger {
func (Keeper) Logger(ctx sdk.Context) log.Logger {
return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName))
}

Expand All @@ -61,7 +61,7 @@ func (k Keeper) GetDelegateBoundary(ctx sdk.Context) (boundary types.Boundary) {
}

k.cdc.MustUnmarshal(bz, &boundary)
return
return boundary
}

// SetRedelegateBoundary sets the delegate boundary.
Expand All @@ -84,7 +84,7 @@ func (k Keeper) GetRedelegateBoundary(ctx sdk.Context) (boundary types.Boundary)
}

k.cdc.MustUnmarshal(bz, &boundary)
return
return boundary
}

// SetDelegateCount set the number of delegate tx for a given address
Expand Down Expand Up @@ -140,7 +140,7 @@ func (k Keeper) GetLimitPerAddr(ctx sdk.Context, addr sdk.AccAddress) (limitPerA
}
bz := store.Get(addr)
k.cdc.MustUnmarshal(bz, &limitPerAddr)
return
return limitPerAddr
}

func (k Keeper) UpdateLimitPerAddr(ctx sdk.Context, addr sdk.AccAddress) {
Expand Down
8 changes: 4 additions & 4 deletions x/tx-boundary/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
}

// RegisterInterfaces registers the module interface
func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) {
func (AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) {
types.RegisterInterfaces(reg)
}

Expand Down Expand Up @@ -107,11 +107,11 @@ func (AppModule) Name() string {
}

// RegisterInvariants registers the tx-boundary module invariants.
func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}

// RegisterServices registers a gRPC query service to respond to the
// module-specific gRPC queries.
func (am AppModule) RegisterServices(_ module.Configurator) {
func (AppModule) RegisterServices(_ module.Configurator) {
// types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
// types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper))
}
Expand All @@ -137,7 +137,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw
func (AppModule) ConsensusVersion() uint64 { return 1 }

// BeginBlock returns the begin blocker for the tx-boundary module.
func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {}
func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {}

// ProposalContents doesn't return any content functions for governance proposals.
func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg {
Expand Down
2 changes: 1 addition & 1 deletion x/tx-boundary/types/genesis.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package types

import fmt "fmt"
import "fmt"

var (
DefaultDelegateBoundary = Boundary{
Expand Down

0 comments on commit c31f02a

Please sign in to comment.