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

IBC alpha #5277

Merged
merged 243 commits into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
243 commits
Select commit Hold shift + click to select a range
cffb1f3
IBC alpha
fedekunze Nov 5, 2019
d5a9437
ICS 23 Implementation (#4515)
mossid Nov 5, 2019
ec747fc
ICS 02 Implementation (#4516)
mossid Nov 5, 2019
2ae542a
ICS 03 Implementation (#4517)
mossid Nov 5, 2019
4282412
ICS 05 implementation (#5193)
fedekunze Nov 5, 2019
87d09fd
ICS 04 Implementation (#4548)
mossid Nov 5, 2019
bd85998
IBC v1.0.0 (#5245)
fedekunze Nov 5, 2019
4dda39e
IBC demo fixes (#5267)
cwgoes Nov 5, 2019
7a97b78
Add unit tests for ICS03 (#5275)
chengwenxi Nov 7, 2019
0c268c2
Add unit tests for ICS04 (#5286)
chengwenxi Nov 7, 2019
fa0839f
fix conflicts with master
fedekunze Nov 8, 2019
51ecc98
IBC alpha general cleanup (#5291)
fedekunze Nov 11, 2019
2ebee6a
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into ib…
fedekunze Nov 11, 2019
be5be81
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into ib…
fedekunze Nov 12, 2019
ee8bde2
Fix codec issue in ics23
jackzampolin Nov 12, 2019
ae8ea8f
Modify codec registration style to match previous working state
jackzampolin Nov 12, 2019
e12d247
write port tests
AdityaSripal Nov 12, 2019
2de199f
Merge branch 'ibc-alpha' of https://github.com/cosmos/cosmos-sdk into…
AdityaSripal Nov 12, 2019
6cd6d4f
ICS-02: Keeper Tests (#5329)
AdityaSripal Nov 19, 2019
3a8f469
Fix proof verification; remove store key prefixes; add additional pat…
chengwenxi Nov 20, 2019
7c987fe
Add ICS20 tests (#5308)
chengwenxi Nov 21, 2019
321463f
Add IBC REST endpoints (#5310)
chengwenxi Dec 2, 2019
e20e687
fix IBC proofs (#5351)
fedekunze Dec 2, 2019
0015c8b
fix conflicts with master
fedekunze Dec 3, 2019
8ca3c28
fix build; comment handshakes
fedekunze Dec 3, 2019
2e1e0e3
ICS-2 Implement Misbehavior (#5321)
AdityaSripal Dec 5, 2019
ea11bd0
Merge branch 'master' into ibc-alpha
fedekunze Dec 5, 2019
791579f
Merge branch 'master' into ibc-alpha
fedekunze Dec 5, 2019
b330c8e
Misc ibc fixes (#5357)
fedekunze Dec 10, 2019
eaea024
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into ib…
fedekunze Dec 10, 2019
5f65aaa
Implement Query Committer methods in ICS-02 (#5402)
AdityaSripal Dec 13, 2019
c32a94a
merge master
fedekunze Dec 13, 2019
5947f83
Merge branch 'ibc-alpha' of https://github.com/cosmos/cosmos-sdk into…
fedekunze Dec 13, 2019
0d9bfd4
fix test
fedekunze Dec 13, 2019
fb2dd9a
IBC UX improvements (#5364)
fedekunze Dec 16, 2019
64a38f6
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into ib…
fedekunze Dec 17, 2019
4c77df0
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into ib…
fedekunze Dec 18, 2019
6e94d37
Merge branch 'master' into ibc-alpha
fedekunze Dec 18, 2019
c896467
fix ICS02 queries (#5425)
fedekunze Dec 18, 2019
ed3e3f0
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into ib…
fedekunze Dec 19, 2019
9ec532c
Merge branch 'ibc-alpha' of https://github.com/cosmos/cosmos-sdk into…
fedekunze Dec 19, 2019
73a7e5d
fix CLI JSON param unmarshaling (#5431)
fedekunze Jan 2, 2020
e06d6a9
Fix inconsistent string lookup functions (#5437)
fedekunze Jan 2, 2020
221ce96
Update x/ibc error handling (#5462)
fedekunze Jan 2, 2020
560a2fb
Merge branch 'master' into ibc-alpha
fedekunze Jan 2, 2020
682c8ad
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into ib…
fedekunze Jan 6, 2020
1e22171
ADR 015 Implementation (#5401)
mossid Jan 14, 2020
50a3f51
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into ib…
fedekunze Jan 14, 2020
cf135c2
Merge branch 'master' into ibc-alpha
fedekunze Jan 14, 2020
2ecbfe9
IBC alpha
fedekunze Nov 5, 2019
220a482
ICS 23 Implementation (#4515)
mossid Nov 5, 2019
35e0428
ICS 02 Implementation (#4516)
mossid Nov 5, 2019
e9f3385
ICS 03 Implementation (#4517)
mossid Nov 5, 2019
a654fca
ICS 05 implementation (#5193)
fedekunze Nov 5, 2019
017be7f
ICS 04 Implementation (#4548)
mossid Nov 5, 2019
5bdff3c
IBC v1.0.0 (#5245)
fedekunze Nov 5, 2019
c378fb6
IBC demo fixes (#5267)
cwgoes Nov 5, 2019
d8cf351
Add unit tests for ICS03 (#5275)
chengwenxi Nov 7, 2019
97c3613
Add unit tests for ICS04 (#5286)
chengwenxi Nov 7, 2019
20950b7
IBC alpha general cleanup (#5291)
fedekunze Nov 11, 2019
c617d89
Fix codec issue in ics23
jackzampolin Nov 12, 2019
3fb0c56
Modify codec registration style to match previous working state
jackzampolin Nov 12, 2019
61b1b59
write port tests
AdityaSripal Nov 12, 2019
e54cd1f
ICS-02: Keeper Tests (#5329)
AdityaSripal Nov 19, 2019
0c6ea22
Fix proof verification; remove store key prefixes; add additional pat…
chengwenxi Nov 20, 2019
2966286
Add ICS20 tests (#5308)
chengwenxi Nov 21, 2019
77718c1
Add IBC REST endpoints (#5310)
chengwenxi Dec 2, 2019
a35c79e
fix IBC proofs (#5351)
fedekunze Dec 2, 2019
48a853b
fix build; comment handshakes
fedekunze Dec 3, 2019
4bc70d6
ICS-2 Implement Misbehavior (#5321)
AdityaSripal Dec 5, 2019
6c2232e
Misc ibc fixes (#5357)
fedekunze Dec 10, 2019
883c23d
Implement Query Committer methods in ICS-02 (#5402)
AdityaSripal Dec 13, 2019
29b82d9
fix test
fedekunze Dec 13, 2019
e11aca6
IBC UX improvements (#5364)
fedekunze Dec 16, 2019
300892a
fix ICS02 queries (#5425)
fedekunze Dec 18, 2019
3ecb819
fix CLI JSON param unmarshaling (#5431)
fedekunze Jan 2, 2020
045b021
Fix inconsistent string lookup functions (#5437)
fedekunze Jan 2, 2020
1e10e1f
Update x/ibc error handling (#5462)
fedekunze Jan 2, 2020
134551e
ADR 015 Implementation (#5401)
mossid Jan 14, 2020
a593e7a
Merge ibc-alpha upstream
jackzampolin Jan 15, 2020
15fde5b
Fix build errors
jackzampolin Jan 15, 2020
46cbfd9
Merge branch 'master' into ibc-alpha
jackzampolin Jan 16, 2020
939b2a5
remove tmcmn instance
jackzampolin Jan 17, 2020
559db33
remove tmcmn instance
jackzampolin Jan 17, 2020
92f3069
Fix compliation errors
jackzampolin Jan 17, 2020
8f1a9a9
Merge branch 'master' into ibc-alpha
jackzampolin Jan 17, 2020
b6008d0
Merge branch 'master' into ibc-alpha
jackzampolin Jan 22, 2020
2c22e52
Fix build errors
jackzampolin Jan 22, 2020
ee258f0
Fix build errors
jackzampolin Jan 22, 2020
3df016e
ICS07 Tendermint Client implementation (#5485)
fedekunze Jan 27, 2020
1774687
merge master
fedekunze Jan 27, 2020
c2b874b
fix build
fedekunze Jan 27, 2020
4d5c2d1
IBC historical info support (#5475)
fedekunze Jan 29, 2020
bf906aa
cleanup ibc-alpha diff with master
fedekunze Jan 29, 2020
e46ec7d
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into ib…
fedekunze Jan 29, 2020
863662e
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into ib…
fedekunze Jan 29, 2020
b4a5d60
add ADR04 changes
fedekunze Jan 31, 2020
9fbd7cc
Merge branch 'master' into ibc-alpha
jackzampolin Jan 31, 2020
5e7a39b
Add bank alias for gaia
jackzampolin Jan 31, 2020
b52c07a
Moar bank alias gaia
jackzampolin Jan 31, 2020
81e1497
Moar bank alias gaia
jackzampolin Jan 31, 2020
43706c8
merge master
fedekunze Feb 3, 2020
b85c8f5
Merge branch 'ibc-alpha' of https://github.com/cosmos/cosmos-sdk into…
fedekunze Feb 3, 2020
b822566
Merge branch 'master' into ibc-alpha
jackzampolin Feb 5, 2020
34e6a87
Fix query all clients
jackzampolin Feb 6, 2020
cd61769
update to current Tendermint master
melekes Feb 7, 2020
8fd8950
TxSearchMock: add orderBy field to TxSearch method
melekes Feb 7, 2020
396eed4
Merge branch 'master' into ibc-alpha
jackzampolin Feb 11, 2020
b411199
fix build errors
jackzampolin Feb 11, 2020
c342166
Small changes for compilation of gaia
jackzampolin Feb 11, 2020
55d1aea
Small changes for compilation of gaia
jackzampolin Feb 11, 2020
38d87b4
Add 07-tm.Header.ConsensusState() to make conversions easy
jackzampolin Feb 14, 2020
d8a693d
merge master
fedekunze Feb 17, 2020
c0b7ed2
pull branch
fedekunze Feb 17, 2020
e73caba
Add additional IBC Channel Tests (#5578)
jackzampolin Feb 18, 2020
f123d8a
merge master
fedekunze Feb 18, 2020
5875a96
merge master
fedekunze Feb 18, 2020
efb28d7
ICS07 follow up changes (#5606)
fedekunze Feb 18, 2020
d25f3d3
IBC SDK specification (#5426)
fedekunze Feb 18, 2020
a8b6c67
fix build
fedekunze Feb 18, 2020
cc748c3
Merge branch 'master' into ibc-alpha
jackzampolin Feb 18, 2020
1b5bc90
Merge PR #5670: Fix Packet Timeout Bug
AdityaSripal Feb 18, 2020
a705c56
Merge branch 'master' into ibc-alpha
jackzampolin Feb 18, 2020
5c8f4f9
Merge branch 'master' into ibc-alpha
jackzampolin Feb 19, 2020
ff7c881
Add defensive checks before setting param keytables in keeprs
jackzampolin Feb 19, 2020
54b64d0
Merge branch 'master' into ibc-alpha
jackzampolin Feb 19, 2020
6f42d82
ICS 20 Cleanup and Tests (#5577)
jackzampolin Feb 20, 2020
e2d5d83
conflicts from master
fedekunze Feb 20, 2020
c3bb696
Merge PR #5666: Use Tendermint lite client verification
AdityaSripal Feb 21, 2020
143ccf7
Merge branch 'master' into ibc-alpha
jackzampolin Feb 21, 2020
ace2a98
Disambiguate error codes
cwgoes Feb 21, 2020
bb7e803
Fix binary marshalling for state storage
jackzampolin Feb 24, 2020
5e378a5
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into ib…
fedekunze Feb 26, 2020
4d1fb7c
Merge branch 'master' into ibc-alpha
fedekunze Feb 26, 2020
ac0e739
readd MsgSubmitClientMisbehaviour
fedekunze Feb 26, 2020
1176fb6
Merge branch 'master' into ibc-alpha
jackzampolin Feb 26, 2020
68f6700
Fix double flag registration
jackzampolin Feb 26, 2020
69d089c
ICS23 refactor (#5710)
fedekunze Feb 27, 2020
04a1f6f
merge master
fedekunze Mar 5, 2020
89e4597
Merge branch 'master' into ibc-alpha
jackzampolin Mar 7, 2020
1818d98
Merge PR #5711: Switch mock proofs to real proofs
cwgoes Mar 7, 2020
c035957
Try to fix store decoding issue
jackzampolin Mar 7, 2020
fdd8f7f
Sim issue update
jackzampolin Mar 7, 2020
3818571
add error in msg
AdityaSripal Mar 7, 2020
18acea1
remove next validator set from ibctmtypes.Header
AdityaSripal Mar 8, 2020
5a01435
remove warning msg
AdityaSripal Mar 8, 2020
4b683e5
Make IBC updating more robust
AdityaSripal Mar 8, 2020
1ee0b7e
blh
AdityaSripal Mar 8, 2020
9dae837
bump tm dependency
AdityaSripal Mar 9, 2020
69be1cf
remove redundant clockdrift correction
AdityaSripal Mar 9, 2020
aed047d
Merge pull request #5764 from cosmos/aditya/robust-timing
AdityaSripal Mar 9, 2020
4a3b03a
remove blh commit
AdityaSripal Mar 9, 2020
4692d2d
fix test build failures
AdityaSripal Mar 9, 2020
2310bee
Change time from PST to UTC
jackzampolin Mar 9, 2020
382e78d
Merge PR #5770: Update error message in connection keeper
jackzampolin Mar 9, 2020
85a86eb
Merge branch 'master' into ibc-alpha
jackzampolin Mar 9, 2020
01ccc21
Merge PR #5774: Debug timestamp issues
cwgoes Mar 10, 2020
455c712
Merge PR #5786: Fix MsgTransfer routing
AdityaSripal Mar 11, 2020
b412797
Fix test-case
cwgoes Mar 11, 2020
6244b00
Merge branch 'master' into ibc-alpha
jackzampolin Mar 11, 2020
5795324
register MsgPacket
AdityaSripal Mar 12, 2020
c06d4cc
Flip boolean
cwgoes Mar 16, 2020
8b2db11
emit packet event on SendPacket
AdityaSripal Mar 17, 2020
53b9ca4
Merge pull request #5821 from cosmos/aditya/emit-packet
AdityaSripal Mar 17, 2020
b829550
Fix attribute setting
jackzampolin Mar 18, 2020
af10e05
Implement in-memory KVStore
alexanderbez Mar 18, 2020
29d68cf
Start keeper and types
alexanderbez Mar 18, 2020
191df59
Add codec
alexanderbez Mar 19, 2020
cb6fc18
Add keys logic
alexanderbez Mar 19, 2020
447221b
Update types
alexanderbez Mar 19, 2020
970e786
Update keeper
alexanderbez Mar 19, 2020
0f950e1
Implement NewCapability
alexanderbez Mar 19, 2020
2a3dde9
Implement InitializeAndSeal
alexanderbez Mar 20, 2020
4d40d4d
Update simapp
alexanderbez Mar 20, 2020
4c3e8ef
Implement GetCapability
alexanderbez Mar 20, 2020
772d0f6
Add logging for new and claimed caps
alexanderbez Mar 20, 2020
d8f0ee2
Call InitializeAndSeal in SimApp
alexanderbez Mar 20, 2020
e989574
Update keeper semantics + unit tests
alexanderbez Mar 20, 2020
e929832
Use big endian
alexanderbez Mar 20, 2020
3a95ff8
More unit tests
alexanderbez Mar 20, 2020
9e46368
Increase keeper test coverage
alexanderbez Mar 20, 2020
abc15d8
Remove TODO
alexanderbez Mar 20, 2020
74d09b9
Add module doc
alexanderbez Mar 20, 2020
083494c
Update doc
alexanderbez Mar 20, 2020
d6b5f5b
Apply suggestions from code review
cwgoes Mar 23, 2020
c5e9c60
Update NewCapability godoc
alexanderbez Mar 23, 2020
0fa3522
Clarify owner
alexanderbez Mar 23, 2020
f3a514a
Add forgery test case to TestAuthenticateCapability
alexanderbez Mar 23, 2020
1db27ad
Format doc
alexanderbez Mar 23, 2020
6f2a9dd
Update to tm@v0.33.2
jackzampolin Mar 23, 2020
290344c
Update ADR
alexanderbez Mar 23, 2020
76a5c3e
Explicitly take pointer in FwdCapabilityKey
alexanderbez Mar 23, 2020
82afa7d
Update set to be logn
alexanderbez Mar 23, 2020
84707a8
Merge branch 'ibc-alpha' into bez/adr-003-dynamic-cap
alexanderbez Mar 23, 2020
a8efe0f
Update app module
alexanderbez Mar 23, 2020
9b4f448
Lint
alexanderbez Mar 23, 2020
dc737f5
Merge PR #5828: ADR-003: Dynamic Capabilities
alexanderbez Mar 24, 2020
0ed9ed6
merge master changes
fedekunze Mar 24, 2020
4a04faa
Fix broken test after packet format changed
jackzampolin Mar 25, 2020
94f5d6f
Merge branch 'master' into ibc-alpha
jackzampolin Mar 25, 2020
087c102
Add stub and unit tests for ReleaseCapability
alexanderbez Mar 26, 2020
19a8cb1
Finish implementation
alexanderbez Mar 27, 2020
24bd82e
Add test case to TestAuthenticateCapability for releasing a cap
alexanderbez Mar 27, 2020
3b48464
Merge PR #5877: x/capability: ReleaseCapability
alexanderbez Mar 27, 2020
b6e977d
remove swagger files from ibc module (#5893)
fedekunze Mar 31, 2020
d456271
Move IBC packet data interpretation to the application module (#5890)
michaelfig Apr 1, 2020
4a3e8e6
Merge branch 'master' into ibc-alpha
jackzampolin Apr 1, 2020
8d26b7f
fix ibc-alpha sims (#5909)
fedekunze Apr 2, 2020
eb0930e
fix HistoricalInfo sim decoders
fedekunze Apr 2, 2020
70a0e30
add staking sim decoder test case for HistInfo
fedekunze Apr 2, 2020
b7dea19
Merge branch 'master' into ibc-alpha
fedekunze Apr 2, 2020
fa2ea30
Merge PR #5901: Add & update IBC queriers for relayer use
cwgoes Apr 2, 2020
cb485e0
fix test
fedekunze Apr 2, 2020
419f545
Merge branch 'ibc-alpha' of https://github.com/cosmos/cosmos-sdk into…
fedekunze Apr 2, 2020
0d39e00
Merge PR #5914: x/capability: Fix Object Capability Model
alexanderbez Apr 2, 2020
ebdd0a6
Merge PR #5918: Remove source field from ICS 20 packet & message type…
cwgoes Apr 3, 2020
8927822
fix ics20 client args (#5924)
SegueII Apr 3, 2020
6c28954
Merge PR #5930: Add GetChainID to ClientState interface
jackzampolin Apr 3, 2020
d7a9d6e
Merge branch 'master' of github.com:cosmos/cosmos-sdk into ibc-alpha
fedekunze Apr 3, 2020
60bf21f
Merge PR #5925: Add additional events to x/ibc
cwgoes Apr 6, 2020
52206f4
Migrate x/capability to Protobuf (#5926)
fedekunze Apr 6, 2020
df5bada
Merge PR #5939: Unmarshal packets as JSON
cwgoes Apr 6, 2020
9448610
Merge PR #5888: Dynamic Capabilities with Routing
AdityaSripal Apr 7, 2020
d0053c5
cleanup ibc-alpha (#5945)
fedekunze Apr 7, 2020
174dfa0
Merge branch 'master' into ibc-alpha
fedekunze Apr 7, 2020
53e135f
x/staking: import and export HistoricalInfo
fedekunze Apr 7, 2020
5eb2878
staking/types: add HistoricalInfo to GenesisState
fedekunze Apr 7, 2020
46d805c
changelog
fedekunze Apr 7, 2020
d252c78
Merge branch 'master' into export-hist-info
fedekunze Apr 7, 2020
5c3df55
add staking module to app BeginBlockers
fedekunze Apr 7, 2020
32a3557
remove JSON files
fedekunze Apr 7, 2020
eb3eca9
address comments from review
fedekunze Apr 7, 2020
90875aa
Merge branch 'export-hist-info' of github.com:cosmos/cosmos-sdk into …
fedekunze Apr 7, 2020
2eeae2b
Merge branch 'master' into export-hist-info
fedekunze Apr 7, 2020
0182438
Merge branch 'export-hist-info' of github.com:cosmos/cosmos-sdk into …
fedekunze Apr 7, 2020
168ea78
merge master changes
fedekunze Apr 7, 2020
383a00a
cleanup ibc-alpha
fedekunze Apr 7, 2020
3986dd3
Merge branch 'master' into ibc-alpha
fedekunze Apr 8, 2020
b0cb3af
Merge branch 'master' into ibc-alpha
cwgoes Apr 8, 2020
f4609bb
Merge branch 'master' into ibc-alpha
jackzampolin Apr 8, 2020
b9c0d3a
fix ibc-alpha lint (#5959)
fedekunze Apr 8, 2020
6d6c832
x/ibc: changelog (#5960)
fedekunze Apr 8, 2020
b85f82e
Merge PR #5954: Bind Transfer Port on InitChain
AdityaSripal Apr 8, 2020
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
Prev Previous commit
Next Next commit
Add unit tests for ICS03 (#5275)
* add Is() to counterobject

* add readme, reflect ICS02 revision

* reflect downstream ics

* test in progress

* add test

* in progres

* fin rebase

* in progress

* fin rebase

* add CLIObject in progress

* cli in progress

* add CLIObject

* separate testing from tendermint

* add key to node

* add root and storekey to tests/node, add codec

* rm cli/query.go

* fix test

* fix lint

* fix lint

* add handler/msgs/client

* rm relay

* finalize rebase on 23 root/path sep

* fix lint, fix syntax

* fix querying

* extract out context withstore

* fix 02-client test

* fix 23-commitment test

* add query in progress

* rm freebase, reformat query

* add cli/handler/msg in progress

* add cli/msg/handler

* add CLIQuery, fix tests

* fix golangci

* add docs in progre

* add comments

* add comments

* Apply suggestions from code review

Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* add comments in progress

* add comments

* fix comment

* add comments in progress

* recover IntEncoding scheme for integer

* add uint tests, don't use codec in custom types

* finalize merge

* add godoc

* add godoc in progress

* reformat test

* rm XXX

* add godoc

* modify store

* add query

* update query.go

* update query.go

* cli refactor in progress

* cli refactor in progress

* add Query to boolean.go

* fix key

* fix cli / merkle test

* godoc cleanup

* godoc cleanup

* godoc cleanup

* godoc cleanup

* godoc cleanup

* fix test

* fix client

* merge from ics04 branch

* merge from ics04 branch

* merge from ics04 branch

* merge from ics04 branch

* fix lint

* Apply suggestions from code review

Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* applying review in progress

* apply review - make querier interface

* fix dependency

* fix dependency

* revise querier interface to work both on cli & store

* revise querier interface to work both on cli & store

* reflect downstream change

* fix cli

* reflect downstream changes

* rm commented lines

* address review in progress

* address review, rm cleanup/closing

* rename Path -> Prefix

* Store accessor upstream changes (#5119)

* Store accessor upstream changes (#5119)

* add comments, reformat merkle querier

* rm merkle/utils

* ICS 23 upstream changes (#5120)

* ICS 23 upstream changes (#5120)

* update Value

* update test

* fix

* ICS 02 upstream changes (#5122)

* ICS 02 upstream changes (#5122)

* ICS 03 upstream changes (#5123)

* ICS 03 upstream changes (#5123)

* cleanup types and submodule

* more cleanup and godocs

* remove counterPartyManager/State and cleanup

* implement SubmitMisbehaviour and refactor

* errors

* events

* fix test

* refactors

* WIP refactor ICS03

* remove Mapping

* remove store accessors

* proposed refactor

* remove store accessors from ICS02

* refactor queriers, handler and clean keeper

* logger and tx long description

* ineffassign

* Apply suggestions from code review

Co-Authored-By: Jack Zampolin <jack.zampolin@gmail.com>

* Apply suggestions from code review

Co-Authored-By: Jack Zampolin <jack.zampolin@gmail.com>

* remove store accessors

* refactor handshake to update it to the latest ICS03 spec

* update handler and msgs

* add verification functions

* update verification

* ICS02 module.go

* top level x/ibc structure

* update connection queries

* update connection tx

* remove extra files

* update expected client keeper and export verification funcs

* Update x/ibc/02-client/client/cli/query.go

Co-Authored-By: Jack Zampolin <jack.zampolin@gmail.com>

* Update x/ibc/02-client/types/tendermint/consensus_state.go

Co-Authored-By: Jack Zampolin <jack.zampolin@gmail.com>

* address some of the review comments

* resolve some TODOs and address comments from review

* update connection versioning

* minor error updates

* minor UX improvements

* rename pkg

* fixes

* refactor ICS23

* cleanup types

* rename pkg and fix import

* implement batch verification

* gosimple suggestion

* various fixes; remove legacy tests; remove commitment path query

* alias

* minor updates from ICS23

* renaming

* update verification and rename root funcs

* move querier to x/ibc

* update query.go to use 'custom/...' query path

* add tests

* ICS 24 Implementation (#5229)

* add validation functions

* validate path in ics-23

* address @fede comments

* move errors into host package

* flatten ICS23 structure

* fix ApplyPrefix

* updates from ICS23 and ICS24

* msg.ValidateBasic and ADR09 evidence interface

* complete types testing

* delete empty test file

* remove ibc errors from core error package

* custom JSON marshaling; msg.ValidateBasic; renaming of variables

* minor update

* custom JSON marshaling

* minor changes on commitment types

* R4R - Store consensus state correctly (#5242)

* store consensus state correctly

* fix client example

* update alias

* update alias

* implement ics25

* update comment

* refactor method name

* fix file name

* add test case

* refactor code

* refactor code

* blocked the consensusState check

* refactor code

* fix golangci comments

* refactor testcase

* replace rootMultiStore with simApp

* remove unless code

* remove unless code & refactor test case

* refactor testcase

* goimports code

* clean up
  • Loading branch information
chengwenxi authored and fedekunze committed Nov 7, 2019
commit 7a97b78031698828eb3521235efb81889e080a23
311 changes: 311 additions & 0 deletions x/ibc/03-connection/keeper/handshake_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,311 @@
package keeper_test

import (
"fmt"

client "github.com/cosmos/cosmos-sdk/x/ibc/02-client"
"github.com/cosmos/cosmos-sdk/x/ibc/02-client/types/tendermint"
connection "github.com/cosmos/cosmos-sdk/x/ibc/03-connection"
commitment "github.com/cosmos/cosmos-sdk/x/ibc/23-commitment"
abci "github.com/tendermint/tendermint/abci/types"
)

func (suite *KeeperTestSuite) TestConnOpenInit() {
suite.createClient(testClientID1)
counterparty := connection.NewCounterparty(testClientID1, testConnectionID1, suite.app.IBCKeeper.ConnectionKeeper.GetCommitmentPrefix())

success := func() error {
err := suite.app.IBCKeeper.ConnectionKeeper.ConnOpenInit(suite.ctx, testConnectionID1, testClientID1, counterparty)

conn, existed := suite.app.IBCKeeper.ConnectionKeeper.GetConnection(suite.ctx, testConnectionID1)
suite.True(existed)

expectConn := connection.ConnectionEnd{
State: connection.INIT,
ClientID: testClientID1,
Counterparty: counterparty,
Versions: connection.GetCompatibleVersions(),
}
suite.EqualValues(expectConn, conn)

return err
}

connectionExists := func() error {
err := suite.app.IBCKeeper.ConnectionKeeper.ConnOpenInit(suite.ctx, testConnectionID1, testClientID1, counterparty)
return err
}

var testCases = []TestCase{
{success, true, ""},
{connectionExists, false, "connection already exists"},
}

for _, tc := range testCases {
suite.Equal(tc.expected, tc.fun() == nil, "error: %s", tc.errMsg)
}
}

func (suite *KeeperTestSuite) TestConnOpenTry() {
suite.createClient(testClientID2)
suite.createClient(testClientID1)
suite.createConnection(testConnectionID2, testConnectionID1, testClientID2, testClientID1, connection.INIT)

connectionKey := connection.ConnectionPath(testConnectionID2)
consensusKey := string(client.KeyConsensusState(testClientID2))

invalidProof := func() error {
proofInit, proofHeight := suite.queryProof(connectionKey)
proofConsensus, consensusHeight := suite.queryProof(consensusKey)

counterparty := connection.NewCounterparty(testClientID2, testConnectionID2, suite.app.IBCKeeper.ConnectionKeeper.GetCommitmentPrefix())
err := suite.app.IBCKeeper.ConnectionKeeper.ConnOpenTry(suite.ctx,
testConnectionID1, counterparty, testClientID1,
connection.GetCompatibleVersions(),
proofInit, proofConsensus,
uint64(proofHeight), uint64(consensusHeight))
return err
}

success := func() error {
suite.updateClient(testClientID1)
proofInit, proofHeight := suite.queryProof(connectionKey)
proofConsensus, consensusHeight := suite.queryProof(consensusKey)

counterparty := connection.NewCounterparty(testClientID2, testConnectionID2, suite.app.IBCKeeper.ConnectionKeeper.GetCommitmentPrefix())
err := suite.app.IBCKeeper.ConnectionKeeper.ConnOpenTry(suite.ctx,
testConnectionID1, counterparty, testClientID1,
connection.GetCompatibleVersions(),
proofInit, proofConsensus,
uint64(proofHeight), uint64(consensusHeight))
suite.Nil(err)

//check connection state
conn, existed := suite.app.IBCKeeper.ConnectionKeeper.GetConnection(suite.ctx, testConnectionID1)
suite.True(existed)
suite.Equal(connection.TRYOPEN, conn.State)
return err
}

connectionExists := func() error {
suite.updateClient(testClientID1)
proofInit, proofHeight := suite.queryProof(connectionKey)
proofConsensus, consensusHeight := suite.queryProof(consensusKey)

counterparty := connection.NewCounterparty(testClientID2, testConnectionID2, suite.app.IBCKeeper.ConnectionKeeper.GetCommitmentPrefix())
err := suite.app.IBCKeeper.ConnectionKeeper.ConnOpenTry(suite.ctx,
testConnectionID1, counterparty, testClientID1,
connection.GetCompatibleVersions(),
proofInit, proofConsensus,
uint64(proofHeight), uint64(consensusHeight))
return err
}

var testCases = []TestCase{
{invalidProof, false, "invalid proof"},
{success, true, ""},
{connectionExists, false, "connection already exists"},
}

for _, tc := range testCases {
suite.Equal(tc.expected, tc.fun() == nil, "error: %s", tc.errMsg)
}

}

func (suite *KeeperTestSuite) TestConnOpenAck() {
suite.createClient(testClientID2)
suite.createClient(testClientID1)

suite.createConnection(testConnectionID1, testConnectionID2, testClientID1, testClientID2, connection.TRYOPEN)
connectionKey := connection.ConnectionPath(testConnectionID1)
consensusKey := string(client.KeyConsensusState(testClientID1))

connectionNotFound := func() error {
//suite.updateClient(testClientID2)

proofTry, proofHeight := suite.queryProof(connectionKey)
proofConsensus, consensusHeight := suite.queryProof(consensusKey)
err := suite.app.IBCKeeper.ConnectionKeeper.ConnOpenAck(suite.ctx, testConnectionID2, connection.GetCompatibleVersions()[0], proofTry, proofConsensus, uint64(proofHeight), uint64(consensusHeight))
return err
}

invalidConnectionState := func() error {
suite.createConnection(testConnectionID2, testConnectionID1, testClientID2, testClientID1, connection.NONE)
//suite.updateClient(testClientID2)

proofTry, proofHeight := suite.queryProof(connectionKey)
proofConsensus, consensusHeight := suite.queryProof(consensusKey)
err := suite.app.IBCKeeper.ConnectionKeeper.ConnOpenAck(suite.ctx, testConnectionID2, connection.GetCompatibleVersions()[0], proofTry, proofConsensus, uint64(proofHeight), uint64(consensusHeight))
return err
}

invalidVersion := func() error {
suite.createConnection(testConnectionID2, testConnectionID1, testClientID2, testClientID1, connection.INIT)
//suite.updateClient(testClientID2)

proofTry, proofHeight := suite.queryProof(connectionKey)
proofConsensus, consensusHeight := suite.queryProof(consensusKey)
err := suite.app.IBCKeeper.ConnectionKeeper.ConnOpenAck(suite.ctx, testConnectionID2, "1.0.1", proofTry, proofConsensus, uint64(proofHeight), uint64(consensusHeight))
return err
}

invalidProof := func() error {
suite.createConnection(testConnectionID2, testConnectionID1, testClientID2, testClientID1, connection.INIT)
//suite.updateClient(testClientID2)

proofTry, proofHeight := suite.queryProof(connectionKey)
proofConsensus, consensusHeight := suite.queryProof(consensusKey)
err := suite.app.IBCKeeper.ConnectionKeeper.ConnOpenAck(suite.ctx, testConnectionID2, connection.GetCompatibleVersions()[0], proofTry, proofConsensus, uint64(proofHeight), uint64(consensusHeight))
return err
}

success := func() error {
suite.createConnection(testConnectionID2, testConnectionID1, testClientID2, testClientID1, connection.INIT)
suite.updateClient(testClientID2)

proofTry, proofHeight := suite.queryProof(connectionKey)
proofConsensus, consensusHeight := suite.queryProof(consensusKey)
err := suite.app.IBCKeeper.ConnectionKeeper.ConnOpenAck(suite.ctx, testConnectionID2, connection.GetCompatibleVersions()[0], proofTry, proofConsensus, uint64(proofHeight), uint64(consensusHeight))

//check connection state
conn, existed := suite.app.IBCKeeper.ConnectionKeeper.GetConnection(suite.ctx, testConnectionID2)
suite.True(existed)
suite.Equal(connection.OPEN, conn.State)
return err

}

var testCases = []TestCase{
{connectionNotFound, false, "connection not exists"},
{invalidConnectionState, false, "invalid connection state"},
{invalidVersion, false, "invalid version"},
{invalidProof, false, "invalid proof"},
{success, true, ""},
}

for _, tc := range testCases {
suite.Equal(tc.expected, tc.fun() == nil, "error: %s", tc.errMsg)
}

}

func (suite *KeeperTestSuite) TestConnOpenConfirm() {
suite.createClient(testClientID2)
suite.createClient(testClientID1)
suite.createConnection(testConnectionID2, testConnectionID1, testClientID2, testClientID1, connection.OPEN)

connKey := connection.ConnectionPath(testConnectionID2)
proof, h := suite.queryProof(connKey)

connectionNotFound := func() error {
//ErrConnectionNotFound
err := suite.app.IBCKeeper.ConnectionKeeper.ConnOpenConfirm(suite.ctx, testConnectionID1, proof, uint64(h))
return err
}

invalidConnectionState := func() error {
suite.createConnection(testConnectionID1, testConnectionID2, testClientID1, testClientID2, connection.INIT)
err := suite.app.IBCKeeper.ConnectionKeeper.ConnOpenConfirm(suite.ctx, testConnectionID1, proof, uint64(h))
return err
}

invalidProof := func() error {
//Error proof
suite.createConnection(testConnectionID1, testConnectionID2, testClientID1, testClientID2, connection.TRYOPEN)
err := suite.app.IBCKeeper.ConnectionKeeper.ConnOpenConfirm(suite.ctx, testConnectionID1, proof, uint64(h))
return err
}

success := func() error {
//Success
suite.createConnection(testConnectionID1, testConnectionID2, testClientID1, testClientID2, connection.TRYOPEN)
suite.updateClient(testClientID1)
proof, h = suite.queryProof(connKey)
err := suite.app.IBCKeeper.ConnectionKeeper.ConnOpenConfirm(suite.ctx, testConnectionID1, proof, uint64(h))

//check connection state
conn, existed := suite.app.IBCKeeper.ConnectionKeeper.GetConnection(suite.ctx, testConnectionID1)
suite.True(existed)
suite.Equal(connection.OPEN, conn.State)
return err
}

var testCases = []TestCase{
{connectionNotFound, false, "connection not exists"},
{invalidConnectionState, false, "invalid connection state"},
{invalidProof, false, "invalid proof"},
{success, true, ""},
}

for _, tc := range testCases {
suite.Equal(tc.expected, tc.fun() == nil, "error: %s", tc.errMsg)
}
}

func (suite *KeeperTestSuite) queryProof(key string) (proof commitment.Proof, height int64) {
res := suite.app.Query(abci.RequestQuery{
Path: fmt.Sprintf("store/%s/key", storeKey),
Data: []byte(key),
Prove: true,
})

height = res.Height
proof = commitment.Proof{
Proof: res.Proof,
}

return
}

func (suite *KeeperTestSuite) createClient(clientID string) {
suite.app.Commit()
commitID := suite.app.LastCommitID()

suite.app.BeginBlock(abci.RequestBeginBlock{Header: abci.Header{Height: suite.app.LastBlockHeight() + 1}})
suite.ctx = suite.app.BaseApp.NewContext(false, abci.Header{})

consensusState := tendermint.ConsensusState{
ChainID: chainID,
Height: uint64(commitID.Version),
Root: commitment.NewRoot(commitID.Hash),
}

_, err := suite.app.IBCKeeper.ClientKeeper.CreateClient(suite.ctx, clientID, clientType, consensusState)
suite.NoError(err)
}

func (suite *KeeperTestSuite) updateClient(clientID string) {
// always commit when updateClient and begin a new block
suite.app.Commit()
commitID := suite.app.LastCommitID()

suite.app.BeginBlock(abci.RequestBeginBlock{Header: abci.Header{Height: suite.app.LastBlockHeight() + 1}})
suite.ctx = suite.app.BaseApp.NewContext(false, abci.Header{})

state := tendermint.ConsensusState{
ChainID: chainID,
Height: uint64(commitID.Version),
Root: commitment.NewRoot(commitID.Hash),
}

suite.app.IBCKeeper.ClientKeeper.SetConsensusState(suite.ctx, clientID, state)
suite.app.IBCKeeper.ClientKeeper.SetVerifiedRoot(suite.ctx, clientID, state.GetHeight(), state.GetRoot())
}

func (suite *KeeperTestSuite) createConnection(connID, counterpartyConnID string, clientID, counterpartyClientID string, state connection.State) {
counterparty := connection.NewCounterparty(counterpartyClientID, counterpartyConnID, suite.app.IBCKeeper.ConnectionKeeper.GetCommitmentPrefix())
connection := connection.ConnectionEnd{
State: state,
ClientID: clientID,
Counterparty: counterparty,
Versions: connection.GetCompatibleVersions(),
}
suite.app.IBCKeeper.ConnectionKeeper.SetConnection(suite.ctx, connID, connection)
}

type TestCase = struct {
fun func() error
expected bool
errMsg string
}
75 changes: 75 additions & 0 deletions x/ibc/03-connection/keeper/keeper_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package keeper_test

import (
"testing"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
clientexported "github.com/cosmos/cosmos-sdk/x/ibc/02-client/exported"
"github.com/cosmos/cosmos-sdk/x/ibc/03-connection/types"
ibctypes "github.com/cosmos/cosmos-sdk/x/ibc/types"
"github.com/stretchr/testify/suite"
abci "github.com/tendermint/tendermint/abci/types"
)

const (
clientType = clientexported.Tendermint
storeKey = ibctypes.StoreKey
chainID = "test"

testClientID1 = "testclientid1"
testConnectionID1 = "connectionid1"

testClientID2 = "testclientid2"
testConnectionID2 = "connectionid2"
)

type KeeperTestSuite struct {
suite.Suite

cdc *codec.Codec
ctx sdk.Context
app *simapp.SimApp
}

func (suite *KeeperTestSuite) SetupTest() {
isCheckTx := false
app := simapp.Setup(isCheckTx)

suite.cdc = app.Codec()
suite.ctx = app.BaseApp.NewContext(isCheckTx, abci.Header{})
suite.app = app
}

func TestKeeperTestSuite(t *testing.T) {
suite.Run(t, new(KeeperTestSuite))
}

func (suite *KeeperTestSuite) TestSetAndGetConnection() {
_, existed := suite.app.IBCKeeper.ConnectionKeeper.GetConnection(suite.ctx, testConnectionID1)
suite.False(existed)

counterparty := types.NewCounterparty(testClientID1, testConnectionID1, suite.app.IBCKeeper.ConnectionKeeper.GetCommitmentPrefix())
expConn := types.ConnectionEnd{
State: types.INIT,
ClientID: testClientID1,
Counterparty: counterparty,
Versions: types.GetCompatibleVersions(),
}
suite.app.IBCKeeper.ConnectionKeeper.SetConnection(suite.ctx, testConnectionID1, expConn)
conn, existed := suite.app.IBCKeeper.ConnectionKeeper.GetConnection(suite.ctx, testConnectionID1)
suite.True(existed)
suite.EqualValues(expConn, conn)
}

func (suite *KeeperTestSuite) TestSetAndGetClientConnectionPaths() {

_, existed := suite.app.IBCKeeper.ConnectionKeeper.GetClientConnectionPaths(suite.ctx, testClientID1)
suite.False(existed)

suite.app.IBCKeeper.ConnectionKeeper.SetClientConnectionPaths(suite.ctx, testClientID1, types.GetCompatibleVersions())
paths, existed := suite.app.IBCKeeper.ConnectionKeeper.GetClientConnectionPaths(suite.ctx, testClientID1)
suite.True(existed)
suite.EqualValues(types.GetCompatibleVersions(), paths)
}
Loading