mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-22 06:21:47 +01:00
PaymentSession: rename time()
method from getTime()
This commit is contained in:
parent
5ae145e6b4
commit
7090c6a152
4 changed files with 6 additions and 6 deletions
|
@ -257,14 +257,14 @@ public class PaymentSession {
|
|||
/**
|
||||
* Returns the time that the payment request was generated.
|
||||
*/
|
||||
public Instant getTime() {
|
||||
public Instant time() {
|
||||
return Instant.ofEpochSecond(paymentDetails.getTime());
|
||||
}
|
||||
|
||||
/** @deprecated use {@link #getTime()} */
|
||||
/** @deprecated use {@link #time()} */
|
||||
@Deprecated
|
||||
public Date getDate() {
|
||||
return Date.from(getTime());
|
||||
return Date.from(time());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -82,7 +82,7 @@ public class PaymentSessionTest {
|
|||
assertEquals(paymentRequestMemo, paymentSession.getMemo());
|
||||
assertEquals(amount, paymentSession.getValue());
|
||||
assertEquals(simplePaymentUrl, paymentSession.getPaymentUrl());
|
||||
assertEquals(time, paymentSession.getTime());
|
||||
assertEquals(time, paymentSession.time());
|
||||
assertTrue(paymentSession.getSendRequest().tx.equals(tx));
|
||||
assertFalse(paymentSession.isExpired());
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ public class PaymentProtocolTool {
|
|||
}
|
||||
final int version = session.getPaymentRequest().getPaymentDetailsVersion();
|
||||
StringBuilder output = new StringBuilder(
|
||||
format("Bitcoin payment request, version %d%nDate: %s%n", version, session.getTime()));
|
||||
format("Bitcoin payment request, version %d%nDate: %s%n", version, session.time()));
|
||||
PaymentProtocol.PkiVerificationData pki = PaymentProtocol.verifyPaymentRequestPki(
|
||||
session.getPaymentRequest(), new TrustStoreLoader.DefaultTrustStoreLoader().getKeyStore());
|
||||
if (pki != null) {
|
||||
|
|
|
@ -841,7 +841,7 @@ public class WalletTool implements Callable<Integer> {
|
|||
private void send(PaymentSession session) {
|
||||
System.out.println("Payment Request");
|
||||
System.out.println("Coin: " + session.getValue().toFriendlyString());
|
||||
System.out.println("Date: " + session.getTime());
|
||||
System.out.println("Date: " + session.time());
|
||||
System.out.println("Memo: " + session.getMemo());
|
||||
if (session.pkiVerificationData != null) {
|
||||
System.out.println("Pki-Verified Name: " + session.pkiVerificationData.displayName);
|
||||
|
|
Loading…
Add table
Reference in a new issue