Search in sources :

Example 1 with PunishLogPo

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);
}
Also used : RedPunishData(io.nuls.consensus.entity.RedPunishData) PunishLogPo(io.nuls.db.entity.PunishLogPo)

Example 2 with PunishLogPo

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);
    }
}
Also used : Address(io.nuls.account.entity.Address) YellowPunishData(io.nuls.consensus.entity.YellowPunishData) PunishLogPo(io.nuls.db.entity.PunishLogPo)

Aggregations

PunishLogPo (io.nuls.db.entity.PunishLogPo)2 Address (io.nuls.account.entity.Address)1 RedPunishData (io.nuls.consensus.entity.RedPunishData)1 YellowPunishData (io.nuls.consensus.entity.YellowPunishData)1