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

fix update client bug and reduce complexity #421

Merged
merged 3 commits into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 19 additions & 17 deletions cmd/raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ $ %s tx raw uc ibc-0 ibc-1 ibconeclient`, appName, appName)),
return err
}

updateHeader, err := chains[src].GetIBCUpdateHeader(chains[dst])
updateMsg, err := chains[src].UpdateClient(chains[dst])
if err != nil {
return err
}
return sendAndPrint([]sdk.Msg{chains[src].UpdateClient(updateHeader)},

return sendAndPrint([]sdk.Msg{updateMsg},
chains[src], cmd)
},
}
Expand All @@ -93,7 +94,7 @@ $ %s tx raw clnt ibc-1 ibc-0 ibconeclient`, appName, appName)),
return err
}

dstHeader, err := chains[src].GetIBCCreateClientHeader(chains[dst])
dstHeader, err := chains[src].GetIBCCreateClientHeader()
if err != nil {
return err
}
Expand Down Expand Up @@ -181,17 +182,18 @@ $ %s tx raw conn-try ibc-0 ibc-1 ibczeroclient ibconeclient ibcconn1 ibcconn2`,
return err
}

updateHeader, err := chains[src].GetIBCUpdateHeader(chains[dst])
updateMsg, err := chains[src].UpdateClient(chains[dst])
if err != nil {
return err
}

openTry, err := chains[src].ConnTry(chains[dst])
if err != nil {
return err
}

txs := []sdk.Msg{
chains[src].UpdateClient(updateHeader),
updateMsg,
openTry,
}

Expand Down Expand Up @@ -224,7 +226,7 @@ $ %s tx raw conn-ack ibc-0 ibc-1 ibconeclient ibczeroclient ibcconn1 ibcconn2`,
return err
}

updateHeader, err := chains[src].GetIBCUpdateHeader(chains[dst])
updateMsg, err := chains[src].UpdateClient(chains[dst])
if err != nil {
return err
}
Expand All @@ -235,7 +237,7 @@ $ %s tx raw conn-ack ibc-0 ibc-1 ibconeclient ibczeroclient ibcconn1 ibcconn2`,
}

txs := []sdk.Msg{
chains[src].UpdateClient(updateHeader),
updateMsg,
openAck,
}

Expand Down Expand Up @@ -268,7 +270,7 @@ $ %s tx raw conn-confirm ibc-0 ibc-1 ibczeroclient ibconeclient ibcconn1 ibcconn
return err
}

updateHeader, err := chains[src].GetIBCUpdateHeader(chains[dst])
updateMsg, err := chains[src].UpdateClient(chains[dst])
if err != nil {
return err
}
Expand All @@ -281,8 +283,8 @@ $ %s tx raw conn-confirm ibc-0 ibc-1 ibczeroclient ibconeclient ibcconn1 ibcconn
}

txs := []sdk.Msg{
updateMsg,
chains[src].ConnConfirm(dstState),
chains[src].UpdateClient(updateHeader),
}

return sendAndPrint(txs, chains[src], cmd)
Expand Down Expand Up @@ -389,7 +391,7 @@ $ %s tx raw chan-try ibc-0 ibc-1 ibczeroclient ibcconn0 ibcchan1 ibcchan2 transf
return err
}

updateHeader, err := chains[src].GetIBCUpdateHeader(chains[dst])
updateMsg, err := chains[src].UpdateClient(chains[dst])
if err != nil {
return err
}
Expand All @@ -400,7 +402,7 @@ $ %s tx raw chan-try ibc-0 ibc-1 ibczeroclient ibcconn0 ibcchan1 ibcchan2 transf
}

txs := []sdk.Msg{
chains[src].UpdateClient(updateHeader),
updateMsg,
openTry,
}

Expand Down Expand Up @@ -435,7 +437,7 @@ $ %s tx raw chan-ack ibc-0 ibc-1 ibczeroclient ibcchan1 ibcchan2 transfer transf
return err
}

updateHeader, err := chains[src].GetIBCUpdateHeader(chains[dst])
updateMsg, err := chains[src].UpdateClient(chains[dst])
if err != nil {
return err
}
Expand All @@ -446,7 +448,7 @@ $ %s tx raw chan-ack ibc-0 ibc-1 ibczeroclient ibcchan1 ibcchan2 transfer transf
}

txs := []sdk.Msg{
chains[src].UpdateClient(updateHeader),
updateMsg,
openAck,
}

Expand Down Expand Up @@ -480,7 +482,7 @@ $ %s tx raw chan-confirm ibc-0 ibc-1 ibczeroclient ibcchan1 ibcchan2 transfer tr
return err
}

updateHeader, err := chains[src].GetIBCUpdateHeader(chains[dst])
updateMsg, err := chains[src].UpdateClient(chains[dst])
if err != nil {
return err
}
Expand All @@ -491,7 +493,7 @@ $ %s tx raw chan-confirm ibc-0 ibc-1 ibczeroclient ibcchan1 ibcchan2 transfer tr
}

txs := []sdk.Msg{
chains[src].UpdateClient(updateHeader),
updateMsg,
chains[src].ChanConfirm(dstChanState),
}

Expand Down Expand Up @@ -591,7 +593,7 @@ $ %s tx raw chan-close-confirm ibc-0 ibc-1 ibczeroclient ibcchan1 ibcchan2 trans
return err
}

updateHeader, err := chains[src].GetIBCUpdateHeader(chains[dst])
updateMsg, err := chains[src].UpdateClient(chains[dst])
if err != nil {
return err
}
Expand All @@ -602,7 +604,7 @@ $ %s tx raw chan-close-confirm ibc-0 ibc-1 ibczeroclient ibcchan1 ibcchan2 trans
}

txs := []sdk.Msg{
chains[src].UpdateClient(updateHeader),
updateMsg,
chains[src].ChanCloseConfirm(dstChanState),
}

Expand Down
Loading