@@ -90,7 +90,7 @@ const echoService = (components: EchoServiceComponents): unknown => {
9090 stream , stream
9191 )
9292 } , {
93- runOnTransientConnection : true
93+ runOnLimitedConnection : true
9494 } )
9595 } ,
9696 stop ( ) { }
@@ -560,7 +560,7 @@ describe('circuit-relay', () => {
560560
561561 // open hop stream and try to connect to remote
562562 const stream = await local.dialProtocol(ma, RELAY_V2_HOP_CODEC, {
563- runOnTransientConnection : true
563+ runOnLimitedConnection : true
564564 })
565565
566566 const hopStream = pbStream(stream).pb(HopMessage)
@@ -638,43 +638,43 @@ describe('circuit-relay', () => {
638638 expect ( circuitListener [ 0 ] . relayStore . listenerCount ( 'relay:removed' ) ) . to . equal ( 1 )
639639 } )
640640
641- it ( 'should mark an outgoing relayed connection as transient ' , async ( ) => {
641+ it ( 'should mark an outgoing relayed connection as limited ' , async ( ) => {
642642 // discover relay and make reservation
643643 const connectionToRelay = await remote . dial ( relay1 . getMultiaddrs ( ) [ 0 ] )
644644
645- // connection to relay should not be marked transient
646- expect ( connectionToRelay ) . to . have . property ( 'transient' , false )
645+ // connection to relay should not be limited
646+ expect ( connectionToRelay ) . to . have . property ( 'limits' ) . that . is . undefined ( )
647647
648648 await usingAsRelay ( remote , relay1 )
649649
650650 // dial the remote through the relay
651651 const ma = getRelayAddress ( remote )
652652 const connection = await local . dial ( ma )
653653
654- // connection to remote through relay should be marked transient
655- expect ( connection ) . to . have . property ( 'transient' , true )
654+ // connection to remote through relay should be limited
655+ expect ( connection ) . to . have . property ( 'limits' ) . that . is . ok ( )
656656 } )
657657
658- it ( 'should mark an incoming relayed connection as transient ' , async ( ) => {
658+ it ( 'should mark an incoming relayed connection as limited ' , async ( ) => {
659659 // discover relay and make reservation
660660 const connectionToRelay = await remote . dial ( relay1 . getMultiaddrs ( ) [ 0 ] )
661661
662- // connection to relay should not be marked transient
663- expect ( connectionToRelay ) . to . have . property ( 'transient' , false )
662+ // connection to relay should not be limited
663+ expect ( connectionToRelay ) . to . have . property ( 'limits' ) . that . is . undefined ( )
664664
665665 await usingAsRelay ( remote , relay1 )
666666
667667 // dial the remote through the relay
668668 const ma = getRelayAddress ( remote )
669669 await local . dial ( ma )
670670
671- // connection from local through relay should be marked transient
671+ // connection from local through relay should be limited
672672 const connections = remote . getConnections ( local . peerId )
673673 expect ( connections ) . to . have . lengthOf ( 1 )
674- expect ( connections ) . to . have . nested . property ( '[0].transient' , true )
674+ expect ( connections ) . to . have . nested . property ( '[0].limits' ) . that . is . ok ( )
675675 } )
676676
677- it ( 'should not open streams on a transient connection' , async ( ) => {
677+ it ( 'should not open streams on a limited connection' , async ( ) => {
678678 // discover relay and make reservation
679679 await remote . dial ( relay1 . getMultiaddrs ( ) [ 0 ] )
680680 await usingAsRelay ( remote , relay1 )
@@ -683,21 +683,21 @@ describe('circuit-relay', () => {
683683 const ma = getRelayAddress ( remote )
684684 const connection = await local . dial ( ma )
685685
686- // connection should be marked transient
687- expect ( connection ) . to . have . property ( 'transient' , true )
686+ // connection should be marked limited
687+ expect ( connection ) . to . have . property ( 'limits' ) . that . is . ok ( )
688688
689689 await expect ( connection . newStream ( '/my-protocol/1.0.0' ) )
690- . to . eventually . be . rejected . with . property ( 'code' , 'ERR_TRANSIENT_CONNECTION ' )
690+ . to . eventually . be . rejected . with . property ( 'code' , 'ERR_LIMITED_CONNECTION ' )
691691 } )
692692
693- it ( 'should not allow incoming streams on a transient connection' , async ( ) => {
693+ it ( 'should not allow incoming streams on a limited connection' , async ( ) => {
694694 const protocol = '/my-protocol/1.0.0'
695695
696- // remote registers handler, disallow running over transient streams
696+ // remote registers handler, disallow running over limited connections
697697 await remote . handle ( protocol , ( { stream } ) => {
698698 void pipe ( stream , stream )
699699 } , {
700- runOnTransientConnection : false
700+ runOnLimitedConnection : false
701701 } )
702702
703703 // discover relay and make reservation
@@ -708,23 +708,23 @@ describe('circuit-relay', () => {
708708 const ma = getRelayAddress ( remote )
709709 const connection = await local . dial ( ma )
710710
711- // connection should be marked transient
712- expect ( connection ) . to . have . property ( 'transient' , true )
711+ // connection should be marked limited
712+ expect ( connection ) . to . have . property ( 'limits' ) . that . is . ok ( )
713713
714714 await expect ( connection . newStream ( '/my-protocol/1.0.0' , {
715- runOnTransientConnection : false
715+ runOnLimitedConnection : false
716716 } ) )
717- . to . eventually . be . rejected . with . property ( 'code' , 'ERR_TRANSIENT_CONNECTION ' )
717+ . to . eventually . be . rejected . with . property ( 'code' , 'ERR_LIMITED_CONNECTION ' )
718718 } )
719719
720- it ( 'should open streams on a transient connection when told to do so' , async ( ) => {
720+ it ( 'should open streams on a limited connection when told to do so' , async ( ) => {
721721 const protocol = '/my-protocol/1.0.0'
722722
723- // remote registers handler, allow running over transient streams
723+ // remote registers handler, allow running over limited streams
724724 await remote . handle ( protocol , ( { stream } ) => {
725725 void pipe ( stream , stream )
726726 } , {
727- runOnTransientConnection : true
727+ runOnLimitedConnection : true
728728 } )
729729
730730 // discover relay and make reservation
@@ -735,11 +735,11 @@ describe('circuit-relay', () => {
735735 const ma = getRelayAddress ( remote )
736736 const connection = await local . dial ( ma )
737737
738- // connection should be marked transient
739- expect ( connection ) . to . have . property ( 'transient' , true )
738+ // connection should be marked limited
739+ expect ( connection ) . to . have . property ( 'limits' ) . that . is . ok ( )
740740
741741 await expect ( connection . newStream ( '/my-protocol/1.0.0' , {
742- runOnTransientConnection : true
742+ runOnLimitedConnection : true
743743 } ) )
744744 . to . eventually . be . ok ( )
745745 } )
@@ -912,15 +912,15 @@ describe('circuit-relay', () => {
912912 } catch { }
913913 } )
914914 } , {
915- runOnTransientConnection : true
915+ runOnLimitedConnection : true
916916 } )
917917
918918 // dial the remote from the local through the relay
919919 const ma = getRelayAddress ( remote )
920920
921921 try {
922922 const stream = await local . dialProtocol ( ma , protocol , {
923- runOnTransientConnection : true
923+ runOnLimitedConnection : true
924924 } )
925925
926926 await stream . sink ( async function * ( ) {
@@ -1056,7 +1056,7 @@ describe('circuit-relay', () => {
10561056 const ma = getRelayAddress ( remote )
10571057
10581058 const stream = await local . dialProtocol ( ma , ECHO_PROTOCOL , {
1059- runOnTransientConnection : true
1059+ runOnLimitedConnection : true
10601060 } )
10611061
10621062 // write more than the default data limit
@@ -1075,7 +1075,7 @@ describe('circuit-relay', () => {
10751075 const ma = getRelayAddress ( remote )
10761076
10771077 const stream = await local . dialProtocol ( ma , ECHO_PROTOCOL , {
1078- runOnTransientConnection : true
1078+ runOnLimitedConnection : true
10791079 } )
10801080
10811081 let finished = false
@@ -1107,21 +1107,21 @@ describe('circuit-relay', () => {
11071107 expect ( finish - start ) . to . be . greaterThan ( defaultDurationLimit )
11081108 } )
11091109
1110- it ( 'should not mark an outgoing connection as transient ' , async ( ) => {
1110+ it ( 'should not mark an outgoing connection as limited ' , async ( ) => {
11111111 const ma = getRelayAddress ( remote )
11121112
11131113 const connection = await local . dial ( ma )
1114- expect ( connection ) . to . have . property ( 'transient' , false )
1114+ expect ( connection ) . to . have . property ( 'limits' ) . that . is . undefined ( )
11151115 } )
11161116
1117- it ( 'should not mark an incoming connection as transient ' , async ( ) => {
1117+ it ( 'should not mark an incoming connection as limited ' , async ( ) => {
11181118 const ma = getRelayAddress ( remote )
11191119
11201120 await local . dial ( ma )
11211121
11221122 const connections = remote . getConnections ( local . peerId )
11231123 expect ( connections ) . to . have . lengthOf ( 1 )
1124- expect ( connections ) . to . have . nested . property ( '[0].transient' , false )
1124+ expect ( connections ) . to . have . nested . property ( '[0].limits' ) . that . is . undefined ( )
11251125 } )
11261126 } )
11271127} )
0 commit comments