Remove redundant OpenOffer intial state constructor

The inital state is always OpenOffer.State.AVAILABLE.
This commit is contained in:
Alva Swanson 2024-01-04 15:25:07 +01:00
parent a127cde9ac
commit ecb667c85d
No known key found for this signature in database
GPG Key ID: 004760E77F753090
3 changed files with 1 additions and 14 deletions

View File

@ -91,13 +91,6 @@ public final class OpenOffer implements Tradable {
this(offer, 0);
}
public OpenOffer(Offer offer, State state) {
this.offer = offer;
this.triggerPrice = 0;
this.state = state;
arbitratorNodeAddress = null;
}
public OpenOffer(Offer offer, long triggerPrice) {
this.offer = offer;
this.triggerPrice = triggerPrice;

View File

@ -367,7 +367,7 @@ public class OpenBsqSwapOfferService {
checkArgument(!openOffer.isDeactivated(),
"We must not get called at redoProofOrWorkAndRepublish if offer was deactivated");
OpenOffer newOpenOffer = new OpenOffer(newOffer, OpenOffer.State.AVAILABLE);
OpenOffer newOpenOffer = new OpenOffer(newOffer);
if (!newOpenOffer.isDeactivated()) {
openOfferManager.maybeRepublishOffer(newOpenOffer);
}

View File

@ -35,12 +35,6 @@ public class FeeValidationTests {
assertThat(openOffer.getFeeValidationStatus(), is(equalTo(FeeValidationStatus.NOT_CHECKED_YET)));
}
@Test
void createOpenBsqOfferWithSecondConstructor() {
var openOffer = new OpenOffer(mock(Offer.class), OpenOffer.State.AVAILABLE);
assertThat(openOffer.getFeeValidationStatus(), is(equalTo(FeeValidationStatus.NOT_CHECKED_YET)));
}
@Test
void createOpenOfferWithTriggerPrice() {
var openOffer = new OpenOffer(mock(Offer.class), 42_000);