diff --git a/core/src/main/java/org/bitcoinj/testing/TestWithWallet.java b/core/src/main/java/org/bitcoinj/testing/TestWithWallet.java index a373278c..9dbb516f 100644 --- a/core/src/main/java/org/bitcoinj/testing/TestWithWallet.java +++ b/core/src/main/java/org/bitcoinj/testing/TestWithWallet.java @@ -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); } } diff --git a/core/src/test/java/org/bitcoinj/core/WalletTest.java b/core/src/test/java/org/bitcoinj/core/WalletTest.java index 9b4ddf77..2c96a7f4 100644 --- a/core/src/test/java/org/bitcoinj/core/WalletTest.java +++ b/core/src/test/java/org/bitcoinj/core/WalletTest.java @@ -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 availFuture = wallet.getBalanceFuture(amount, Wallet.BalanceType.AVAILABLE); final ListenableFuture 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);