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

Add fix proposal #137

Merged
merged 10 commits into from
May 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ func NewBanksyApp(
app.IBCKeeper.ChannelKeeper,
&app.TransferKeeper,
app.BankKeeper,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

app.TransferKeeper = ibctransferkeeper.NewKeeper(
Expand Down
1 change: 1 addition & 0 deletions app/ibctesting/simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ func NewSimApp(
app.IBCKeeper.ChannelKeeper,
app.TransferKeeper,
app.BankKeeper,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
app.AuthzKeeper = authzkeeper.NewKeeper(keys[authzkeeper.StoreKey], appCodec, app.MsgServiceRouter(), app.AccountKeeper)

Expand Down
2 changes: 1 addition & 1 deletion scripts/node_start/runnode_banksyd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ from_scratch () {

# Set gas limit in genesis
update_test_genesis '.consensus_params["block"]["max_gas"]="100000000"'
update_test_genesis '.app_state["gov"]["voting_params"]["voting_period"]="45s"'
update_test_genesis '.app_state["gov"]["params"]["voting_period"]="45s"'

update_test_genesis '.app_state["staking"]["params"]["bond_denom"]="stake"'
#update_test_genesis '.app_state["bank"]["params"]["send_enabled"]=[{"denom": "stake","enabled": true}]'
Expand Down
28 changes: 15 additions & 13 deletions scripts/proposalAddToken.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"messages": [
{
"@type": "/banksy.transfermiddleware.v1beta1.MsgAddParachainIBCTokenInfo",
"ibc_denom": "cosmos1...", // The gov module module address
"channel_id": "cosmos1...",
"native_denom": ""
}
],
"metadata": "AQ==",
"deposit": "10stake",
"title": "Proposal Title",
"summary": "Proposal Summary"
}
"messages": [
{
"@type": "/banksy.transfermiddleware.v1beta1.MsgAddParachainIBCTokenInfo",
"authority": "banksy10d07y265gmmuvt4z0w9aw880jnsr700js9vsvc",
"ibc_denom": "ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878",
"channel_id": "channel-0",
"native_denom": "stake"
}
],
"metadata": "AQ==",
"deposit": "1000000000stake",
"title": "Proposal Title",
"summary": "Proposal Summary"
}

2 changes: 2 additions & 0 deletions x/transfermiddleware/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ func NewKeeper(
ics4Wrapper porttypes.ICS4Wrapper,
transferKeeper types.TransferKeeper,
bankKeeper types.BankKeeper,
authority string,
) Keeper {
return Keeper{
storeKey: storeKey,
transferKeeper: transferKeeper,
bankKeeper: bankKeeper,
cdc: codec,
ICS4Wrapper: ics4Wrapper,
authority: authority,
}
}

Expand Down
8 changes: 8 additions & 0 deletions x/transfermiddleware/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ import (

var _ types.MsgServer = msgServer{}

// NewMsgServerImpl returns an implementation of the MsgServer interface
// for the provided Keeper.
func NewMsgServerImpl(keeper Keeper) types.MsgServer {
return &msgServer{
Keeper: keeper,
}
}

type msgServer struct {
Keeper
}
Expand Down
5 changes: 4 additions & 1 deletion x/transfermiddleware/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ func (AppModuleBasic) Name() string {
func (AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {}

// RegisterInterfaces registers module concrete types into protobuf Any.
func (AppModuleBasic) RegisterInterfaces(_ codectypes.InterfaceRegistry) {}
func (AppModuleBasic) RegisterInterfaces(reg codectypes.InterfaceRegistry) {
types.RegisterInterfaces(reg)
}

// DefaultGenesis returns default genesis state as raw bytes for the ibc
// router module.
Expand Down Expand Up @@ -86,6 +88,7 @@ func (AppModule) QuerierRoute() string {
// RegisterServices registers module services.
func (am AppModule) RegisterServices(cfg module.Configurator) {
types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(*am.keeper))
}

// InitGenesis performs genesis initialization for the ibc-router module. It returns
Expand Down
Loading