mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 07:07:43 +01:00
Add getRandomOfferId method
This commit is contained in:
parent
e30875eb15
commit
9865c80b96
2 changed files with 12 additions and 6 deletions
|
@ -17,9 +17,14 @@
|
|||
|
||||
package bisq.core.offer;
|
||||
|
||||
import bisq.common.app.Version;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
|
@ -40,5 +45,9 @@ public class CreateOfferService {
|
|||
// API
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
public String getRandomOfferId() {
|
||||
return Utilities.getRandomPrefix(5, 8) + "-" +
|
||||
UUID.randomUUID().toString() + "-" +
|
||||
Version.VERSION.replace(".", "");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,7 +89,6 @@ import java.util.HashSet;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
@ -169,8 +168,8 @@ public abstract class MutableOfferDataModel extends OfferDataModel implements Bs
|
|||
MakerFeeProvider makerFeeProvider,
|
||||
Navigation navigation) {
|
||||
super(btcWalletService);
|
||||
this.createOfferService = createOfferService;
|
||||
|
||||
this.createOfferService = createOfferService;
|
||||
this.openOfferManager = openOfferManager;
|
||||
this.bsqWalletService = bsqWalletService;
|
||||
this.preferences = preferences;
|
||||
|
@ -187,9 +186,7 @@ public abstract class MutableOfferDataModel extends OfferDataModel implements Bs
|
|||
this.makerFeeProvider = makerFeeProvider;
|
||||
this.navigation = navigation;
|
||||
|
||||
offerId = Utilities.getRandomPrefix(5, 8) + "-" +
|
||||
UUID.randomUUID().toString() + "-" +
|
||||
Version.VERSION.replace(".", "");
|
||||
offerId = createOfferService.getRandomOfferId();
|
||||
shortOfferId = Utilities.getShortId(offerId);
|
||||
addressEntry = btcWalletService.getOrCreateAddressEntry(offerId, AddressEntry.Context.OFFER_FUNDING);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue