Skip to content

Commit

Permalink
minor fix of test-channel-upgrade
Browse files Browse the repository at this point in the history
Signed-off-by: Masanori Yoshida <[email protected]>
  • Loading branch information
siburu committed Aug 13, 2024
1 parent fdd4879 commit b78e1a8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/cases/tm2tm/scripts/test-channel-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ $RLY paths edit $PATH_NAME dst connection-id ''

# create a new connection and save the new connection identifiers
retry 5 $RLY tx connection $PATH_NAME
srcConnectionId=$($RLY paths list --json | jq --raw-output --arg path_name "$PATH_NAME" '.[$path_name].src."connection-id"')
dstConnectionId=$($RLY paths list --json | jq --raw-output --arg path_name "$PATH_NAME" '.[$path_name].dst."connection-id"')
srcAltConnectionId=$($RLY paths list --json | jq --raw-output --arg path_name "$PATH_NAME" '.[$path_name].src."connection-id"')
dstAltConnectionId=$($RLY paths list --json | jq --raw-output --arg path_name "$PATH_NAME" '.[$path_name].dst."connection-id"')

# resume the original config.json
mv $origconfig "$RELAYER_CONF/config/config.json"

# test channel upgrade (crossing-hello)
$RLY tx channel-upgrade init ibc01 ibc0 --ordering ORDER_UNORDERED --connection-hops $srcConnectionId --version ics20-1
$RLY tx channel-upgrade init ibc01 ibc1 --ordering ORDER_UNORDERED --connection-hops $dstConnectionId --version ics20-1
$RLY tx channel-upgrade init ibc01 ibc0 --ordering ORDER_UNORDERED --connection-hops $srcAltConnectionId --version ics20-1
$RLY tx channel-upgrade init ibc01 ibc1 --ordering ORDER_UNORDERED --connection-hops $dstAltConnectionId --version ics20-1
$RLY tx channel-upgrade execute ibc01
pathSrcConnectionId=$($RLY paths list --json | jq --raw-output --arg path_name "$PATH_NAME" '.[$path_name].src."connection-id"')
pathDstConnectionId=$($RLY paths list --json | jq --raw-output --arg path_name "$PATH_NAME" '.[$path_name].dst."connection-id"')
[ "$pathSrcConnectionId" = "$srcConnectionId" ] || { echo 'src path config update failed'; exit 1; }
[ "$pathDstConnectionId" = "$dstConnectionId" ] || { echo 'dst path config update failed'; exit 1; }
[ "$pathSrcConnectionId" = "$srcAltConnectionId" ] || { echo 'src path config update failed'; exit 1; }
[ "$pathDstConnectionId" = "$dstAltConnectionId" ] || { echo 'dst path config update failed'; exit 1; }

# test channel upgrade (non-crossing-hello)
$RLY tx channel-upgrade init ibc01 ibc0 --ordering ORDER_UNORDERED --connection-hops $srcOrigConnectionId --version ics20-1
Expand All @@ -52,8 +52,8 @@ pathDstConnectionId=$($RLY paths list --json | jq --raw-output --arg path_name "
[ "$pathDstConnectionId" = "$dstOrigConnectionId" ] || { echo 'dst path config update failed'; exit 1; }

# test channel upgrade cancel
$RLY tx channel-upgrade init ibc01 ibc0 --ordering ORDER_UNORDERED --connection-hops $srcConnectionId --version ics20-1
$RLY tx channel-upgrade init ibc01 ibc1 --ordering ORDER_UNORDERED --connection-hops $dstConnectionId --version ics20-1
$RLY tx channel-upgrade init ibc01 ibc0 --ordering ORDER_UNORDERED --connection-hops $srcAltConnectionId --version ics20-1
$RLY tx channel-upgrade init ibc01 ibc1 --ordering ORDER_UNORDERED --connection-hops $dstAltConnectionId --version ics20-1
$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
pathSrcConnectionId=$($RLY paths list --json | jq --raw-output --arg path_name "$PATH_NAME" '.[$path_name].src."connection-id"')
Expand Down

0 comments on commit b78e1a8

Please sign in to comment.