File tree Expand file tree Collapse file tree
contracts/stream_contract/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,4 +29,6 @@ pub enum StreamError {
2929 InvalidTokenAddress = 10 ,
3030 /// `amount / duration` rounds to zero — the stream would lock tokens but never accrue.
3131 InvalidRate = 11 ,
32+ /// Operation requires an active stream, but the stream is currently paused.
33+ StreamPaused = 12 ,
3234}
Original file line number Diff line number Diff line change @@ -431,7 +431,7 @@ impl StreamContract {
431431 // Validate stream is active and not paused
432432 Self :: validate_stream_active ( & stream) ?;
433433 if stream. paused {
434- return Err ( StreamError :: StreamInactive ) ;
434+ return Err ( StreamError :: StreamPaused ) ;
435435 }
436436
437437 let now = env. ledger ( ) . timestamp ( ) ;
Original file line number Diff line number Diff line change @@ -1568,7 +1568,7 @@ fn test_withdraw_on_paused_stream_fails() {
15681568
15691569 assert_eq ! (
15701570 client. try_withdraw( & recipient, & id) ,
1571- Err ( Ok ( StreamError :: StreamInactive ) )
1571+ Err ( Ok ( StreamError :: StreamPaused ) )
15721572 ) ;
15731573}
15741574
@@ -2206,7 +2206,7 @@ fn test_withdraw_on_paused_stream_returns_stream_inactive() {
22062206
22072207 // Withdraw must be rejected while paused.
22082208 let result = client. try_withdraw ( & recipient, & id) ;
2209- assert_eq ! ( result, Err ( Ok ( StreamError :: StreamInactive ) ) ) ;
2209+ assert_eq ! ( result, Err ( Ok ( StreamError :: StreamPaused ) ) ) ;
22102210}
22112211
22122212#[ test]
You can’t perform that action at this time.
0 commit comments