8000 fix: make getKeyChainType public by HashEngineering · Pull Request #217 · dashpay/dashj · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: make getKeyChainType public #217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected AbstractKeyChainGroupExtension(Wallet wallet) {
this.wallet = wallet;
}

abstract protected AnyKeyChainGroup getKeyChainGroup();
abstract public AnyKeyChainGroup getKeyChainGroup();

boolean isInitialized() {
return getKeyChainGroup() != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ protected void maybeMarkCurrentKeyAsUsed(IDeterministicKey key) {
}
}

protected AuthenticationKeyChain.KeyChainType getKeyChainType(byte [] pubkeyHash) {
public AuthenticationKeyChain.KeyChainType getKeyChainType(byte [] pubkeyHash) {
for (AnyDeterministicKeyChain chain: chains) {
if (chain.findKeyFromPubHash(pubkeyHash) != null) {
return ((AuthenticationKeyChain)chain).getType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public void addEncryptedKeyChain(DeterministicSeed seed, ImmutableList<ChildNumb
}

@Override
protected AnyKeyChainGroup getKeyChainGroup() {
public AnyKeyChainGroup getKeyChainGroup() {
return coinJoinKeyChainGroup;
}

Expand Down
19 changes: 19 additions & 0 deletions core/src/main/java/org/bitcoinj/wallet/Wallet.java
Original file line number Diff line number Diff line change
Expand Up @@ -5347,7 +5347,26 @@ public Map<String, KeyChainGroupExtension> getKeyChainExtensions() {
lock.unlock();
}
}
10000
/** checks for the existance of an extension */
public boolean hasExtension(String id) {
lock.lock();
try {
return extensions.containsKey(id) || keyChainExtensions.containsKey(id);
} finally {
lock.unlock();
}
}

public KeyChainGroupExtension getKeyChainExtension(String id) {
lock.lock();
try {
return keyChainExtensions.get(id);
} finally {
lock.unlock();
}
}

/**
* Deserialize the wallet extension with the supplied data and then install it, replacing any existing extension
* that may have existed with the same ID. If an exception is thrown then the extension is removed from the wallet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public AuthenticationGroupExtension(NetworkParameters params) {
}

@Override
protected AnyKeyChainGroup getKeyChainGroup() {
public AnyKeyChainGroup getKeyChainGroup() {
return keyChainGroup;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public void processDiffMessage() throws BlockStoreException, IOException {
stream.close();
} finally {
context.setDebugMode(false);
context.close();
blockChain.getBlockStore().close();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
import java.util.Collection;
import java.util.Objects;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import static org.junit.Assert.assertEquals;

Expand Down Expand Up @@ -109,7 +111,7 @@ private void initContext() throws BlockStoreException {
}

@Test
public void processDiffMessage() throws BlockStoreException, IOException, ExecutionException, InterruptedException {
public void processDiffMessage() throws BlockStoreException, IOException, ExecutionException, InterruptedException, TimeoutException {
try {
// this is for mainnet
URL datafile = Objects.requireNonNull(getClass().getResource(qrInfoFilename));
Expand All @@ -130,13 +132,14 @@ public void processDiffMessage() throws BlockStoreException, IOException, Execut

SettableFuture<Boolean> qrinfoComplete = SettableFuture.create();
manager.processDiffMessage(null, qrinfo, false, qrinfoComplete);
qrinfoComplete.get();
qrinfoComplete.get(120, TimeUnit.SECONDS);

assertEquals(height, manager.getQuorumListAtTip(context.getParams().getLlmqDIP0024InstantSend()).getHeight());

stream.close();
} finally {
context.setDebugMode(false);
context.close();
blockChain.getBlockStore().close();
}
}
Expand Down
0