File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,28 @@ async function main() {
7373 console . log ( "Create a connection" ) ;
7474 await createConnection ( { chainA, chainB } ) ;
7575 }
76+
77+ while ( true ) {
78+ const connectionCheckPrompt = new Select ( {
79+ name : "connection check" ,
80+ message : "Will you check connection?" ,
81+ choices : [ "yes" , "skip" , "exit" ]
82+ } ) ;
83+ const connectionCheckAnswer = await connectionCheckPrompt . run ( ) ;
84+
85+ if ( connectionCheckAnswer === "exit" ) {
86+ return ;
87+ }
88+
89+ if ( connectionCheckAnswer === "yes" ) {
90+ console . log ( "Check a connection" ) ;
91+ await checkConnections ( { chainA, chainB } ) ;
92+ }
93+
94+ if ( connectionCheckAnswer === "skip" ) {
95+ break ;
96+ }
97+ }
7698}
7799
78100main ( ) . catch ( console . error ) ;
@@ -139,3 +161,17 @@ async function createConnection({
139161 } )
140162 ) ;
141163}
164+
165+ async function checkConnections ( {
166+ chainA,
167+ chainB
168+ } : {
169+ chainA : Chain ;
170+ chainB : Chain ;
171+ } ) {
172+ const connectionA = await chainA . queryConnection ( ) ;
173+ console . log ( `Connection in A ${ JSON . stringify ( connectionA ) } ` ) ;
174+
175+ const connectionB = await chainB . queryConnection ( ) ;
176+ console . log ( `Connection in B ${ JSON . stringify ( connectionB ) } ` ) ;
177+ }
You can’t perform that action at this time.
0 commit comments