-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
ICS 05 implementation #5193
Merged
Merged
ICS 05 implementation #5193
Changes from all commits
Commits
Show all changes
375 commits
Select commit
Hold shift + click to select a range
dbd6b83
fix lint
mossid f6e5f90
fix lint
mossid 892a120
add handler/msgs/client
mossid dce1148
rm relay
mossid 26e8038
finalize rebase on 23 root/path sep
mossid 812bea4
fix lint, fix syntax
mossid 176c8ce
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid 00df063
fix querying
mossid 19321f1
extract out context withstore
mossid 486e862
fix 02-client test
mossid 67a3e1b
fix 23-commitment test
mossid 8e660ea
add query in progress
mossid dbd47aa
rm freebase, reformat query
mossid 2369a7c
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid 5584ceb
add cli/handler/msg in progress
mossid 503a399
add cli/msg/handler
mossid 3351a6a
add CLIQuery, fix tests
mossid bed5276
fix golangci
mossid f609249
add docs in progre
mossid 7da69c1
add comments
mossid 600445a
add comments
mossid 98720bb
Apply suggestions from code review
mossid cdee396
add comments in progress
mossid ce588a4
Merge branch 'joon/store-mapping' into joon/ics-23-implementation
mossid 39dca11
Merge branch 'joon/ics-23-implementation' of github.com:cosmos/cosmos…
mossid 94e2cdc
Merge branch 'master' of github.com:cosmos/cosmos-sdk into joon/store…
mossid 8d9e779
add comments
mossid 92d0fb4
fix comment
mossid d896152
Merge branch 'joon/store-mapping' into joon/ics-23-implementation
mossid f70d3bd
add comments in progress
mossid 5d913b7
recover IntEncoding scheme for integer
mossid 699b0ba
add uint tests, don't use codec in custom types
mossid 323818f
Merge branch 'joon/store-mapping' into joon/ics-23-implementation
mossid 9a077eb
finalize merge
mossid a4a20d6
add godoc
mossid 02a9ba5
add godoc in progress
mossid a9adb58
reformat test
mossid abb2f51
rm XXX
mossid 361aa42
add godoc
mossid 97edd89
Merge branch 'master' of github.com:cosmos/cosmos-sdk into joon/store…
mossid 23debb9
Merge branch 'joon/store-mapping' into joon/ics-23-implementation
mossid b0ca51a
Merge branch 'joon/ics-23-implementation' into joon/ics-02-implementa…
mossid 54a67b0
modify store
mossid 24e621a
add query
mossid 64c0381
update query.go
mossid 971a642
update query.go
mossid 2968dd3
Merge branch 'joon/store-mapping' into joon/ics-23-implementation
mossid 6be03df
Merge branch 'joon/ics-23-implementation' into joon/ics-02-implementa…
mossid e7f6708
cli refactor in progress
mossid 0d134d5
cli refactor in progress
mossid fcad487
add Query to boolean.go
mossid 3142d4b
Merge branch 'joon/store-mapping' into joon/ics-23-implementation
mossid 6de0ed5
fix key
mossid 05d39a1
Merge branch 'joon/store-mapping' into joon/ics-23-implementation
mossid 811b384
Merge branch 'joon/ics-23-implementation' into joon/ics-02-implementa…
mossid 62b7d75
fix cli / merkle test
mossid d6fabbd
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid 6dc912f
godoc cleanup
alexanderbez 63c6f3c
godoc cleanup
alexanderbez b6441c0
godoc cleanup
alexanderbez 4d723ae
godoc cleanup
alexanderbez 244d2c2
godoc cleanup
alexanderbez 7286fed
fix test
mossid f81d7b4
fix client
mossid 7bf4d57
merge from ics04 branch
mossid 7471bdf
Merge branch 'joon/store-mapping' of github.com:cosmos/cosmos-sdk int…
mossid 3c86363
Merge branch 'joon/store-mapping' into joon/ics-23-implementation
mossid 32cb0ca
merge from ics04 branch
mossid af260c8
Merge branch 'joon/ics-23-implementation' into joon/ics-02-implementa…
mossid 17f18d7
merge from ics04 branch
mossid 8b876ba
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid e1abf49
merge from ics04 branch
mossid 71d2620
fix lint
mossid 073a67a
Merge branch 'joon/ics-23-implementation' into joon/ics-02-implementa…
mossid eb7f614
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid 04543f8
Merge branch 'master' of github.com:cosmos/cosmos-sdk into joon/store…
mossid 59d2b3e
Merge branch 'joon/store-mapping' into joon/ics-23-implementation
mossid 6d1088f
Merge branch 'joon/ics-23-implementation' into joon/ics-02-implementa…
mossid 6299864
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid 10d1c46
Apply suggestions from code review
mossid 09e6600
applying review in progress
mossid 6f5f633
Merge branch 'joon/store-mapping' of github.com:cosmos/cosmos-sdk int…
mossid 4116bb7
apply review - make querier interface
mossid 8040c81
Merge branch 'master' of github.com:cosmos/cosmos-sdk into joon/store…
mossid 48bb32d
Merge branch 'joon/store-mapping' into joon/ics-23-implementation
mossid 9b63a6b
fix dependency
mossid a7df43c
Merge branch 'joon/ics-23-implementation' into joon/ics-02-implementa…
mossid acaaaf2
fix dependency
mossid c18ba68
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid 828badd
revise querier interface to work both on cli & store
mossid 1e64e92
revise querier interface to work both on cli & store
mossid b4d7491
reflect downstream change
mossid a59d1e7
Merge branch 'joon/store-mapping' into joon/ics-23-implementation
mossid bb09ad9
Merge branch 'joon/ics-23-implementation' into joon/ics-02-implementa…
mossid 3ba9f9c
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid de1a045
fix cli
mossid 2ef039a
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid a600589
reflect downstream changes
mossid 9f63629
rm commented lines
mossid b4e71e1
address review in progress
mossid 3f509ee
address review, rm cleanup/closing
mossid 6b966a3
rename Path -> Prefix
mossid 21bd8d0
Store accessor upstream changes (#5119)
fedekunze af2564b
Merge branch 'joon/store-mapping' of https://github.com/cosmos/cosmos…
fedekunze 303ebf3
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into jo…
fedekunze 9b3b120
Merge branch 'master' into joon/store-mapping
fedekunze 18f8d70
Merge branch 'joon/store-mapping' of https://github.com/cosmos/cosmos…
fedekunze df5b21a
add comments, reformat merkle querier
mossid 7afe221
Merge branch 'joon/ics-23-implementation' of github.com:cosmos/cosmos…
mossid 1ac982c
rm merkle/utils
mossid fa04419
ICS 23 upstream changes (#5120)
fedekunze 0d5a317
downstream changes
fedekunze db8d382
update Value
fedekunze 02b31a5
Merge branch 'joon/ics-23-implementation' of https://github.com/cosmo…
fedekunze 4d518f2
update test
fedekunze 8a3e5ea
fix
fedekunze 9975a1d
ICS 02 upstream changes (#5122)
fedekunze ffc6918
merge ICS 02
fedekunze 11bdbd7
ICS 03 upstream changes (#5123)
fedekunze cc404a0
cleanup types and submodule
fedekunze d93a0ae
more cleanup and godocs
fedekunze 9b6afe9
remove counterPartyManager/State and cleanup
fedekunze c8a0ab4
implement SubmitMisbehaviour and refactor
fedekunze 4483182
errors
fedekunze 23fbb5d
events
fedekunze ebecbce
fix test
fedekunze 0e85ed0
refactors
fedekunze 03574cb
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze f16d6e9
WIP refactor ICS03
fedekunze a7d2d98
remove Mapping
fedekunze 1b7e466
remove store accessors
fedekunze c09a84c
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into jo…
fedekunze 99c586b
Merge branch 'joon/ics-23-implementation' of https://github.com/cosmo…
fedekunze 02bd6f7
proposed refactor
fedekunze 0e37d75
remove store accessors from ICS02
fedekunze 8dec96f
refactor queriers, handler and clean keeper
fedekunze 83f4c1b
logger and tx long description
fedekunze 178912f
ineffassign
fedekunze c4617e0
merge ICS02
fedekunze 9a225e9
Apply suggestions from code review
fedekunze fe7da5f
Apply suggestions from code review
fedekunze c8ff483
remove store accessors
fedekunze 8bcf17f
refactor handshake to update it to the latest ICS03 spec
fedekunze 3df5378
update handler and msgs
fedekunze 21f7d2c
add verification functions
fedekunze 4e9d2bb
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze 604afd5
update verification
fedekunze cf347bf
ICS02 module.go
fedekunze 5514e9e
top level x/ibc structure
fedekunze 39dd637
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze eefa08b
update connection queries
fedekunze 482f24d
update connection tx
fedekunze e4ffd8e
remove extra files
fedekunze 0163482
update expected client keeper and export verification funcs
fedekunze 7c37222
ICS 05 Implementation
fedekunze a8244dc
release port and godocs
fedekunze a1c22e9
Merge branch 'master' into joon/ics-23-implementation
fedekunze a8ceb45
Update x/ibc/02-client/client/cli/query.go
fedekunze 956eb5c
Update x/ibc/02-client/types/tendermint/consensus_state.go
fedekunze 2cc23b2
Merge branch 'joon/ics-23-implementation' of https://github.com/cosmo…
fedekunze 2e1e894
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze c573d57
address some of the review comments
fedekunze 6913146
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze f852b1b
resolve some TODOs and address comments from review
fedekunze 245901c
update connection versioning
fedekunze 7a82144
minor error updates
fedekunze 99829bb
Merge branch 'joon/ics-03-implementation' of https://github.com/cosmo…
fedekunze 012bf54
update errors and add port Keeper to ibc Keeper
fedekunze 6af2ce7
minor UX improvements
fedekunze 8be3af7
rename pkg
fedekunze 53ab47d
fixes
fedekunze d3a533a
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into jo…
fedekunze 0d56b51
implement query proofs
fedekunze 7ba777e
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into jo…
fedekunze 499abb4
refactor ICS23
fedekunze a925d88
cleanup types
fedekunze a0cafbf
Merge branch 'joon/ics-03-implementation' of https://github.com/cosmo…
fedekunze c3b6b18
ICS 5 updates (#5222)
cwgoes 74d8a4b
rename pkg and fix import
fedekunze 53f5fad
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into jo…
fedekunze c12c298
implement batch verification
fedekunze a34b741
gosimple suggestion
fedekunze bf4f096
Merge branch 'master' into joon/ics-23-implementation
fedekunze 386489b
Merge branch 'joon/ics-23-implementation' of https://github.com/cosmo…
fedekunze 383ba49
merge ICS23
fedekunze 9b77275
various fixes; remove legacy tests; remove commitment path query
fedekunze 40fca1a
alias
fedekunze 1eaf55e
Merge branch 'joon/ics-23-implementation' of https://github.com/cosmo…
fedekunze deceeb8
minor updates from ICS23
fedekunze 2a1a144
renaming
fedekunze 2aa4734
ICS02 changes
fedekunze 714e6e2
update verification and rename root funcs
fedekunze 93bb9d7
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze 3351c08
Merge branch 'joon/ics-03-implementation' of https://github.com/cosmo…
fedekunze 323bc8d
Merge branch 'fedekunze/ics-05-implementation' of https://github.com/…
fedekunze de13f5a
move querier to x/ibc
fedekunze aae117f
update query.go to use 'custom/...' query path
fedekunze f8fd580
add tests
AdityaSripal cbc1106
ICS 24 Implementation (#5229)
AdityaSripal f8d99ca
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into jo…
fedekunze 23ae994
flatten ICS23 structure
fedekunze e1fa5f8
fix ApplyPrefix
fedekunze 7222642
Merge branch 'joon/ics-23-implementation' of https://github.com/cosmo…
fedekunze 4f89602
updates from ICS23 and ICS24
fedekunze 22f874a
msg.ValidateBasic and ADR09 evidence interface
fedekunze 2edb03f
complete types testing
AdityaSripal 5783b03
merge
AdityaSripal 696db2e
delete empty test file
AdityaSripal 69db1f2
remove ibc errors from core error package
AdityaSripal c22faa1
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze 021544f
custom JSON marshaling; msg.ValidateBasic; renaming of variables
fedekunze 7809e4d
minor update
fedekunze 102ab3d
custom JSON marshaling
fedekunze 2f68c0c
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze b9654da
Merge branch 'joon/ics-03-implementation' of https://github.com/cosmo…
fedekunze c8289a8
use host validation for port ids
fedekunze 33312c2
start batch-verify tests
AdityaSripal 49d08e3
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into jo…
fedekunze 5239720
minor changes on commitment types
fedekunze e048a6c
R4R - Store consensus state correctly (#5242)
chengwenxi 093c004
Merge branch 'joon/ics-23-implementation' of https://github.com/cosmo…
fedekunze 3965928
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze 0c187bf
update alias
fedekunze 29bc19e
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze 24e6d29
update alias
fedekunze a06f30a
Merge branch 'joon/ics-03-implementation' of https://github.com/cosmo…
fedekunze bd21702
update alias and keeper.GetPort()
fedekunze d1f71dd
Merge branch 'master' into joon/ics-23-implementation
fedekunze 0a461b5
use testsuite
AdityaSripal dac68df
Merge branch 'joon/ics-23-implementation' of https://github.com/cosmo…
AdityaSripal 7f9c166
Integrate Evidence Implementation into ICS-02 (#5258)
AdityaSripal a74ebf3
Merge branch 'master' into joon/ics-23-implementation
fedekunze 6d580aa
finish tendermint tests
AdityaSripal 0dd779e
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
AdityaSripal e875ca7
complete merge
AdityaSripal cd0aa22
Add tests for msgs
AdityaSripal 0c8b759
upstream changes
fedekunze c6fa07b
fix
fedekunze 17abbda
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into jo…
fedekunze 820482f
upstream changes
fedekunze 962979d
ICS23 changes
fedekunze b5442d3
fix cons state
fedekunze 7c67236
context changes
fedekunze 4866753
Merge branch 'joon/ics-23-implementation' of https://github.com/cosmo…
fedekunze a696f05
upstream changes
fedekunze df6bd66
fix cli tx
fedekunze 024486c
upstream changes
fedekunze b039d37
Merge branch joon/ics-03-implementation' of https://github.com/cosmos…
fedekunze ab50629
upstream changes
fedekunze d4ea259
conflicts
fedekunze File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package port | ||
|
||
// nolint | ||
// autogenerated code using github.com/rigelrozanski/multitool | ||
// aliases generated for the following subdirectories: | ||
// ALIASGEN: github.com/cosmos/cosmos-sdk/x/ibc/05-port/keeper | ||
// ALIASGEN: github.com/cosmos/cosmos-sdk/x/ibc/05-port/types | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/x/ibc/05-port/keeper" | ||
"github.com/cosmos/cosmos-sdk/x/ibc/05-port/types" | ||
) | ||
|
||
const ( | ||
DefaultCodespace = types.DefaultCodespace | ||
CodePortExists = types.CodePortExists | ||
CodePortNotFound = types.CodePortNotFound | ||
CodePortNotAuthenticated = types.CodePortNotAuthenticated | ||
CodeInvalidPortID = types.CodeInvalidPortID | ||
SubModuleName = types.SubModuleName | ||
StoreKey = types.StoreKey | ||
RouterKey = types.RouterKey | ||
QuerierRoute = types.QuerierRoute | ||
) | ||
|
||
var ( | ||
// functions aliases | ||
NewKeeper = keeper.NewKeeper | ||
ErrPortExists = types.ErrPortExists | ||
ErrPortNotFound = types.ErrPortNotFound | ||
ErrPortNotAuthenticated = types.ErrPortNotAuthenticated | ||
ErrInvalidPortID = types.ErrInvalidPortID | ||
PortPath = types.PortPath | ||
KeyPort = types.KeyPort | ||
) | ||
|
||
type ( | ||
Keeper = keeper.Keeper | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package keeper | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/cosmos/cosmos-sdk/codec" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/x/ibc/05-port/types" | ||
host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" | ||
) | ||
|
||
// Keeper defines the IBC connection keeper | ||
type Keeper struct { | ||
storeKey sdk.StoreKey | ||
cdc *codec.Codec | ||
codespace sdk.CodespaceType | ||
prefix []byte // prefix bytes for accessing the store | ||
ports map[sdk.CapabilityKey]string | ||
bound []string | ||
} | ||
|
||
// NewKeeper creates a new IBC connection Keeper instance | ||
func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, codespace sdk.CodespaceType) Keeper { | ||
return Keeper{ | ||
storeKey: key, | ||
cdc: cdc, | ||
codespace: sdk.CodespaceType(fmt.Sprintf("%s/%s", codespace, types.DefaultCodespace)), // "ibc/port", | ||
prefix: []byte{}, | ||
// prefix: []byte(types.SubModuleName + "/"), // "port/" | ||
ports: make(map[sdk.CapabilityKey]string), // map of capabilities to port ids | ||
} | ||
} | ||
|
||
// GetPorts returns the list of bound ports. | ||
// (these ports still must have been bound statically) | ||
func (k Keeper) GetPorts() []string { | ||
return k.bound | ||
} | ||
|
||
// GetPort retrieves a given port ID from keeper map | ||
func (k Keeper) GetPort(ck sdk.CapabilityKey) (string, bool) { | ||
portID, found := k.ports[ck] | ||
return portID, found | ||
} | ||
|
||
// BindPort binds to a port and returns the associated capability. | ||
// Ports must be bound statically when the chain starts in `app.go`. | ||
// The capability must then be passed to a module which will need to pass | ||
// it as an extra parameter when calling functions on the IBC module. | ||
func (k Keeper) BindPort(portID string) sdk.CapabilityKey { | ||
if err := host.DefaultPortIdentifierValidator(portID); err != nil { | ||
panic(err.Error()) | ||
} | ||
|
||
for _, b := range k.bound { | ||
if b == portID { | ||
panic(fmt.Sprintf("port %s is already bound", portID)) | ||
} | ||
} | ||
|
||
key := sdk.NewKVStoreKey(portID) | ||
k.ports[key] = portID | ||
k.bound = append(k.bound, portID) | ||
return key | ||
} | ||
|
||
// Authenticate authenticates a capability key against a port ID | ||
// by checking if the memory address of the capability was previously | ||
// generated and bound to the port (provided as a parameter) which the capability | ||
// is being authenticated against. | ||
func (k Keeper) Authenticate(key sdk.CapabilityKey, portID string) bool { | ||
if err := host.DefaultPortIdentifierValidator(portID); err != nil { | ||
panic(err.Error()) | ||
} | ||
|
||
return k.ports[key] == portID | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package types | ||
|
||
import ( | ||
"fmt" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
// port error codes | ||
const ( | ||
DefaultCodespace sdk.CodespaceType = SubModuleName | ||
|
||
CodePortExists sdk.CodeType = 101 | ||
CodePortNotFound sdk.CodeType = 102 | ||
CodePortNotAuthenticated sdk.CodeType = 103 | ||
CodeInvalidPortID sdk.CodeType = 104 | ||
) | ||
|
||
// ErrPortExists implements sdk.Error | ||
func ErrPortExists(codespace sdk.CodespaceType, portID string) sdk.Error { | ||
return sdk.NewError(codespace, CodePortExists, fmt.Sprintf("port with ID %s is already binded", portID)) | ||
} | ||
|
||
// ErrPortNotFound implements sdk.Error | ||
func ErrPortNotFound(codespace sdk.CodespaceType, portID string) sdk.Error { | ||
return sdk.NewError(codespace, CodePortNotFound, fmt.Sprintf("port with ID %s not found", portID)) | ||
} | ||
|
||
// ErrPortNotAuthenticated implements sdk.Error | ||
func ErrPortNotAuthenticated(codespace sdk.CodespaceType) sdk.Error { | ||
return sdk.NewError(codespace, CodePortNotAuthenticated, "port failed authentication") | ||
} | ||
|
||
// ErrInvalidPortID implements sdk.Error | ||
func ErrInvalidPortID(codespace sdk.CodespaceType) sdk.Error { | ||
return sdk.NewError(codespace, CodeInvalidPortID, "invalid port ID") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package types | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
const ( | ||
// SubModuleName defines the IBC port name | ||
SubModuleName = "port" | ||
|
||
// StoreKey is the store key string for IBC ports | ||
StoreKey = SubModuleName | ||
|
||
// RouterKey is the message route for IBC ports | ||
RouterKey = SubModuleName | ||
|
||
// QuerierRoute is the querier route for IBC ports | ||
QuerierRoute = SubModuleName | ||
) | ||
|
||
// The following paths are the keys to the store as defined in https://github.com/cosmos/ics/tree/master/spec/ics-005-port-allocation#store-paths | ||
|
||
// PortPath defines the path under which ports paths are stored | ||
func PortPath(portID string) string { | ||
return fmt.Sprintf("ports/%s", portID) | ||
} | ||
|
||
// KeyPort returns the store key for a particular port | ||
func KeyPort(portID string) []byte { | ||
return []byte(PortPath(portID)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this just a renaming of the
StoreKey
? Is it completely necessary?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really we should call the
StoreKey
sCapabilityKey
s, since that's what they are (nothing is specific to stores).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong opinion about either. @alexanderbez thoughts here?