mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-10 09:20:04 +01:00
Wallet: rename keyRotationTime()
method from getKeyRotationTimeInstant()
This commit is contained in:
parent
a68f7f958c
commit
f583cea035
3 changed files with 5 additions and 5 deletions
|
@ -3533,7 +3533,7 @@ public class Wallet extends BaseTaggableObject
|
|||
builder.append("\nKeys:\n");
|
||||
builder.append("Earliest creation time: ").append(TimeUtils.dateTimeFormat(earliestKeyCreationTime()))
|
||||
.append('\n');
|
||||
final Optional<Instant> keyRotationTime = getKeyRotationTimeInstant();
|
||||
final Optional<Instant> keyRotationTime = keyRotationTime();
|
||||
if (keyRotationTime.isPresent())
|
||||
builder.append("Key rotation time: ").append(TimeUtils.dateTimeFormat(keyRotationTime.get())).append('\n');
|
||||
builder.append(keyChainGroup.toString(includeLookahead, includePrivateKeys, aesKey));
|
||||
|
@ -5418,11 +5418,11 @@ public class Wallet extends BaseTaggableObject
|
|||
* Returns the key rotation time, or empty if unconfigured. See {@link #setKeyRotationTime(Instant)} for a description
|
||||
* of the field.
|
||||
*/
|
||||
public Optional<Instant> getKeyRotationTimeInstant() {
|
||||
public Optional<Instant> keyRotationTime() {
|
||||
return Optional.ofNullable(vKeyRotationTime);
|
||||
}
|
||||
|
||||
/** @deprecated use {@link #getKeyRotationTimeInstant()} */
|
||||
/** @deprecated use {@link #keyRotationTime()} */
|
||||
@Deprecated
|
||||
public @Nullable Date getKeyRotationTime() {
|
||||
Instant keyRotationTime = vKeyRotationTime;
|
||||
|
|
|
@ -221,7 +221,7 @@ public class WalletProtobufSerializer {
|
|||
}
|
||||
}
|
||||
|
||||
Optional<Instant> keyRotationTime = wallet.getKeyRotationTimeInstant();
|
||||
Optional<Instant> keyRotationTime = wallet.keyRotationTime();
|
||||
if (keyRotationTime.isPresent()) {
|
||||
long timeSecs = keyRotationTime.get().getEpochSecond();
|
||||
walletBuilder.setKeyRotationTime(timeSecs);
|
||||
|
|
|
@ -2966,7 +2966,7 @@ public class WalletTest extends TestWithWallet {
|
|||
Objects.requireNonNull(tx);
|
||||
assertEquals(Transaction.Purpose.KEY_ROTATION, tx.getPurpose());
|
||||
// Have to divide here to avoid mismatch due to second-level precision in serialisation.
|
||||
assertEquals(compromiseTime, wallet.getKeyRotationTimeInstant().get());
|
||||
assertEquals(compromiseTime, wallet.keyRotationTime().get());
|
||||
|
||||
// Make a normal spend and check it's all ok.
|
||||
wallet.sendCoins(broadcaster, OTHER_ADDRESS, wallet.getBalance());
|
||||
|
|
Loading…
Add table
Reference in a new issue