Ejemplo n.º 1
0
 @Override
 void putMyJSON(JSONObject attachment) {
   attachment.put("purchase", Convert.toUnsignedLong(purchaseId));
   attachment.put("goodsData", Convert.toHexString(goods.getData()));
   attachment.put("goodsNonce", Convert.toHexString(goods.getNonce()));
   attachment.put("discountNQT", discountNQT);
   attachment.put("goodsIsText", goodsIsText);
 }
Ejemplo n.º 2
0
 @Override
 void putMyBytes(ByteBuffer buffer) {
   buffer.putLong(purchaseId);
   buffer.putInt(
       goodsIsText ? goods.getData().length | Integer.MIN_VALUE : goods.getData().length);
   buffer.put(goods.getData());
   buffer.put(goods.getNonce());
   buffer.putLong(discountNQT);
 }
Ejemplo n.º 3
0
 DigitalGoodsDelivery(ByteBuffer buffer, byte transactionVersion)
     throws RiseException.NotValidException {
   super(buffer, transactionVersion);
   this.purchaseId = buffer.getLong();
   int length = buffer.getInt();
   goodsIsText = length < 0;
   if (length < 0) {
     length &= Integer.MAX_VALUE;
   }
   this.goods = EncryptedData.readEncryptedData(buffer, length, Constants.MAX_DGS_GOODS_LENGTH);
   this.discountNQT = buffer.getLong();
 }
Ejemplo n.º 4
0
 @Override
 int getMySize() {
   return 8 + 4 + goods.getSize() + 8;
 }