@@ -90,7 +90,7 @@ const echoService = (components: EchoServiceComponents): unknown => {
90
90
stream , stream
91
91
)
92
92
} , {
93
- runOnTransientConnection : true
93
+ runOnLimitedConnection : true
94
94
} )
95
95
} ,
96
96
stop ( ) { }
@@ -560,7 +560,7 @@ describe('circuit-relay', () => {
560
560
561
561
// open hop stream and try to connect to remote
562
562
const stream = await local.dialProtocol(ma, RELAY_V2_HOP_CODEC, {
563
- runOnTransientConnection : true
563
+ runOnLimitedConnection : true
564
564
})
565
565
566
566
const hopStream = pbStream(stream).pb(HopMessage)
@@ -671,7 +671,7 @@ describe('circuit-relay', () => {
671
671
// connection from local through relay should be marked transient
672
672
const connections = remote . getConnections ( local . peerId )
673
673
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 . not . null ( )
675
675
} )
676
676
677
677
it ( 'should not open streams on a transient connection' , async ( ) => {
@@ -697,7 +697,7 @@ describe('circuit-relay', () => {
697
697
await remote . handle ( protocol , ( { stream } ) => {
698
698
void pipe ( stream , stream )
699
699
} , {
700
- runOnTransientConnection : false
700
+ runOnLimitedConnection : false
701
701
} )
702
702
703
703
// discover relay and make reservation
@@ -712,7 +712,7 @@ describe('circuit-relay', () => {
712
712
expect ( connection ) . to . have . property ( 'transient' , true )
713
713
714
714
await expect ( connection . newStream ( '/my-protocol/1.0.0' , {
715
- runOnTransientConnection : false
715
+ runOnLimitedConnection : false
716
716
} ) )
717
717
. to . eventually . be . rejected . with . property ( 'code' , 'ERR_TRANSIENT_CONNECTION' )
718
718
} )
@@ -724,7 +724,7 @@ describe('circuit-relay', () => {
724
724
await remote . handle ( protocol , ( { stream } ) => {
725
725
void pipe ( stream , stream )
726
726
} , {
727
- runOnTransientConnection : true
727
+ runOnLimitedConnection : true
728
728
} )
729
729
730
730
// discover relay and make reservation
@@ -739,7 +739,7 @@ describe('circuit-relay', () => {
739
739
expect ( connection ) . to . have . property ( 'transient' , true )
740
740
741
741
await expect ( connection . newStream ( '/my-protocol/1.0.0' , {
742
- runOnTransientConnection : true
742
+ runOnLimitedConnection : true
743
743
} ) )
744
744
. to . eventually . be . ok ( )
745
745
} )
@@ -912,15 +912,15 @@ describe('circuit-relay', () => {
912
912
} catch { }
913
913
} )
914
914
} , {
915
- runOnTransientConnection : true
915
+ runOnLimitedConnection : true
916
916
} )
917
917
918
918
// dial the remote from the local through the relay
919
919
const ma = getRelayAddress ( remote )
920
920
921
921
try {
922
922
const stream = await local . dialProtocol ( ma , protocol , {
923
- runOnTransientConnection : true
923
+ runOnLimitedConnection : true
924
924
} )
925
925
926
926
await stream . sink ( async function * ( ) {
@@ -1056,7 +1056,7 @@ describe('circuit-relay', () => {
1056
1056
const ma = getRelayAddress ( remote )
1057
1057
1058
1058
const stream = await local . dialProtocol ( ma , ECHO_PROTOCOL , {
1059
- runOnTransientConnection : true
1059
+ runOnLimitedConnection : true
1060
1060
} )
1061
1061
1062
1062
// write more than the default data limit
@@ -1075,7 +1075,7 @@ describe('circuit-relay', () => {
1075
1075
const ma = getRelayAddress ( remote )
1076
1076
1077
1077
const stream = await local . dialProtocol ( ma , ECHO_PROTOCOL , {
1078
- runOnTransientConnection : true
1078
+ runOnLimitedConnection : true
1079
1079
} )
1080
1080
1081
1081
let finished = false
@@ -1107,21 +1107,21 @@ describe('circuit-relay', () => {
1107
1107
expect ( finish - start ) . to . be . greaterThan ( defaultDurationLimit )
1108
1108
} )
1109
1109
1110
- it ( 'should not mark an outgoing connection as transient ' , async ( ) => {
1110
+ it ( 'should not mark an outgoing connection as limited ' , async ( ) => {
1111
1111
const ma = getRelayAddress ( remote )
1112
1112
1113
1113
const connection = await local . dial ( ma )
1114
- expect ( connection ) . to . have . property ( 'transient' , false )
1114
+ expect ( connection ) . to . not . have . property ( 'limits' )
1115
1115
} )
1116
1116
1117
- it ( 'should not mark an incoming connection as transient ' , async ( ) => {
1117
+ it ( 'should not mark an incoming connection as limited ' , async ( ) => {
1118
1118
const ma = getRelayAddress ( remote )
1119
1119
1120
1120
await local . dial ( ma )
1121
1121
1122
1122
const connections = remote . getConnections ( local . peerId )
1123
1123
expect ( connections ) . to . have . lengthOf ( 1 )
1124
- expect ( connections ) . to . have . nested . property ( '[0].transient' , false )
1124
+ expect ( connections ) . to . not . have . nested . property ( '[0].limits' )
1125
1125
} )
1126
1126
} )
1127
1127
} )
0 commit comments