mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-14 11:15:51 +00:00
Payment channels: ByteString.EMPTY -> null
This commit is contained in:
parent
1153192be8
commit
fe6f5aff01
@ -469,7 +469,7 @@ public class PaymentChannelClient implements IPaymentChannelClient {
|
|||||||
* @return a future that completes when the server acknowledges receipt and acceptance of the payment.
|
* @return a future that completes when the server acknowledges receipt and acceptance of the payment.
|
||||||
*/
|
*/
|
||||||
public ListenableFuture<Coin> incrementPayment(Coin size) throws ValueOutOfRangeException, IllegalStateException {
|
public ListenableFuture<Coin> incrementPayment(Coin size) throws ValueOutOfRangeException, IllegalStateException {
|
||||||
return incrementPayment(size, ByteString.EMPTY);
|
return incrementPayment(size, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -137,7 +137,7 @@ public class PaymentChannelClientConnection {
|
|||||||
* (see {@link PaymentChannelClientConnection#getChannelOpenFuture()} for the second)
|
* (see {@link PaymentChannelClientConnection#getChannelOpenFuture()} for the second)
|
||||||
*/
|
*/
|
||||||
public ListenableFuture<Coin> incrementPayment(Coin size) throws ValueOutOfRangeException, IllegalStateException {
|
public ListenableFuture<Coin> incrementPayment(Coin size) throws ValueOutOfRangeException, IllegalStateException {
|
||||||
return channelClient.incrementPayment(size, ByteString.EMPTY);
|
return channelClient.incrementPayment(size, null);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Increments the total value which we pay the server.
|
* Increments the total value which we pay the server.
|
||||||
|
@ -171,8 +171,8 @@ public class ChannelConnectionTest extends TestWithWallet {
|
|||||||
|
|
||||||
Thread.sleep(1250); // No timeouts once the channel is open
|
Thread.sleep(1250); // No timeouts once the channel is open
|
||||||
Coin amount = client.state().getValueSpent();
|
Coin amount = client.state().getValueSpent();
|
||||||
q.take().assertPair(amount, ByteString.EMPTY);
|
q.take().assertPair(amount, null);
|
||||||
ByteString[] infos = new ByteString[]{ByteString.EMPTY, ByteString.copyFromUtf8("one"),ByteString.copyFromUtf8("two")};
|
ByteString[] infos = new ByteString[]{null, ByteString.copyFromUtf8("one"),ByteString.copyFromUtf8("two")};
|
||||||
for (ByteString info : infos) {
|
for (ByteString info : infos) {
|
||||||
client.incrementPayment(CENT, info).get();
|
client.incrementPayment(CENT, info).get();
|
||||||
amount = amount.add(CENT);
|
amount = amount.add(CENT);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user