mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +01:00
Refactor: rename methods, move return statement
This commit is contained in:
parent
e0f4dc22e7
commit
26024bd6ec
3 changed files with 7 additions and 8 deletions
|
@ -882,13 +882,13 @@ public class AccountAgeWitnessService {
|
|||
tradeAmountIsSufficient(trade.getTradeAmount());
|
||||
}
|
||||
|
||||
public String signInfoFromAccount(PaymentAccount paymentAccount) {
|
||||
public String getSignInfoFromAccount(PaymentAccount paymentAccount) {
|
||||
var pubKey = keyRing.getSignatureKeyPair().getPublic();
|
||||
var witness = getMyWitness(paymentAccount.getPaymentAccountPayload());
|
||||
return Utilities.bytesAsHexString(witness.getHash()) + "," + Utilities.bytesAsHexString(pubKey.getEncoded());
|
||||
}
|
||||
|
||||
public Tuple2<AccountAgeWitness, byte[]> signInfoFromString(String signInfo) {
|
||||
public Tuple2<AccountAgeWitness, byte[]> getSignInfoFromString(String signInfo) {
|
||||
var parts = signInfo.split(",");
|
||||
if (parts.length != 2) {
|
||||
return null;
|
||||
|
@ -899,12 +899,11 @@ public class AccountAgeWitnessService {
|
|||
var accountAgeWitnessHash = Utilities.decodeFromHex(parts[0]);
|
||||
pubKeyHash = Utilities.decodeFromHex(parts[1]);
|
||||
accountAgeWitness = getWitnessByHash(accountAgeWitnessHash);
|
||||
return accountAgeWitness
|
||||
.map(ageWitness -> new Tuple2<>(ageWitness, pubKeyHash))
|
||||
.orElse(null);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return accountAgeWitness
|
||||
.map(ageWitness -> new Tuple2<>(ageWitness, pubKeyHash))
|
||||
.orElse(null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -547,7 +547,7 @@ public class FiatAccountsView extends PaymentAccountsView<GridPane, FiatAccounts
|
|||
if (selectedAccount == null) {
|
||||
return;
|
||||
}
|
||||
Utilities.copyToClipboard(accountAgeWitnessService.signInfoFromAccount(selectedAccount));
|
||||
Utilities.copyToClipboard(accountAgeWitnessService.getSignInfoFromAccount(selectedAccount));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ public class SignSpecificWitnessWindow extends Overlay<SignSpecificWitnessWindow
|
|||
if (newValue == null || newValue.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
signInfo = accountAgeWitnessService.signInfoFromString(newValue);
|
||||
signInfo = accountAgeWitnessService.getSignInfoFromString(newValue);
|
||||
if (signInfo == null) {
|
||||
actionButton.setDisable(true);
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue