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 v1.0.0 #5245

Merged
merged 496 commits into from
Nov 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
496 commits
Select commit Hold shift + click to select a range
09e6600
applying review in progress
mossid Sep 11, 2019
6f5f633
Merge branch 'joon/store-mapping' of github.com:cosmos/cosmos-sdk int…
mossid Sep 11, 2019
4116bb7
apply review - make querier interface
mossid Sep 11, 2019
bb006fd
Merge branch 'master' of github.com:cosmos/cosmos-sdk into joon/ibc-s…
mossid Sep 12, 2019
08efad1
fix cli errors
mossid Sep 16, 2019
8040c81
Merge branch 'master' of github.com:cosmos/cosmos-sdk into joon/store…
mossid Sep 17, 2019
48bb32d
Merge branch 'joon/store-mapping' into joon/ics-23-implementation
mossid Sep 17, 2019
9b63a6b
fix dependency
mossid Sep 17, 2019
a7df43c
Merge branch 'joon/ics-23-implementation' into joon/ics-02-implementa…
mossid Sep 17, 2019
acaaaf2
fix dependency
mossid Sep 17, 2019
c18ba68
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid Sep 17, 2019
ab71a6e
Merge branch 'joon/ics-03-implementation' into joon/ics-04-implementa…
mossid Sep 17, 2019
4e53dcd
reflect method name change
mossid Sep 17, 2019
70a1c97
Merge branch 'joon/ics-04-implementation' into joon/ibc-sdk-interface
mossid Sep 17, 2019
828badd
revise querier interface to work both on cli & store
mossid Sep 18, 2019
f88d8d3
revise querier interface to work both on cli & store
mossid Sep 18, 2019
1e64e92
revise querier interface to work both on cli & store
mossid Sep 18, 2019
b4d7491
reflect downstream change
mossid Sep 18, 2019
a59d1e7
Merge branch 'joon/store-mapping' into joon/ics-23-implementation
mossid Sep 18, 2019
bb09ad9
Merge branch 'joon/ics-23-implementation' into joon/ics-02-implementa…
mossid Sep 18, 2019
3ba9f9c
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid Sep 18, 2019
de1a045
fix cli
mossid Sep 18, 2019
2ef039a
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid Sep 18, 2019
a600589
reflect downstream changes
mossid Sep 18, 2019
1fd3040
Merge branch 'joon/ics-03-implementation' into joon/ics-04-implementa…
mossid Sep 18, 2019
c90ed2d
reflect downstream changes
mossid Sep 18, 2019
ffed153
Merge branch 'joon/ics-04-implementation' into joon/ibc-sdk-interface
mossid Sep 18, 2019
cbfb043
fix from address in tx cli
mossid Sep 18, 2019
b15a44d
fix cli in progress(squash later)
mossid Sep 19, 2019
8820838
fix cli
mossid Sep 19, 2019
a72f6c5
remove timeout, add channel cli
mossid Sep 20, 2019
4b81cb5
fix golangci
mossid Sep 20, 2019
3866942
fix cli
mossid Sep 20, 2019
6e6c186
Clean up
tnachen Sep 25, 2019
025caf1
fix mock cli in progress
mossid Sep 25, 2019
c289635
Merge branch 'joon/ibc-sdk-interface' of github.com:cosmos/cosmos-sdk…
mossid Sep 25, 2019
1cea7e3
finalize cleanup, mock cli wip
mossid Sep 28, 2019
45dcdb3
add cli for mocksend
mossid Sep 28, 2019
56be11e
fix handler
mossid Sep 28, 2019
9f63629
rm commented lines
mossid Sep 28, 2019
b4e71e1
address review in progress
mossid Sep 28, 2019
3f509ee
address review, rm cleanup/closing
mossid Sep 28, 2019
10bf523
rename mock packages
mossid Oct 1, 2019
fea2ba6
fix interface for gaia
mossid Oct 1, 2019
6b966a3
rename Path -> Prefix
mossid Oct 1, 2019
21bd8d0
Store accessor upstream changes (#5119)
fedekunze Oct 1, 2019
af2564b
Merge branch 'joon/store-mapping' of https://github.com/cosmos/cosmos…
fedekunze Oct 1, 2019
303ebf3
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into jo…
fedekunze Oct 1, 2019
9b3b120
Merge branch 'master' into joon/store-mapping
fedekunze Oct 1, 2019
18f8d70
Merge branch 'joon/store-mapping' of https://github.com/cosmos/cosmos…
fedekunze Oct 1, 2019
df5b21a
add comments, reformat merkle querier
mossid Oct 1, 2019
7afe221
Merge branch 'joon/ics-23-implementation' of github.com:cosmos/cosmos…
mossid Oct 1, 2019
1ac982c
rm merkle/utils
mossid Oct 1, 2019
fa04419
ICS 23 upstream changes (#5120)
fedekunze Oct 1, 2019
0d5a317
downstream changes
fedekunze Oct 1, 2019
db8d382
update Value
fedekunze Oct 1, 2019
02b31a5
Merge branch 'joon/ics-23-implementation' of https://github.com/cosmo…
fedekunze Oct 1, 2019
4d518f2
update test
fedekunze Oct 1, 2019
8a3e5ea
fix
fedekunze Oct 1, 2019
9975a1d
ICS 02 upstream changes (#5122)
fedekunze Oct 1, 2019
ffc6918
merge ICS 02
fedekunze Oct 1, 2019
11bdbd7
ICS 03 upstream changes (#5123)
fedekunze Oct 1, 2019
5db0863
merge ICS 02
fedekunze Oct 1, 2019
dbbe703
merge upstream changes
fedekunze Oct 1, 2019
7428e5b
update test
fedekunze Oct 1, 2019
cc404a0
cleanup types and submodule
fedekunze Oct 2, 2019
d93a0ae
more cleanup and godocs
fedekunze Oct 2, 2019
9b6afe9
remove counterPartyManager/State and cleanup
fedekunze Oct 2, 2019
c8a0ab4
implement SubmitMisbehaviour and refactor
fedekunze Oct 2, 2019
4483182
errors
fedekunze Oct 4, 2019
23fbb5d
events
fedekunze Oct 4, 2019
ebecbce
fix test
fedekunze Oct 4, 2019
0e85ed0
refactors
fedekunze Oct 4, 2019
03574cb
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze Oct 7, 2019
f16d6e9
WIP refactor ICS03
fedekunze Oct 7, 2019
a7d2d98
remove Mapping
fedekunze Oct 7, 2019
1b7e466
remove store accessors
fedekunze Oct 7, 2019
c09a84c
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into jo…
fedekunze Oct 7, 2019
99c586b
Merge branch 'joon/ics-23-implementation' of https://github.com/cosmo…
fedekunze Oct 7, 2019
02bd6f7
proposed refactor
fedekunze Oct 7, 2019
0e37d75
remove store accessors from ICS02
fedekunze Oct 7, 2019
8dec96f
refactor queriers, handler and clean keeper
fedekunze Oct 8, 2019
83f4c1b
logger and tx long description
fedekunze Oct 8, 2019
178912f
ineffassign
fedekunze Oct 8, 2019
c4617e0
merge ICS02
fedekunze Oct 8, 2019
9a225e9
Apply suggestions from code review
fedekunze Oct 8, 2019
fe7da5f
Apply suggestions from code review
fedekunze Oct 8, 2019
c8ff483
remove store accessors
fedekunze Oct 8, 2019
8bcf17f
refactor handshake to update it to the latest ICS03 spec
fedekunze Oct 9, 2019
3df5378
update handler and msgs
fedekunze Oct 9, 2019
21f7d2c
add verification functions
fedekunze Oct 9, 2019
4e9d2bb
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze Oct 9, 2019
604afd5
update verification
fedekunze Oct 9, 2019
cf347bf
ICS02 module.go
fedekunze Oct 9, 2019
5514e9e
top level x/ibc structure
fedekunze Oct 9, 2019
39dd637
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze Oct 9, 2019
eefa08b
update connection queries
fedekunze Oct 9, 2019
482f24d
update connection tx
fedekunze Oct 10, 2019
e4ffd8e
remove extra files
fedekunze Oct 10, 2019
f69ac00
Merge branch 'joon/ics-03-implementation' of https://github.com/cosmo…
fedekunze Oct 10, 2019
e334947
refactor: remove store accessors, update keeper and types to match sp…
fedekunze Oct 11, 2019
0125276
update handshake and packet
fedekunze Oct 14, 2019
038d7cf
implement packet timeouts
fedekunze Oct 14, 2019
931ef76
implement send and receive packet
fedekunze Oct 14, 2019
de156d3
implement packet ACK
fedekunze Oct 14, 2019
9cc1447
update handler
fedekunze Oct 14, 2019
bb4c551
add channel errors
fedekunze Oct 14, 2019
4c50d4f
channel querier
fedekunze Oct 14, 2019
0163482
update expected client keeper and export verification funcs
fedekunze Oct 14, 2019
7c37222
ICS 05 Implementation
fedekunze Oct 14, 2019
a8244dc
release port and godocs
fedekunze Oct 14, 2019
a1c22e9
Merge branch 'master' into joon/ics-23-implementation
fedekunze Oct 15, 2019
a8ceb45
Update x/ibc/02-client/client/cli/query.go
fedekunze Oct 15, 2019
956eb5c
Update x/ibc/02-client/types/tendermint/consensus_state.go
fedekunze Oct 15, 2019
2cc23b2
Merge branch 'joon/ics-23-implementation' of https://github.com/cosmo…
fedekunze Oct 15, 2019
2e1e894
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze Oct 15, 2019
c573d57
address some of the review comments
fedekunze Oct 15, 2019
6913146
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze Oct 15, 2019
f852b1b
resolve some TODOs and address comments from review
fedekunze Oct 15, 2019
245901c
update connection versioning
fedekunze Oct 15, 2019
7a82144
minor error updates
fedekunze Oct 15, 2019
99829bb
Merge branch 'joon/ics-03-implementation' of https://github.com/cosmo…
fedekunze Oct 15, 2019
105cd5a
Merge branch 'fedekunze/ics-05-implementation' of https://github.com/…
fedekunze Oct 15, 2019
1b45a24
update ICS04 with downstream changes
fedekunze Oct 15, 2019
c079abb
Implement tx cli actions
jackzampolin Oct 15, 2019
791b245
Merge branch 'joon/ics-04-implementation' of github.com:cosmos/cosmos…
jackzampolin Oct 15, 2019
2b4cb05
add MsgSendPacket handler; msg validation, errors and events
fedekunze Oct 16, 2019
012bf54
update errors and add port Keeper to ibc Keeper
fedekunze Oct 16, 2019
b2cd838
merge ICS05 - port PR
fedekunze Oct 16, 2019
6af2ce7
minor UX improvements
fedekunze Oct 16, 2019
8be3af7
rename pkg
fedekunze Oct 16, 2019
53ab47d
fixes
fedekunze Oct 16, 2019
d3a533a
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into jo…
fedekunze Oct 16, 2019
0d56b51
implement query proofs
fedekunze Oct 17, 2019
7ba777e
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into jo…
fedekunze Oct 18, 2019
499abb4
refactor ICS23
fedekunze Oct 18, 2019
a925d88
cleanup types
fedekunze Oct 18, 2019
a0cafbf
Merge branch 'joon/ics-03-implementation' of https://github.com/cosmo…
fedekunze Oct 18, 2019
b174427
Merge branch 'fedekunze/ics-05-implementation' of https://github.com/…
fedekunze Oct 18, 2019
c3b6b18
ICS 5 updates (#5222)
cwgoes Oct 21, 2019
74d8a4b
rename pkg and fix import
fedekunze Oct 21, 2019
53f5fad
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into jo…
fedekunze Oct 21, 2019
c12c298
implement batch verification
fedekunze Oct 21, 2019
a34b741
gosimple suggestion
fedekunze Oct 21, 2019
bf4f096
Merge branch 'master' into joon/ics-23-implementation
fedekunze Oct 21, 2019
386489b
Merge branch 'joon/ics-23-implementation' of https://github.com/cosmo…
fedekunze Oct 21, 2019
383ba49
merge ICS23
fedekunze Oct 21, 2019
9b77275
various fixes; remove legacy tests; remove commitment path query
fedekunze Oct 22, 2019
40fca1a
alias
fedekunze Oct 22, 2019
1eaf55e
Merge branch 'joon/ics-23-implementation' of https://github.com/cosmo…
fedekunze Oct 22, 2019
deceeb8
minor updates from ICS23
fedekunze Oct 22, 2019
2a1a144
renaming
fedekunze Oct 22, 2019
2aa4734
ICS02 changes
fedekunze Oct 22, 2019
714e6e2
update verification and rename root funcs
fedekunze Oct 22, 2019
93bb9d7
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze Oct 22, 2019
3351c08
Merge branch 'joon/ics-03-implementation' of https://github.com/cosmo…
fedekunze Oct 22, 2019
323bc8d
Merge branch 'fedekunze/ics-05-implementation' of https://github.com/…
fedekunze Oct 22, 2019
4680ad3
merge downstream changes
fedekunze Oct 22, 2019
4282729
rm legacy tests; add query proofs support
fedekunze Oct 22, 2019
8fe17f6
remove capability key generation and authentication logic
fedekunze Oct 22, 2019
de13f5a
move querier to x/ibc
fedekunze Oct 22, 2019
aae117f
update query.go to use 'custom/...' query path
fedekunze Oct 22, 2019
f8fd580
add tests
AdityaSripal Oct 22, 2019
cbc1106
ICS 24 Implementation (#5229)
AdityaSripal Oct 22, 2019
f8d99ca
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into jo…
fedekunze Oct 23, 2019
23ae994
flatten ICS23 structure
fedekunze Oct 23, 2019
e1fa5f8
fix ApplyPrefix
fedekunze Oct 23, 2019
7222642
Merge branch 'joon/ics-23-implementation' of https://github.com/cosmo…
fedekunze Oct 23, 2019
4f89602
updates from ICS23 and ICS24
fedekunze Oct 23, 2019
22f874a
msg.ValidateBasic and ADR09 evidence interface
fedekunze Oct 23, 2019
2edb03f
complete types testing
AdityaSripal Oct 23, 2019
5783b03
merge
AdityaSripal Oct 23, 2019
696db2e
delete empty test file
AdityaSripal Oct 23, 2019
69db1f2
remove ibc errors from core error package
AdityaSripal Oct 23, 2019
c22faa1
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze Oct 24, 2019
021544f
custom JSON marshaling; msg.ValidateBasic; renaming of variables
fedekunze Oct 24, 2019
7809e4d
minor update
fedekunze Oct 24, 2019
102ab3d
custom JSON marshaling
fedekunze Oct 24, 2019
2f68c0c
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze Oct 24, 2019
b9654da
Merge branch 'joon/ics-03-implementation' of https://github.com/cosmo…
fedekunze Oct 24, 2019
c8289a8
use host validation for port ids
fedekunze Oct 24, 2019
73be9cc
Merge branch 'fedekunze/ics-05-implementation' of https://github.com/…
fedekunze Oct 24, 2019
7cab018
downstream changes; custom marshal JSON; msg validation, and update e…
fedekunze Oct 24, 2019
a81f236
update errors and aliases
fedekunze Oct 24, 2019
33312c2
start batch-verify tests
AdityaSripal Oct 24, 2019
8d95afa
update msg validation and CLI UX
fedekunze Oct 25, 2019
49d08e3
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into jo…
fedekunze Oct 25, 2019
5239720
minor changes on commitment types
fedekunze Oct 25, 2019
46f9cbd
fix channel and packet check (#5243)
chengwenxi Oct 25, 2019
e048a6c
R4R - Store consensus state correctly (#5242)
chengwenxi Oct 25, 2019
093c004
Merge branch 'joon/ics-23-implementation' of https://github.com/cosmo…
fedekunze Oct 25, 2019
3965928
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze Oct 25, 2019
0c187bf
update alias
fedekunze Oct 25, 2019
29bc19e
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
fedekunze Oct 25, 2019
24e6d29
update alias
fedekunze Oct 25, 2019
a06f30a
Merge branch 'joon/ics-03-implementation' of https://github.com/cosmo…
fedekunze Oct 25, 2019
bd21702
update alias and keeper.GetPort()
fedekunze Oct 25, 2019
ed07a05
downstream changes
fedekunze Oct 25, 2019
afc0583
authenticate port ID; remove send packet msg from CLI
fedekunze Oct 25, 2019
335954c
comment out handlers
fedekunze Oct 25, 2019
09adf43
add ibc module to simapp
fedekunze Oct 25, 2019
0363390
ICS20 implementation (#5204)
chengwenxi Oct 25, 2019
8a62201
switch ibc antehandler to decorator pattern
AdityaSripal Oct 25, 2019
2a6a77a
fix name/comment
AdityaSripal Oct 25, 2019
f3120bf
ICS 20 implementation (#5250)
chengwenxi Oct 29, 2019
9742c14
update ICS20 escrow address
fedekunze Oct 29, 2019
90d0354
fix querier routes
jackzampolin Oct 29, 2019
94ffaeb
fix create client cli
mossid Oct 29, 2019
5a397db
minor updates
fedekunze Oct 30, 2019
af6bed9
ibc querier test
fedekunze Oct 30, 2019
d1f71dd
Merge branch 'master' into joon/ics-23-implementation
fedekunze Oct 30, 2019
82d9124
Refactor ibc/mock/bank into ICS 20 (#5264)
cwgoes Oct 30, 2019
d5363c0
setup ics20 test suite
fedekunze Oct 30, 2019
5004f00
Merge branch 'fedekunze/ibc' of https://github.com/cosmos/cosmos-sdk …
fedekunze Oct 30, 2019
b772c8e
add event to MsgRecvPacket
fedekunze Oct 30, 2019
7655278
update ibc keeper test to use test suite
fedekunze Oct 30, 2019
64b09cb
Add handshake commands
jackzampolin Oct 30, 2019
3ebd0e7
Merge branch 'fedekunze/ibc' of github.com:cosmos/cosmos-sdk into fed…
jackzampolin Oct 30, 2019
600ab59
WIP connection handshake
jackzampolin Oct 30, 2019
0d595c8
WIP Connection Handshake
jackzampolin Oct 30, 2019
0a461b5
use testsuite
AdityaSripal Oct 30, 2019
dac68df
Merge branch 'joon/ics-23-implementation' of https://github.com/cosmo…
AdityaSripal Oct 30, 2019
ccb405a
Add cliCtx.WaitForNBlocks
jackzampolin Oct 30, 2019
89b5844
fix connection handshake in progress
mossid Oct 30, 2019
99c9490
Merge branch 'fedekunze/ibc' of github.com:cosmos/cosmos-sdk into fed…
mossid Oct 30, 2019
6098833
fix connection handshake in progress
mossid Oct 31, 2019
7f9c166
Integrate Evidence Implementation into ICS-02 (#5258)
AdityaSripal Nov 4, 2019
a74ebf3
Merge branch 'master' into joon/ics-23-implementation
fedekunze Nov 4, 2019
6d580aa
finish tendermint tests
AdityaSripal Nov 5, 2019
0dd779e
Merge branch 'joon/ics-02-implementation' of https://github.com/cosmo…
AdityaSripal Nov 5, 2019
e875ca7
complete merge
AdityaSripal Nov 5, 2019
cd0aa22
Add tests for msgs
AdityaSripal Nov 5, 2019
0c8b759
upstream changes
fedekunze Nov 5, 2019
c6fa07b
fix
fedekunze Nov 5, 2019
17abbda
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into jo…
fedekunze Nov 5, 2019
820482f
upstream changes
fedekunze Nov 5, 2019
962979d
ICS23 changes
fedekunze Nov 5, 2019
b5442d3
fix cons state
fedekunze Nov 5, 2019
7c67236
context changes
fedekunze Nov 5, 2019
4866753
Merge branch 'joon/ics-23-implementation' of https://github.com/cosmo…
fedekunze Nov 5, 2019
a696f05
upstream changes
fedekunze Nov 5, 2019
df6bd66
fix cli tx
fedekunze Nov 5, 2019
024486c
upstream changes
fedekunze Nov 5, 2019
b039d37
Merge branch joon/ics-03-implementation' of https://github.com/cosmos…
fedekunze Nov 5, 2019
ab50629
upstream changes
fedekunze Nov 5, 2019
6ec0148
downstream changes
fedekunze Nov 5, 2019
6106861
upstream changes
fedekunze Nov 5, 2019
ab7b2a6
downstream changes
fedekunze Nov 5, 2019
8e669fe
upstream changes
fedekunze Nov 5, 2019
5c4b0d2
conflicts
fedekunze Nov 5, 2019
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
24 changes: 16 additions & 8 deletions simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import (
distr "github.com/cosmos/cosmos-sdk/x/distribution"
"github.com/cosmos/cosmos-sdk/x/genutil"
"github.com/cosmos/cosmos-sdk/x/gov"
"github.com/cosmos/cosmos-sdk/x/ibc"
ibctransfer "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer"
"github.com/cosmos/cosmos-sdk/x/mint"
"github.com/cosmos/cosmos-sdk/x/params"
paramsclient "github.com/cosmos/cosmos-sdk/x/params/client"
Expand Down Expand Up @@ -54,16 +56,18 @@ var (
params.AppModuleBasic{},
crisis.AppModuleBasic{},
slashing.AppModuleBasic{},
ibc.AppModuleBasic{},
)

// module account permissions
maccPerms = map[string][]string{
auth.FeeCollectorName: nil,
distr.ModuleName: nil,
mint.ModuleName: {supply.Minter},
staking.BondedPoolName: {supply.Burner, supply.Staking},
staking.NotBondedPoolName: {supply.Burner, supply.Staking},
gov.ModuleName: {supply.Burner},
auth.FeeCollectorName: nil,
distr.ModuleName: nil,
mint.ModuleName: {supply.Minter},
staking.BondedPoolName: {supply.Burner, supply.Staking},
staking.NotBondedPoolName: {supply.Burner, supply.Staking},
gov.ModuleName: {supply.Burner},
ibctransfer.GetModuleAccountName(): {supply.Minter, supply.Burner},
}
)

Expand Down Expand Up @@ -101,6 +105,7 @@ type SimApp struct {
GovKeeper gov.Keeper
CrisisKeeper crisis.Keeper
ParamsKeeper params.Keeper
IBCKeeper ibc.Keeper

// the module manager
mm *module.Manager
Expand All @@ -123,7 +128,7 @@ func NewSimApp(

keys := sdk.NewKVStoreKeys(bam.MainStoreKey, auth.StoreKey, staking.StoreKey,
supply.StoreKey, mint.StoreKey, distr.StoreKey, slashing.StoreKey,
gov.StoreKey, params.StoreKey)
gov.StoreKey, params.StoreKey, ibc.StoreKey)
tkeys := sdk.NewTransientStoreKeys(params.TStoreKey)

app := &SimApp{
Expand Down Expand Up @@ -172,6 +177,8 @@ func NewSimApp(
staking.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks()),
)

app.IBCKeeper = ibc.NewKeeper(app.cdc, keys[ibc.StoreKey], ibc.DefaultCodespace, app.BankKeeper, app.SupplyKeeper)

// NOTE: Any module instantiated in the module manager that is later modified
// must be passed by reference here.
app.mm = module.NewManager(
Expand All @@ -185,6 +192,7 @@ func NewSimApp(
distr.NewAppModule(app.DistrKeeper, app.SupplyKeeper),
slashing.NewAppModule(app.SlashingKeeper, app.StakingKeeper),
staking.NewAppModule(app.StakingKeeper, app.AccountKeeper, app.SupplyKeeper),
ibc.NewAppModule(app.IBCKeeper),
)

// During begin block slashing happens after distr.BeginBlocker so that
Expand All @@ -200,7 +208,7 @@ func NewSimApp(
auth.ModuleName, distr.ModuleName, staking.ModuleName,
bank.ModuleName, slashing.ModuleName, gov.ModuleName,
mint.ModuleName, supply.ModuleName, crisis.ModuleName,
genutil.ModuleName,
ibc.ModuleName, genutil.ModuleName,
)

app.mm.RegisterInvariants(&app.CrisisKeeper)
Expand Down
9 changes: 9 additions & 0 deletions types/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ type TxResponse struct {
Events StringEvents `json:"events,omitempty"`
}

func (res TxResponse) IsOK() bool {
for _, lg := range res.Logs {
if !lg.Success {
return false
}
}
return true
}

// NewResponseResultTx returns a TxResponse given a ResultTx from tendermint
func NewResponseResultTx(res *ctypes.ResultTx, tx Tx, timestamp string) TxResponse {
if res == nil {
Expand Down
39 changes: 39 additions & 0 deletions x/auth/client/utils/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,45 @@ func CompleteAndBroadcastTxCLI(txBldr authtypes.TxBuilder, cliCtx context.CLICon
return cliCtx.PrintOutput(res)
}

// CompleteAndBroadcastTx implements a utility function that facilitates
// sending a series of messages in a signed transaction given a TxBuilder and a
// QueryContext. It ensures that the account exists, has a proper number and
// sequence set. In addition, it builds and signs a transaction non-interactively
// with the supplied messages. Finally, it broadcasts the signed transaction to a node.
func CompleteAndBroadcastTx(txBldr authtypes.TxBuilder, cliCtx context.CLIContext, msgs []sdk.Msg, passphrase string) (sdk.TxResponse, error) {
var res sdk.TxResponse
txBldr, err := PrepareTxBuilder(txBldr, cliCtx)
if err != nil {
return res, err
}

fromName := cliCtx.GetFromName()

if txBldr.SimulateAndExecute() || cliCtx.Simulate {
txBldr, err = EnrichWithGas(txBldr, cliCtx, msgs)
if err != nil {
return res, err
}

gasEst := GasEstimateResponse{GasEstimate: txBldr.Gas()}
_, _ = fmt.Fprintf(os.Stderr, "%s\n", gasEst.String())
}

// build and sign the transaction
txBytes, err := txBldr.BuildAndSign(fromName, passphrase, msgs)
if err != nil {
return res, err
}

// broadcast to a Tendermint node
res, err = cliCtx.BroadcastTx(txBytes)
if err != nil {
return res, err
}

return res, err
}

// EnrichWithGas calculates the gas estimate that would be consumed by the
// transaction and set the transaction's respective value accordingly.
func EnrichWithGas(txBldr authtypes.TxBuilder, cliCtx context.CLIContext, msgs []sdk.Msg) (authtypes.TxBuilder, error) {
Expand Down
66 changes: 45 additions & 21 deletions x/ibc/03-connection/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/context"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/keys"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/version"
Expand Down Expand Up @@ -349,6 +350,18 @@ func GetCmdHandshakeState(storeKey string, cdc *codec.Codec) *cobra.Command {
return err
}

// get passphrase for key from1
passphrase1, err := keys.GetPassphrase(from1)
if err != nil {
return err
}

// get passphrase for key from2
passphrase2, err := keys.GetPassphrase(from2)
if err != nil {
return err
}

viper.Set(flags.FlagChainID, cid1)
msgOpenInit := types.NewMsgConnectionOpenInit(
connID1, clientID1, connID2, clientID2,
Expand All @@ -359,11 +372,14 @@ func GetCmdHandshakeState(storeKey string, cdc *codec.Codec) *cobra.Command {
return err
}

err = utils.CompleteAndBroadcastTxCLI(txBldr1, ctx1, []sdk.Msg{msgOpenInit})
if err != nil {
fmt.Printf("%v <- %-14v", cid1, msgOpenInit.Type())
res, err := utils.CompleteAndBroadcastTx(txBldr1, ctx1, []sdk.Msg{msgOpenInit}, passphrase1)
if err != nil || !res.IsOK() {
return err
}

fmt.Printf(" [OK] txid(%v) client(%v) conn(%v)\n", res.TxHash, clientID1, connID1)

// Another block has to be passed after msgOpenInit is committed
// to retrieve the correct proofs
// TODO: Modify this to actually check two blocks being processed, and
Expand All @@ -383,11 +399,12 @@ func GetCmdHandshakeState(storeKey string, cdc *codec.Codec) *cobra.Command {
return err
}

err = utils.CompleteAndBroadcastTxCLI(txBldr2, ctx2, []sdk.Msg{msgUpdateClient})
if err != nil {
fmt.Printf("%v <- %-14v", cid2, msgUpdateClient.Type())
res, err = utils.CompleteAndBroadcastTx(txBldr2, ctx2, []sdk.Msg{msgUpdateClient}, passphrase2)
if err != nil || !res.IsOK() {
return err
}
fmt.Printf(" [OK] client(%v)\n", clientID1)
fmt.Printf(" [OK] txid(%v) client(%v)\n", res.TxHash, clientID1)

// Fetch proofs from cid1
viper.Set(flags.FlagChainID, cid1)
Expand All @@ -409,12 +426,14 @@ func GetCmdHandshakeState(storeKey string, cdc *codec.Codec) *cobra.Command {
return err
}

err = utils.CompleteAndBroadcastTxCLI(txBldr2, ctx2, []sdk.Msg{msgOpenTry})
if err != nil {
fmt.Printf("%v <- %-14v", cid2, msgOpenTry.Type())

res, err = utils.CompleteAndBroadcastTx(txBldr2, ctx2, []sdk.Msg{msgOpenTry}, passphrase2)
if err != nil || !res.IsOK() {
return err
}

fmt.Printf(" [OK] client(%v) connection(%v)\n", clientID2, connID2)
fmt.Printf(" [OK] txid(%v) client(%v) connection(%v)\n", res.TxHash, clientID2, connID2)

// Another block has to be passed after msgOpenInit is committed
// to retrieve the correct proofs
Expand All @@ -435,11 +454,11 @@ func GetCmdHandshakeState(storeKey string, cdc *codec.Codec) *cobra.Command {
return err
}

err = utils.CompleteAndBroadcastTxCLI(txBldr1, ctx1, []sdk.Msg{msgUpdateClient})
if err != nil {
res, err = utils.CompleteAndBroadcastTx(txBldr1, ctx1, []sdk.Msg{msgUpdateClient}, passphrase1)
if err != nil || !res.IsOK() {
return err
}
fmt.Printf(" [OK] client(%v)\n", clientID2)
fmt.Printf(" [OK] txid(%v) client(%v)\n", res.TxHash, clientID2)

// Fetch proofs from cid2
viper.Set(flags.FlagChainID, cid2)
Expand All @@ -461,11 +480,13 @@ func GetCmdHandshakeState(storeKey string, cdc *codec.Codec) *cobra.Command {
return err
}

err = utils.CompleteAndBroadcastTxCLI(txBldr1, ctx1, []sdk.Msg{msgOpenAck})
if err != nil {
fmt.Printf("%v <- %-14v", cid1, msgOpenAck.Type())

res, err = utils.CompleteAndBroadcastTx(txBldr1, ctx1, []sdk.Msg{msgOpenAck}, passphrase1)
if err != nil || !res.IsOK() {
return err
}
fmt.Printf(" [OK] connection(%v)\n", connID1)
fmt.Printf(" [OK] txid(%v) connection(%v)\n", res.TxHash, connID1)

// Another block has to be passed after msgOpenInit is committed
// to retrieve the correct proofs
Expand All @@ -486,13 +507,14 @@ func GetCmdHandshakeState(storeKey string, cdc *codec.Codec) *cobra.Command {
return err
}

err = utils.CompleteAndBroadcastTxCLI(txBldr2, ctx2, []sdk.Msg{msgUpdateClient})
if err != nil {
fmt.Printf("%v <- %-14v", cid2, msgUpdateClient.Type())

res, err = utils.CompleteAndBroadcastTx(txBldr2, ctx2, []sdk.Msg{msgUpdateClient}, passphrase2)
if err != nil || !res.IsOK() {
return err
}
fmt.Printf(" [OK] client(%v)\n", clientID1)
fmt.Printf(" [OK] txid(%v) client(%v)\n", res.TxHash, clientID1)

// Fetch proof from cid1
viper.Set(flags.FlagChainID, cid1)
proofs, err = queryProofs(ctx1.WithHeight(header.Height-1), connID1, storeKey)
if err != nil {
Expand All @@ -507,11 +529,13 @@ func GetCmdHandshakeState(storeKey string, cdc *codec.Codec) *cobra.Command {
return err
}

err = utils.CompleteAndBroadcastTxCLI(txBldr2, ctx2, []sdk.Msg{msgOpenConfirm})
if err != nil {
fmt.Printf("%v <- %-14v", cid1, msgOpenConfirm.Type())

res, err = utils.CompleteAndBroadcastTx(txBldr2, ctx2, []sdk.Msg{msgOpenConfirm}, passphrase2)
if err != nil || !res.IsOK() {
return err
}
fmt.Printf(" [OK] connection(%v)\n", connID2)
fmt.Printf(" [OK] txid(%v) connection(%v)\n", res.TxHash, connID2)

return nil
},
Expand Down
62 changes: 62 additions & 0 deletions x/ibc/20-transfer/alias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package transfer

// nolint
// autogenerated code using github.com/rigelrozanski/multitool
// aliases generated for the following subdirectories:
// ALIASGEN: github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/keeper
// ALIASGEN: github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/types

import (
"github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/keeper"
"github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/types"
)

const (
DefaultPacketTimeout = keeper.DefaultPacketTimeout
DefaultCodespace = types.DefaultCodespace
CodeInvalidAddress = types.CodeInvalidAddress
CodeErrSendPacket = types.CodeErrSendPacket
CodeInvalidPacketData = types.CodeInvalidPacketData
CodeInvalidChannelOrder = types.CodeInvalidChannelOrder
CodeInvalidPort = types.CodeInvalidPort
CodeInvalidVersion = types.CodeInvalidVersion
AttributeKeyReceiver = types.AttributeKeyReceiver
SubModuleName = types.SubModuleName
StoreKey = types.StoreKey
RouterKey = types.RouterKey
QuerierRoute = types.QuerierRoute
BoundPortID = types.BoundPortID
)

var (
// functions aliases
NewKeeper = keeper.NewKeeper
RegisterCodec = types.RegisterCodec
ErrInvalidAddress = types.ErrInvalidAddress
ErrSendPacket = types.ErrSendPacket
ErrInvalidPacketData = types.ErrInvalidPacketData
ErrInvalidChannelOrder = types.ErrInvalidChannelOrder
ErrInvalidPort = types.ErrInvalidPort
ErrInvalidVersion = types.ErrInvalidVersion
GetEscrowAddress = types.GetEscrowAddress
GetDenomPrefix = types.GetDenomPrefix
GetModuleAccountName = types.GetModuleAccountName
NewMsgTransfer = types.NewMsgTransfer

// variable aliases
ModuleCdc = types.ModuleCdc
AttributeValueCategory = types.AttributeValueCategory
)

type (
Keeper = keeper.Keeper
BankKeeper = types.BankKeeper
ChannelKeeper = types.ChannelKeeper
ClientKeeper = types.ClientKeeper
ConnectionKeeper = types.ConnectionKeeper
SupplyKeeper = types.SupplyKeeper
MsgTransfer = types.MsgTransfer
MsgRecvPacket = types.MsgRecvPacket
PacketData = types.PacketData
PacketDataAlias = types.PacketDataAlias
)
Loading