forked from cosmos/ibc-go
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
items from first channel upgrades security audit session (cosmos#5664)
* some items from the security audit * update tests for cancelling when channel is in FLUSHCOMPLETE * remove duplicate test * nit: Move wrapping of returned error to direct return statement. Do not create a new errChanUpgradeFailed for logging/returning, it obfuscates the logic and does not yield much benefit. * nit: consistency in err return cbs.OnChanUpgradeTry Wrap the error before returning as is done in ChannelUpgradeInit. * add comment * nit: Call application callbacks before performing any state change operations. * chore: Add documentation indicating to app devs that callbacks are invoked _before_ core state is written. * upgrade error * nit: Add note on handling wrapped error in IsUpgradeError docu string, add fmt.Errorf wrap test case. * Update modules/core/04-channel/types/upgrade_test.go * chore: Use consistent logging in writeUpgradeAck + writeUpgradeConfirm Move log into the if to only log if channel state actually changes. Could be moved outside for both cases but might then be logging when channel state doesn't change. * Apply suggestions from code review Co-authored-by: Cian Hatton <[email protected]> * nit: review comments from Cian. - Prefer using SetChannelState over look-up channel, modify, set. - Add deeply test case with error wrapped multiple times. * nit: Address Colin's comment * nit: just linter thangs. * Apply suggestions from code review Co-authored-by: colin axnér <[email protected]> * nit: Fix linter flatten if else. --------- Co-authored-by: DimitrisJim <[email protected]> Co-authored-by: Charly <[email protected]> Co-authored-by: Charly <[email protected]> Co-authored-by: Cian Hatton <[email protected]> Co-authored-by: colin axnér <[email protected]>
- Loading branch information
1 parent
11e63f4
commit 41501a2
Showing
7 changed files
with
146 additions
and
45 deletions.
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
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
Oops, something went wrong.