mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-11 17:55:53 +00:00
Remove IOException from TestWithWallet.
This commit is contained in:
parent
53688cde60
commit
40b46f0326
@ -23,7 +23,6 @@ import org.bitcoinj.store.MemoryBlockStore;
|
||||
import org.bitcoinj.utils.BriefLogFormatter;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.bitcoinj.testing.FakeTxBuilder.createFakeBlock;
|
||||
import static org.bitcoinj.testing.FakeTxBuilder.createFakeTx;
|
||||
@ -62,7 +61,7 @@ public class TestWithWallet {
|
||||
|
||||
@Nullable
|
||||
protected Transaction sendMoneyToWallet(Wallet wallet, Transaction tx, AbstractBlockChain.NewBlockType type)
|
||||
throws IOException, VerificationException {
|
||||
throws VerificationException {
|
||||
if (type == null) {
|
||||
// Pending/broadcast tx.
|
||||
if (wallet.isPendingTransactionRelevant(tx))
|
||||
@ -77,22 +76,22 @@ public class TestWithWallet {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected Transaction sendMoneyToWallet(Transaction tx, AbstractBlockChain.NewBlockType type) throws IOException, VerificationException {
|
||||
protected Transaction sendMoneyToWallet(Transaction tx, AbstractBlockChain.NewBlockType type) throws VerificationException {
|
||||
return sendMoneyToWallet(this.wallet, tx, type);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected Transaction sendMoneyToWallet(Wallet wallet, Coin value, Address toAddress, AbstractBlockChain.NewBlockType type) throws IOException, VerificationException {
|
||||
protected Transaction sendMoneyToWallet(Wallet wallet, Coin value, Address toAddress, AbstractBlockChain.NewBlockType type) throws VerificationException {
|
||||
return sendMoneyToWallet(wallet, createFakeTx(params, value, toAddress), type);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected Transaction sendMoneyToWallet(Wallet wallet, Coin value, ECKey toPubKey, AbstractBlockChain.NewBlockType type) throws IOException, VerificationException {
|
||||
protected Transaction sendMoneyToWallet(Wallet wallet, Coin value, ECKey toPubKey, AbstractBlockChain.NewBlockType type) throws VerificationException {
|
||||
return sendMoneyToWallet(wallet, createFakeTx(params, value, toPubKey), type);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected Transaction sendMoneyToWallet(Coin value, AbstractBlockChain.NewBlockType type) throws IOException, VerificationException {
|
||||
protected Transaction sendMoneyToWallet(Coin value, AbstractBlockChain.NewBlockType type) throws VerificationException {
|
||||
return sendMoneyToWallet(this.wallet, createFakeTx(params, value, myAddress), type);
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,6 @@ import org.slf4j.LoggerFactory;
|
||||
import org.spongycastle.crypto.params.KeyParameter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.math.BigInteger;
|
||||
import java.net.InetAddress;
|
||||
import java.security.SecureRandom;
|
||||
@ -368,7 +367,7 @@ public class WalletTest extends TestWithWallet {
|
||||
receiveATransactionAmount(wallet, toAddress, COIN);
|
||||
}
|
||||
|
||||
private void receiveATransactionAmount(Wallet wallet, Address toAddress, Coin amount) throws IOException {
|
||||
private void receiveATransactionAmount(Wallet wallet, Address toAddress, Coin amount) {
|
||||
final ListenableFuture<Coin> availFuture = wallet.getBalanceFuture(amount, Wallet.BalanceType.AVAILABLE);
|
||||
final ListenableFuture<Coin> estimatedFuture = wallet.getBalanceFuture(amount, Wallet.BalanceType.ESTIMATED);
|
||||
assertFalse(availFuture.isDone());
|
||||
@ -1598,7 +1597,7 @@ public class WalletTest extends TestWithWallet {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void importAndEncrypt() throws IOException, InsufficientMoneyException {
|
||||
public void importAndEncrypt() throws InsufficientMoneyException {
|
||||
final ECKey key = new ECKey();
|
||||
encryptedWallet.importKeysAndEncrypt(ImmutableList.of(key), PASSWORD1);
|
||||
assertEquals(1, encryptedWallet.getImportedKeys().size());
|
||||
@ -2988,7 +2987,7 @@ public class WalletTest extends TestWithWallet {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sendCoinsWithBroadcasterTest() throws InsufficientMoneyException, IOException {
|
||||
public void sendCoinsWithBroadcasterTest() throws InsufficientMoneyException {
|
||||
ECKey key = ECKey.fromPrivate(BigInteger.ONE);
|
||||
Address notMyAddr = key.toAddress(params);
|
||||
receiveATransactionAmount(wallet, myAddress, Coin.COIN);
|
||||
|
Loading…
x
Reference in New Issue
Block a user