/** * Returns true if and only if this instance represents a monetary value greater than zero, * otherwise false. */ public boolean isPositive() { return signum() == 1; }
/** * Returns true if and only if this instance represents a monetary value greater than zero, * otherwise false. */ public boolean isPositive() { return signum() == 1; }
/** * Returns true if and only if this instance represents a monetary value less than zero, * otherwise false. */ public boolean isNegative() { return signum() == -1; }
/** * Returns true if and only if this instance represents zero monetary value, * otherwise false. */ public boolean isZero() { return signum() == 0; }
/** * Returns true if and only if this instance represents a monetary value greater than zero, * otherwise false. */ public boolean isPositive() { return signum() == 1; }
/** * Returns true if and only if this instance represents zero monetary value, * otherwise false. */ public boolean isZero() { return signum() == 0; }
/** * Returns true if and only if this instance represents a monetary value greater than zero, * otherwise false. */ public boolean isPositive() { return signum() == 1; }
/** * Returns true if and only if this instance represents a monetary value less than zero, * otherwise false. */ public boolean isNegative() { return signum() == -1; }
/** * Returns true if and only if this instance represents a monetary value less than zero, * otherwise false. */ public boolean isNegative() { return signum() == -1; }
/** * Returns true if and only if this instance represents zero monetary value, * otherwise false. */ public boolean isZero() { return signum() == 0; }
/** * Returns true if and only if this instance represents a monetary value less than zero, * otherwise false. */ public boolean isNegative() { return signum() == -1; }
/** * Returns true if and only if this instance represents zero monetary value, * otherwise false. */ public boolean isZero() { return signum() == 0; }
public PaymentChannelV2ClientState(Wallet wallet, ECKey myKey, ECKey serverMultisigKey, Coin value, long expiryTimeInSeconds) throws VerificationException { super(wallet, myKey, serverMultisigKey, value, expiryTimeInSeconds); checkArgument(value.signum() > 0); initWalletListeners(); this.valueToMe = this.totalValue = checkNotNull(value); this.expiryTime = expiryTimeInSeconds; stateMachine.transition(State.NEW); }
public PaymentChannelV2ClientState(Wallet wallet, ECKey myKey, ECKey serverMultisigKey, Coin value, long expiryTimeInSeconds) throws VerificationException { super(wallet, myKey, serverMultisigKey, value, expiryTimeInSeconds); checkArgument(value.signum() > 0); initWalletListeners(); this.valueToMe = this.totalValue = checkNotNull(value); this.expiryTime = expiryTimeInSeconds; stateMachine.transition(State.NEW); }
public PaymentChannelV2ClientState(Wallet wallet, ECKey myKey, ECKey serverMultisigKey, Coin value, long expiryTimeInSeconds) throws VerificationException { super(wallet, myKey, serverMultisigKey, value, expiryTimeInSeconds); checkArgument(value.signum() > 0); initWalletListeners(); this.valueToMe = this.totalValue = checkNotNull(value); this.expiryTime = expiryTimeInSeconds; stateMachine.transition(State.NEW); }
public PaymentChannelV2ClientState(Wallet wallet, ECKey myKey, ECKey serverMultisigKey, Coin value, long expiryTimeInSeconds) throws VerificationException { super(wallet, myKey, serverMultisigKey, value, expiryTimeInSeconds); checkArgument(value.signum() > 0); initWalletListeners(); this.valueToMe = this.totalValue = checkNotNull(value); this.expiryTime = expiryTimeInSeconds; stateMachine.transition(State.NEW); }
public TransactionOutput(NetworkParameters params, @Nullable Transaction parent, Coin value, byte[] scriptBytes) { super(params); // Negative values obviously make no sense, except for -1 which is used as a sentinel value when calculating // SIGHASH_SINGLE signatures, so unfortunately we have to allow that here. checkArgument(value.signum() >= 0 || value.equals(Coin.NEGATIVE_SATOSHI), "Negative values not allowed"); checkArgument(!params.hasMaxMoney() || value.compareTo(params.getMaxMoney()) <= 0, "Values larger than MAX_MONEY not allowed"); this.value = value.value; this.scriptBytes = scriptBytes; setParent(parent); availableForSpending = true; length = 8 + VarInt.sizeOf(scriptBytes.length) + scriptBytes.length; }
public TransactionOutput(NetworkParameters params, @Nullable Transaction parent, Coin value, byte[] scriptBytes) { super(params); // Negative values obviously make no sense, except for -1 which is used as a sentinel value when calculating // SIGHASH_SINGLE signatures, so unfortunately we have to allow that here. checkArgument(value.signum() >= 0 || value.equals(Coin.NEGATIVE_SATOSHI), "Negative values not allowed"); checkArgument(!params.hasMaxMoney() || value.compareTo(params.getMaxMoney()) <= 0, "Values larger than MAX_MONEY not allowed"); this.value = value.value; this.scriptBytes = scriptBytes; setParent(parent); availableForSpending = true; length = 8 + VarInt.sizeOf(scriptBytes.length) + scriptBytes.length; }
public TransactionOutput(NetworkParameters params, @Nullable Transaction parent, Coin value, byte[] scriptBytes) { super(params); // Negative values obviously make no sense, except for -1 which is used as a sentinel value when calculating // SIGHASH_SINGLE signatures, so unfortunately we have to allow that here. checkArgument(value.signum() >= 0 || value.equals(Coin.NEGATIVE_SATOSHI), "Negative values not allowed"); checkArgument(!params.hasMaxMoney() || value.compareTo(params.getMaxMoney()) <= 0, "Values larger than MAX_MONEY not allowed"); this.value = value.value; this.scriptBytes = scriptBytes; setParent(parent); availableForSpending = true; length = 8 + VarInt.sizeOf(scriptBytes.length) + scriptBytes.length; }
@Test public void receiveCoins() throws Exception { int height = 1; // Quick check that we can actually receive coins. Transaction tx1 = createFakeTx(PARAMS, COIN, wallet.currentReceiveKey().toAddress(PARAMS)); Block b1 = createFakeBlock(blockStore, height, tx1).block; chain.add(b1); assertTrue(wallet.getBalance().signum() > 0); }