3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 23:03:04 +00:00

Optimize imports in payment channels.

This commit is contained in:
Mike Hearn 2013-07-03 15:18:20 +02:00
parent 715e3596d2
commit 4265e9c692
3 changed files with 16 additions and 37 deletions

View File

@ -16,15 +16,6 @@
package com.google.bitcoin.protocols.channels;
import java.io.File;
import java.math.BigInteger;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import javax.annotation.Nullable;
import com.google.bitcoin.core.*;
import com.google.bitcoin.utils.Locks;
import com.google.common.util.concurrent.ListenableFuture;
@ -35,6 +26,15 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import javax.annotation.Nullable;
import java.io.File;
import java.math.BigInteger;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import static com.google.bitcoin.protocols.channels.PaymentChannelCloseException.CloseReason;
import static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType;
import static org.junit.Assert.*;
@ -46,22 +46,6 @@ public class ChannelConnectionTest extends TestWithWallet {
private TransactionBroadcaster mockBroadcaster;
private Semaphore broadcastTxPause;
private interface PaymentChannelClientReceiver {
void receiveMessage(Protos.TwoWayChannelMessage msg);
void connectionOpen();
void connectionClosed();
void close();
}
private class PaymentChannelClientReceiverImpl implements PaymentChannelClientReceiver {
private PaymentChannelClient client;
public PaymentChannelClientReceiverImpl(PaymentChannelClient client) { this.client = client; }
public void receiveMessage(Protos.TwoWayChannelMessage msg) { client.receiveMessage(msg); }
public void connectionOpen() { client.connectionOpen(); }
public void connectionClosed() { client.connectionClosed(); }
public void close() { client.close(); }
}
private PaymentChannelClientReceiver sendClient;
@Before
public void setUp() throws Exception {
super.setUp();

View File

@ -11,7 +11,6 @@ import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
/**
* Various mock objects and utilities for testing payment channels code.

View File

@ -16,28 +16,24 @@
package com.google.bitcoin.protocols.channels;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.LinkedBlockingQueue;
import com.google.bitcoin.core.*;
import com.google.bitcoin.script.Script;
import com.google.bitcoin.script.ScriptBuilder;
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
import org.easymock.Capture;
import org.easymock.IMocksControl;
import org.junit.Before;
import org.junit.Test;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Iterator;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.LinkedBlockingQueue;
import static com.google.bitcoin.core.TestUtils.createFakeTx;
import static com.google.bitcoin.core.TestUtils.makeSolvedTestBlock;
import static org.easymock.EasyMock.*;
import static org.junit.Assert.*;
public class PaymentChannelStateTest extends TestWithWallet {