forked from bisq-network/bisq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExpectedProtocolStatus.java
69 lines (58 loc) · 1.82 KB
/
ExpectedProtocolStatus.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package bisq.apitest.method.trade;
import bisq.core.trade.model.bisq_v1.Trade;
/**
* A test fixture encapsulating expected trade protocol status.
* Status flags should be cleared via init() before starting a new trade protocol.
*/
public class ExpectedProtocolStatus {
Trade.State state;
Trade.Phase phase;
boolean isDepositPublished;
boolean isDepositConfirmed;
boolean isFiatSent;
boolean isFiatReceived;
boolean isPayoutPublished;
boolean isWithdrawn;
public ExpectedProtocolStatus setState(Trade.State state) {
this.state = state;
return this;
}
public ExpectedProtocolStatus setPhase(Trade.Phase phase) {
this.phase = phase;
return this;
}
public ExpectedProtocolStatus setDepositPublished(boolean depositPublished) {
isDepositPublished = depositPublished;
return this;
}
public ExpectedProtocolStatus setDepositConfirmed(boolean depositConfirmed) {
isDepositConfirmed = depositConfirmed;
return this;
}
public ExpectedProtocolStatus setFiatSent(boolean fiatSent) {
isFiatSent = fiatSent;
return this;
}
public ExpectedProtocolStatus setFiatReceived(boolean fiatReceived) {
isFiatReceived = fiatReceived;
return this;
}
public ExpectedProtocolStatus setPayoutPublished(boolean payoutPublished) {
isPayoutPublished = payoutPublished;
return this;
}
public ExpectedProtocolStatus setWithdrawn(boolean withdrawn) {
isWithdrawn = withdrawn;
return this;
}
public void init() {
state = null;
phase = null;
isDepositPublished = false;
isDepositConfirmed = false;
isFiatSent = false;
isFiatReceived = false;
isPayoutPublished = false;
isWithdrawn = false;
}
}