use of io.nuls.db.entity.PunishLogPo in project nuls by nuls-io.
the class RedPunishTxService method onCommit.
@Override
public void onCommit(RedPunishTransaction tx) throws NulsException {
RedPunishData data = tx.getTxData();
PunishLogPo po = new PunishLogPo();
po.setAddress(data.getAddress());
po.setHeight(data.getHeight());
po.setId(StringUtils.getNewUUID());
po.setTime(tx.getTime());
po.setType(PunishType.RED.getCode());
punishLogDataService.save(po);
}
use of io.nuls.db.entity.PunishLogPo in project nuls by nuls-io.
the class YellowPunishTxService method onCommit.
@Override
public void onCommit(YellowPunishTransaction tx) throws NulsException {
YellowPunishData data = tx.getTxData();
for (Address address : data.getAddressList()) {
PunishLogPo po = new PunishLogPo();
po.setAddress(address.getBase58());
po.setHeight(data.getHeight());
po.setId(StringUtils.getNewUUID());
po.setTime(tx.getTime());
po.setType(PunishType.YELLOW.getCode());
punishLogDataService.save(po);
}
}
Aggregations