Skip to content

Commit

Permalink
Add fix proposal (ComposableFi#137)
Browse files Browse the repository at this point in the history
* change stake to upica

* add query escrow address

* add proposal

* add test mint

* nit

* minor

* lint

* add scripts test proposal

* add authority

---------

Co-authored-by: vuong <nguyenvuong1122000@gmail.com>
  • Loading branch information
GNaD13 and vuong177 committed May 29, 2023
1 parent d3e4777 commit 7226500
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 15 deletions.
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

0 comments on commit 7226500

Please sign in to comment.