@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); }
@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); }