This repository was archived by the owner on Mar 23, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +44
-8
lines changed Expand file tree Collapse file tree 3 files changed +44
-8
lines changed Original file line number Diff line number Diff line change
1
+ import { Actor } from "../../../lib_sdk/actors/actor" ;
1
2
import { createActors } from "../../../lib_sdk/create_actors" ;
2
3
3
4
setTimeout ( function ( ) {
5
+ let alice : Actor ;
6
+ let bob : Actor ;
7
+
8
+ beforeEach ( async function ( ) {
9
+ this . timeout ( 20000 ) ;
10
+ const actors = await createActors ( "cnd_can_be_restarted.log" ) ;
11
+ alice = actors . alice ;
12
+ bob = actors . bob ;
13
+ } ) ;
14
+
15
+ afterEach ( ( ) => {
16
+ if ( alice ) {
17
+ alice . stop ( ) ;
18
+ }
19
+ if ( bob ) {
20
+ bob . stop ( ) ;
21
+ }
22
+ } ) ;
23
+
4
24
describe ( "cnd can be restarted" , function ( ) {
5
25
this . timeout ( 60000 ) ;
6
26
it ( "after the swap was accepted" , async function ( ) {
7
- const { alice, bob } = await createActors (
8
- "cnd_can_be_restarted.log"
9
- ) ;
10
-
11
27
await alice . sendRequest ( ) ;
12
28
await bob . accept ( ) ;
13
29
Original file line number Diff line number Diff line change
1
+ import { Actor } from "../../../lib_sdk/actors/actor" ;
1
2
import { AssetKind } from "../../../lib_sdk/asset" ;
2
3
import { createActors } from "../../../lib_sdk/create_actors" ;
3
4
4
5
setTimeout ( function ( ) {
6
+ let alice : Actor ;
7
+ let bob : Actor ;
8
+
9
+ beforeEach ( async function ( ) {
10
+ this . timeout ( 20000 ) ;
11
+ const actors = await createActors ( "e2e-rfc003-btc-eth-happy.log" ) ;
12
+ alice = actors . alice ;
13
+ bob = actors . bob ;
14
+ } ) ;
15
+
16
+ afterEach ( ( ) => {
17
+ if ( alice ) {
18
+ alice . stop ( ) ;
19
+ }
20
+ if ( bob ) {
21
+ bob . stop ( ) ;
22
+ }
23
+ } ) ;
24
+
5
25
describe ( "happy path" , function ( ) {
6
26
this . timeout ( 60000 ) ;
7
27
it ( "bitcoin ether" , async function ( ) {
8
- const { alice, bob } = await createActors (
9
- "e2e-rfc003-btc-eth-happy.log"
10
- ) ;
11
-
12
28
await alice . sendRequest ( AssetKind . Bitcoin , AssetKind . Ether ) ;
13
29
await bob . accept ( ) ;
14
30
await alice . fund ( ) ;
Original file line number Diff line number Diff line change @@ -244,6 +244,10 @@ export class Actor {
244
244
await this . cndInstance . start ( ) ;
245
245
}
246
246
247
+ public stop ( ) {
248
+ this . cndInstance . stop ( ) ;
249
+ }
250
+
247
251
private async additionalIdentities (
248
252
alphaAsset : AssetKind ,
249
253
betaAsset : AssetKind
You can’t perform that action at this time.
0 commit comments