diff --git a/tests/cases/tm2tm/scripts/test-channel-upgrade b/tests/cases/tm2tm/scripts/test-channel-upgrade index 1623d9f6..0a86569f 100755 --- a/tests/cases/tm2tm/scripts/test-channel-upgrade +++ b/tests/cases/tm2tm/scripts/test-channel-upgrade @@ -75,22 +75,67 @@ origDstOpts="--ordering $dstOrigOrder --connection-hops $dstOrigConnectionId --v altSrcOpts="--ordering $srcAltOrder --connection-hops $srcAltConnectionId --version $srcAltVersion" altDstOpts="--ordering $dstAltOrder --connection-hops $dstAltConnectionId --version $dstAltVersion" -# test channel upgrade (crossing-hello) +echo '##### case 1 #####' $RLY tx channel-upgrade init ibc01 ibc0 $altSrcOpts $RLY tx channel-upgrade init ibc01 ibc1 $altDstOpts $RLY tx channel-upgrade execute ibc01 checkResult alt -# test channel upgrade (non-crossing-hello) +echo '##### case 2 #####' $RLY tx channel-upgrade init ibc01 ibc0 $origSrcOpts $RLY tx channel-upgrade init ibc01 ibc0 $origSrcOpts $RLY tx channel-upgrade init ibc01 ibc1 $origDstOpts $RLY tx channel-upgrade execute ibc01 checkResult orig -# test channel upgrade cancel +echo '##### case 3 #####' $RLY tx channel-upgrade init ibc01 ibc0 $altSrcOpts $RLY tx channel-upgrade init ibc01 ibc1 $altDstOpts -$RLY tx channel-upgrade cancel ibc01 ibc0 # create situation where ibc0.error_receipt.sequence >= ibc1.channel.upgrade_sequence -$RLY tx channel-upgrade execute ibc01 # the channel upgrade of ibc1 should be cancelled +$RLY tx channel-upgrade cancel ibc01 ibc0 # ibc0 returns to UNINIT. ibc0.error_receipt.sequence >= ibc1.channel.upgrade_sequence +$RLY tx channel-upgrade execute ibc01 # ibc1's upgrade should be cancelled checkResult orig + +echo '##### case 4 #####' +$RLY tx channel-upgrade init ibc01 ibc0 $altSrcOpts +$RLY tx channel-upgrade execute ibc01 --target-src-state INIT --target-dst-state FLUSHING +$RLY tx channel-upgrade cancel ibc01 ibc0 # ibc0 returns to UNINIT. ibc1 is FLUSHING. +$RLY tx channel-upgrade execute ibc01 # ibc1's upgrade should be cancelled +checkResult orig + +echo '##### case 5 #####' +$RLY tx channel-upgrade init ibc01 ibc0 $altSrcOpts +$RLY tx channel-upgrade execute ibc01 --target-src-state INIT --target-dst-state FLUSHING +$RLY tx channel-upgrade cancel ibc01 ibc0 # ibc0 returns to UNINIT. ibc1 is FLUSHING. +$RLY tx channel-upgrade init ibc01 ibc0 $altSrcOpts # ibc0 re-initiates new upgrade. +$RLY tx channel-upgrade execute ibc01 # The upgrade initiated by ibc0 should be completed after ibc1's one is cancelled. +checkResult alt + +echo '##### case 6 #####' +$RLY tx channel-upgrade init ibc01 ibc0 $origSrcOpts +$RLY tx channel-upgrade execute ibc01 --target-src-state FLUSHCOMPLETE --target-dst-state FLUSHING +$RLY tx channel-upgrade cancel ibc01 ibc1 # ibc1 returns to UNINIT. ibc0 is FLUSHCOMPLETE. +$RLY tx channel-upgrade execute ibc01 # ibc0's upgrade (in FLUSHCOMPLETE) should be cancelled. +checkResult alt + +echo '##### case 7 #####' +$RLY tx channel-upgrade init ibc01 ibc0 $origSrcOpts +$RLY tx channel-upgrade execute ibc01 --target-src-state FLUSHCOMPLETE --target-dst-state FLUSHING +$RLY tx channel-upgrade cancel ibc01 ibc1 # ibc1 returns to UNINIT. ibc0 is FLUSHCOMPLETE. +$RLY tx channel-upgrade init ibc01 ibc1 $origDstOpts # ibc1 re-initiates new upgrade. +$RLY tx channel-upgrade execute ibc01 # The upgrade initiated by ibc1 should be completed after ibc0's one is cancelled. +checkResult orig + +# echo '##### case 8 #####' +# $RLY tx channel-upgrade init ibc01 ibc0 $altSrcOpts +# $RLY tx channel-upgrade execute ibc01 --target-src-state FLUSHCOMPLETE --target-dst-state FLUSHING +# sleep ??? +# $RLY tx channel-upgrade execute +# checkResult orig + +# echo '##### case 9 #####' +# $RLY tx channel-upgrade init ibc01 ibc0 $altSrcOpts +# $RLY tx channel-upgrade init ibc01 ibc1 $altDstOpts +# $RLY tx channel-upgrade execute ibc01 --target-src-state FLUSHING --target-dst-state FLUSHING +# sleep ??? +# $RLY tx channel-upgrade execute +# checkResult orig