Exemplo n.º 1
0
  // Check
  public void check(CBlockPayload block) throws Exception {
    // Super class
    super.check(block);

    // Check type
    if (!this.tip.equals("ID_TWEET_COMMENT_PACKET"))
      throw new Exception("Invalid packet type - CTweetMesPacket.java");

    // Deserialize transaction data
    CCommentPayload dec_payload = (CCommentPayload) UTILS.SERIAL.deserialize(payload);

    // Check fee
    if (this.fee.amount < 0.0001) throw new Exception("Invalid fee - CTweetMesPacket.java");

    // Check payload
    dec_payload.check(block);

    // Footprint
    CPackets foot = new CPackets(this);

    foot.add("Address", dec_payload.target_adr);
    foot.add("Parent Type", dec_payload.parent_type);
    foot.add("Parent ID", String.valueOf(dec_payload.parentID));
    foot.add("Comment ID", String.valueOf(dec_payload.comID));
    foot.add("Mes", dec_payload.mes);
    foot.write();
  }
  // Check
  public void check(CBlockPayload block) throws Exception {
    // Super class
    super.check(block);

    // Check type
    if (!this.tip.equals("ID_UPDATE_SETTINGS_PACKET"))
      throw new Exception("Invalid packet type - CUpdateSettingsPacket.java");

    // Check
    CUpdateSettingsPayload dec_payload = (CUpdateSettingsPayload) UTILS.SERIAL.deserialize(payload);

    // check
    dec_payload.check(block);

    // Footprint
    CPackets foot = new CPackets(this);

    foot.add("AppID", String.valueOf(dec_payload.appID));
    foot.add("Settings", String.valueOf(dec_payload.settings));
    foot.write();
  }