3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 14:54:15 +00:00

Rename addFollowingAccounts -> addFollowingAccountKeys

This commit is contained in:
Kosta Korenkov 2014-06-25 01:13:32 +04:00
parent 32360fea8d
commit 2edf978af4
3 changed files with 8 additions and 8 deletions

View File

@ -559,10 +559,10 @@ public class Wallet extends BaseTaggableObject implements Serializable, BlockCha
* to get P2SH addresses to receive coins to. * to get P2SH addresses to receive coins to.
* This method should be called only once before key rotation, otherwise it will throw an IllegalStateException. * This method should be called only once before key rotation, otherwise it will throw an IllegalStateException.
*/ */
public void addFollowingAccounts(List<DeterministicKey> followingAccountKeys) { public void addFollowingAccountKeys(List<DeterministicKey> followingAccountKeys) {
lock.lock(); lock.lock();
try { try {
keychain.addFollowingAccounts(followingAccountKeys); keychain.addFollowingAccountKeys(followingAccountKeys);
} finally { } finally {
lock.unlock(); lock.unlock();
} }

View File

@ -107,7 +107,7 @@ public class KeyChainGroup {
public KeyChainGroup(NetworkParameters params, DeterministicSeed seed, List<DeterministicKey> followingAccountKeys) { public KeyChainGroup(NetworkParameters params, DeterministicSeed seed, List<DeterministicKey> followingAccountKeys) {
this(params, seed); this(params, seed);
addFollowingAccounts(followingAccountKeys); addFollowingAccountKeys(followingAccountKeys);
} }
/** /**
@ -116,7 +116,7 @@ public class KeyChainGroup {
* This method will throw an IllegalStateException, if active keychain is already married or already has leaf keys * This method will throw an IllegalStateException, if active keychain is already married or already has leaf keys
* issued. In future this behaviour may be replaced with key rotation * issued. In future this behaviour may be replaced with key rotation
*/ */
public void addFollowingAccounts(List<DeterministicKey> followingAccountKeys) { public void addFollowingAccountKeys(List<DeterministicKey> followingAccountKeys) {
checkState(!isMarried(), "KeyChainGroup is married already"); checkState(!isMarried(), "KeyChainGroup is married already");
checkState(getActiveKeyChain().numLeafKeysIssued() == 0, "Active keychain already has keys in use"); checkState(getActiveKeyChain().numLeafKeysIssued() == 0, "Active keychain already has keys in use");
DeterministicKey accountKey = getActiveKeyChain().getWatchingKey(); DeterministicKey accountKey = getActiveKeyChain().getWatchingKey();

View File

@ -407,21 +407,21 @@ public class KeyChainGroupTest {
@Test @Test
public void addFollowingAccounts() throws Exception { public void addFollowingAccounts() throws Exception {
assertFalse(group.isMarried()); assertFalse(group.isMarried());
group.addFollowingAccounts(ImmutableList.of(watchingAccountKey)); group.addFollowingAccountKeys(ImmutableList.of(watchingAccountKey));
assertTrue(group.isMarried()); assertTrue(group.isMarried());
} }
@Test (expected = IllegalStateException.class) @Test (expected = IllegalStateException.class)
public void addFollowingAccountsTwiceShouldFail() { public void addFollowingAccountsTwiceShouldFail() {
ImmutableList<DeterministicKey> followingKeys = ImmutableList.of(watchingAccountKey); ImmutableList<DeterministicKey> followingKeys = ImmutableList.of(watchingAccountKey);
group.addFollowingAccounts(followingKeys); group.addFollowingAccountKeys(followingKeys);
group.addFollowingAccounts(followingKeys); group.addFollowingAccountKeys(followingKeys);
} }
@Test (expected = IllegalStateException.class) @Test (expected = IllegalStateException.class)
public void addFollowingAccountsForUsedKeychainShouldFail() { public void addFollowingAccountsForUsedKeychainShouldFail() {
group.freshAddress(KeyChain.KeyPurpose.RECEIVE_FUNDS); group.freshAddress(KeyChain.KeyPurpose.RECEIVE_FUNDS);
group.addFollowingAccounts(ImmutableList.of(watchingAccountKey)); group.addFollowingAccountKeys(ImmutableList.of(watchingAccountKey));
} }
@Test @Test