Skip to content

Commit

Permalink
Update node info
Browse files Browse the repository at this point in the history
  • Loading branch information
leej1012 committed May 31, 2024
1 parent 9a9ba54 commit 8968b7a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public class NodeManagementDto {

private String cap = "0";

private String reward = "0";

private String withdrawableAmount;

private String lockedAmount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.springframework.util.StringUtils;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -1065,6 +1066,13 @@ public ResponseBean getNodeOnChainConfig(String address, String publicKey) {
long promisePos = sdk.getPromisePos(publicKey);
nodeManagementDto.setPromiseStake(String.valueOf(promisePos));

String splitFeeStr = sdk.getSplitFee(address);
if (StringUtils.hasLength(splitFeeStr)) {
JSONObject splitFee = JSONObject.parseObject(splitFeeStr);
String reward = splitFee.getBigDecimal("amount").divide(ConstantParam.NINE_BIT_DECIMAL, 9, RoundingMode.DOWN).stripTrailingZeros().toPlainString();
nodeManagementDto.setReward(reward);
}

String attributesStr = sdk.getAttributes(publicKey);
if (StringUtils.hasLength(attributesStr)) {
JSONObject attributes = JSONObject.parseObject(attributesStr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,18 @@ public class ConstantParam {

public static final String OEP8_PUMPKIN_PREFIX = "pumpkin";


public static final BigDecimal ZERO = BigDecimal.ZERO;

public static final BigDecimal NINE_BIT_DECIMAL = new BigDecimal("1000000000");

public static final BigDecimal ONG_SECONDMAKE = new BigDecimal("5");


public static final BigDecimal ONT_TOTAL = new BigDecimal("1000000000");
public static final BigDecimal ONT_TOTAL = NINE_BIT_DECIMAL;

public static final BigDecimal ONG_TOTAL = ONT_TOTAL;
public static final BigDecimal ONG_TOTAL = NINE_BIT_DECIMAL;

public static final BigDecimal NEW_ONT_DECIMAL = ONT_TOTAL;
public static final BigDecimal NEW_ONT_DECIMAL = NINE_BIT_DECIMAL;

public static final BigDecimal NEW_ONG_DECIMAL = new BigDecimal("1000000000000000000");


public static final String GO_TOTALSUPPLY_URL = "/getAssetHolder";


public static final List<String> SPECIALADDRLIST = Arrays.asList(
//团队锁仓地址
"AKac3Bd6usdivrnNN8tyRcDZN94vpaoAu2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,11 @@ public long getPromisePos(String publicKey) {
return 0;
}

public String getSplitFee(String address) throws Exception {
OntSdk ontSdk = getOntSdk();
return ontSdk.nativevm().governance().getSplitFeeAddress(address);
}

public int getPreConsensusCount() {
try {
Configuration preConfiguration = getPreConfiguration();
Expand Down

0 comments on commit 8968b7a

Please sign in to comment.