private static Protos.UnspentOutput makeUTXOProto(OutPointOutput utxo) { Protos.UnspentOutput.Builder utxoBuilder = Protos.UnspentOutput.newBuilder(); utxoBuilder.setOutPointHash(ByteString.copyFrom(utxo.getTxHash().getBytes())); utxoBuilder.setOutPointIndex((int) utxo.getIndex()); utxoBuilder.setScriptBytes(ByteString.copyFrom(utxo.getScriptBytes())); utxoBuilder.setValue(utxo.getValueLong()); if (utxo.isGenerated()) utxoBuilder.setIsGenerated(true); return utxoBuilder.build(); }
public Builder mergeFrom(com.openwallet.core.protos.Protos.UnspentOutput other) { if (other == com.openwallet.core.protos.Protos.UnspentOutput.getDefaultInstance()) return this; if (other.hasOutPointHash()) { setOutPointHash(other.getOutPointHash()); } if (other.hasOutPointIndex()) { setOutPointIndex(other.getOutPointIndex()); } if (other.hasScriptBytes()) { setScriptBytes(other.getScriptBytes()); } if (other.hasValue()) { setValue(other.getValue()); } if (other.hasIsGenerated()) { setIsGenerated(other.getIsGenerated()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }