Skip to content

Commit

Permalink
Update TransferTransactionPush
Browse files Browse the repository at this point in the history
  • Loading branch information
leej1012 committed Dec 30, 2024
1 parent 36fd9fa commit 5ff6f3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private void handleWithdrawTransferTx(TxDetail txDetail, PushUserAddressInfoDto
if (dto.getStrategy() == PushStrategyEnum.DepositPush.value()) {
return;
}
PushEmailDto pushEmailDto = new PushEmailDto();
PushEmailDto pushEmailDto;
if (ConstantParam.ASSET_NAME_ONT.equals(txDetail.getAssetName())
|| ConstantParam.ASSET_NAME_ONG.equals(txDetail.getAssetName())) {
pushEmailDto = PushEmailDto.buildDto(dto, txDetail, PushEmailDto.WITHDRAW);
Expand All @@ -113,7 +113,7 @@ private void handleDepositTransferTx(TxDetail txDetail, PushUserAddressInfoDto d
if (dto.getStrategy() == PushStrategyEnum.WithdrawPush.value()) {
return;
}
PushEmailDto pushEmailDto = new PushEmailDto();
PushEmailDto pushEmailDto;
if (ConstantParam.ASSET_NAME_ONT.equals(txDetail.getAssetName())
|| ConstantParam.ASSET_NAME_ONG.equals(txDetail.getAssetName())) {
pushEmailDto = PushEmailDto.buildDto(dto, txDetail, PushEmailDto.DEPOSIT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import com.github.ontio.model.dao.TxDetail;
import com.github.ontio.utils.ConstantParam;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand Down Expand Up @@ -54,12 +53,8 @@ public static PushEmailDto buildDto(PushUserAddressInfoDto pushUserAddressInfoDt
.time(txDetail.getTxTime())
.assetName(txDetail.getAssetName())
.fromAddress(txDetail.getFromAddress())
.toAddress(txDetail.getToAddress());
if (ConstantParam.ASSET_NAME_ONG.equals(txDetail.getAssetName())) {
builder.amount(txDetail.getAmount().divide(ConstantParam.ONG_DECIMAL).stripTrailingZeros().toPlainString());
} else {
builder.amount(txDetail.getAmount().stripTrailingZeros().toPlainString());
}
.toAddress(txDetail.getToAddress())
.amount(txDetail.getAmount().stripTrailingZeros().toPlainString());
if (DEPOSIT.equals(txDes)) {
return builder.userAddress(txDetail.getToAddress())
.txDes(DEPOSIT)
Expand Down

0 comments on commit 5ff6f3b

Please sign in to comment.