Skip to content

Commit

Permalink
Merge pull request #121 from notional-labs/dang/change-PFM-fork
Browse files Browse the repository at this point in the history
Dang/change pfm fork
  • Loading branch information
vuong177 committed May 18, 2023
2 parents 1841b8e + 3431f0a commit 0774249
Show file tree
Hide file tree
Showing 5 changed files with 303 additions and 12 deletions.
15 changes: 8 additions & 7 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ func NewBanksyApp(
app.IBCKeeper.ChannelKeeper,
&app.DistrKeeper,
app.BankKeeper,
app.TransferMiddlewareKeeper,
app.IBCKeeper.ChannelKeeper,
)

Expand All @@ -437,19 +438,19 @@ func NewBanksyApp(
)
icqModule := icq.NewAppModule(app.ICQKeeper)
icqIBCModule := icq.NewIBCModule(app.ICQKeeper)
ibcMiddlewareStack := router.NewIBCMiddleware(
transfermiddlewareStack := transfermiddleware.NewIBCMiddleware(
transferIBCModule,
app.TransferMiddlewareKeeper,
)

ibcMiddlewareStack := router.NewIBCMiddleware(
transfermiddlewareStack,
app.RouterKeeper,
0,
routerkeeper.DefaultForwardTransferPacketTimeoutTimestamp,
routerkeeper.DefaultRefundTransferPacketTimeoutTimestamp,
)

transfermiddlewareStack := transfermiddleware.NewIBCMiddleware(
ibcMiddlewareStack,
app.TransferMiddlewareKeeper,
)

// Create evidence Keeper for to register the IBC light client misbehaviour evidence route
evidenceKeeper := evidencekeeper.NewKeeper(
appCodec, keys[evidencetypes.StoreKey], &app.StakingKeeper, app.SlashingKeeper,
Expand Down Expand Up @@ -480,7 +481,7 @@ func NewBanksyApp(
)

ibcRouter := porttypes.NewRouter()
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transfermiddlewareStack)
ibcRouter.AddRoute(ibctransfertypes.ModuleName, ibcMiddlewareStack)
ibcRouter.AddRoute(icqtypes.ModuleName, icqIBCModule)

// this line is used by starport scaffolding # ibc/app/router
Expand Down
8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ require (
cosmossdk.io/simapp v0.0.0-20230323161446-0af178d721ff
github.com/cometbft/cometbft v0.37.0
github.com/cometbft/cometbft-db v0.7.0
github.com/cosmos/cosmos-proto v1.0.0-beta.2
github.com/cosmos/cosmos-sdk v0.47.1
github.com/cosmos/gogoproto v1.4.8
github.com/cosmos/ibc-go/v7 v7.0.0
github.com/gogo/protobuf v1.3.2
github.com/golang/protobuf v1.5.3
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
Expand All @@ -35,10 +37,8 @@ require (
github.com/chzyer/readline v1.5.1 // indirect
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.2 // indirect
github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
Expand Down Expand Up @@ -168,7 +168,7 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
nhooyr.io/websocket v1.8.6 // indirect
pgregory.net/rapid v0.5.5 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
sigs.k8s.io/yaml v1.3.0
)

replace (
Expand All @@ -177,6 +177,8 @@ replace (
// ibc-go with wasm client
github.com/cosmos/ibc-go/v7 => github.com/strangelove-ventures/ibc-go/v7 v7.0.0-20230410223156-8c202c556f82

github.com/strangelove-ventures/packet-forward-middleware/v7 => github.com/notional-labs/packet-forward-middleware/v7 v7.0.0-20230517054520-e1958ca2830e

github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7

)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,8 @@ github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi
github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/notional-labs/packet-forward-middleware/v7 v7.0.0-20230517054520-e1958ca2830e h1:VnV20PYZsHoApnSNdxgM9E8f3Xxsk8yx8lL7WZZs1Ls=
github.com/notional-labs/packet-forward-middleware/v7 v7.0.0-20230517054520-e1958ca2830e/go.mod h1:ZqzpgUUK75BHIttNMs2ANFUNGEmi+aFij6gYmiDjdqc=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
Expand Down Expand Up @@ -895,8 +897,6 @@ github.com/strangelove-ventures/async-icq/v7 v7.0.0-20230413165143-a3b65ccdc897
github.com/strangelove-ventures/async-icq/v7 v7.0.0-20230413165143-a3b65ccdc897/go.mod h1:ag05Q54Wkr0jVwfe+14sxnuWbw0gBOxtPQv9afBBnr0=
github.com/strangelove-ventures/ibc-go/v7 v7.0.0-20230410223156-8c202c556f82 h1:tcMLfpXNngvKF8Klr1UWFNSmeqO14ILjiJv+r0OhWBE=
github.com/strangelove-ventures/ibc-go/v7 v7.0.0-20230410223156-8c202c556f82/go.mod h1:ISHo/Qitjtvj2svGmttaZv03zVXmS+uqvUyF9kFqlI0=
github.com/strangelove-ventures/packet-forward-middleware/v7 v7.0.0-20230412224111-136e94e98861 h1:amfLQujq8LwWjuadoMDX7lngka6NXcvk4ugkWZ4m7o0=
github.com/strangelove-ventures/packet-forward-middleware/v7 v7.0.0-20230412224111-136e94e98861/go.mod h1:DJNSVK8NCYHM+aZHCFkcAqPwjzwHYAjhjSMlhAGtJ3c=
github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI=
Expand Down
7 changes: 7 additions & 0 deletions x/transfermiddleware/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ func (keeper Keeper) RemoveParachainIBCInfo(ctx sdk.Context, nativeDenom string)
return nil
}

func (keeper Keeper) HasParachainIBCTokenInfo(ctx sdk.Context, nativeDenom string) bool {
store := ctx.KVStore(keeper.storeKey)
key := types.GetKeyParachainIBCTokenInfo(nativeDenom)

return store.Has(key)
}

// TODO: testing
// GetParachainIBCTokenInfo add new information about parachain token to chain state.
func (keeper Keeper) GetParachainIBCTokenInfo(ctx sdk.Context, nativeDenom string) (info types.ParachainIBCTokenInfo) {
Expand Down
Loading

0 comments on commit 0774249

Please sign in to comment.