Skip to content

Commit cd16836

Browse files
authored
Merge pull request #422 from tronprotocol/develop
release 4.2
2 parents 9514616 + 4c7b699 commit cd16836

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

src/main/java/org/tron/common/utils/Utils.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public static String printTransactionInfoList(TransactionInfoList transactionInf
165165
List<TransactionInfo> infoList = transactionInfoList.getTransactionInfoList();
166166
infoList.stream()
167167
.forEach(
168-
transactionInfo -> jsonArray.add(formatMessageString(transactionInfo))
168+
transactionInfo -> jsonArray.add(printTransactionInfoToJSON(transactionInfo))
169169
);
170170
return JsonFormatUtil.formatJson(jsonArray.toJSONString());
171171
}
@@ -610,6 +610,10 @@ public static JSONObject printTransactionToJSON(Transaction transaction, boolean
610610
return jsonTransaction;
611611
}
612612

613+
public static JSONObject printTransactionInfoToJSON(TransactionInfo transactioninfo) {
614+
return JSONObject.parseObject(JsonFormat.printToString(transactioninfo, true));
615+
}
616+
613617
public static boolean confirmEncrption() {
614618
System.out.println(
615619
"Please confirm encryption module,if input y or Y means default Eckey, other means SM2.");

src/main/java/org/tron/walletcli/Client.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@ private void freezeBalance(String[] parameters)
12041204
|| parameters.length == 4 || parameters.length == 5)) {
12051205
System.out.println("Use freezeBalance command with below syntax: ");
12061206
System.out.println("freezeBalance [OwnerAddress] frozen_balance frozen_duration "
1207-
+ "[ResourceCode:0 BANDWIDTH,1 ENERGY] [receiverAddress]");
1207+
+ "[ResourceCode:0 BANDWIDTH,1 ENERGY,2 TRON_POWER] [receiverAddress]");
12081208
return;
12091209
}
12101210

@@ -1247,7 +1247,7 @@ private void unfreezeBalance(String[] parameters)
12471247
if (parameters == null || parameters.length < 1 || parameters.length > 3) {
12481248
System.out.println("Use unfreezeBalance command with below syntax: ");
12491249
System.out.println(
1250-
"unfreezeBalance [OwnerAddress] ResourceCode(0 BANDWIDTH,1 CPU) [receiverAddress]");
1250+
"unfreezeBalance [OwnerAddress] ResourceCode(0 BANDWIDTH,1 ENERGY,2 TRON_POWER) [receiverAddress]");
12511251
return;
12521252
}
12531253

@@ -2028,7 +2028,6 @@ private void getBrokerage(String[] parameters) {
20282028

20292029
private void getTransactionInfoByBlockNum(String[] parameters) {
20302030
if (parameters.length != 1) {
2031-
System.out.println("Too many parameters !!!");
20322031
System.out.println("You need input number with the following syntax:");
20332032
System.out.println("GetTransactionInfoByBlockNum number");
20342033
return;
@@ -3344,7 +3343,7 @@ private void resetShieldedTRC20Note() {
33443343
private void scanShieldedTRC20NoteByIvk(String[] parameters) {
33453344
if (parameters == null || parameters.length < 6) {
33463345
System.out.println("ScanShieldedTRC20NoteByIvk command needs at least 6 parameters like: ");
3347-
System.out.println("ScanShieldedTRC20NoteByIvk shieldedTRC20ContractAddress ivk ak nk " +
3346+
System.out.println("ScanShieldedTRC20NoteByIvk shieldedContractAddress ivk ak nk " +
33483347
"startNum endNum [event1] [event2]");
33493348
return;
33503349
}
@@ -4251,6 +4250,7 @@ private void run() {
42514250
}
42524251
case "gettransactioninfobyblocknum": {
42534252
getTransactionInfoByBlockNum(parameters);
4253+
break;
42544254
}
42554255
case "marketsellasset": {
42564256
marketSellAsset(parameters);

src/main/protos/api/api.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,9 @@ message AccountResourceMessage {
11351135
map<string, int64> assetNetLimit = 6;
11361136
int64 TotalNetLimit = 7;
11371137
int64 TotalNetWeight = 8;
1138+
int64 TotalTronPowerWeight = 9;
1139+
int64 tronPowerUsed = 10;
1140+
int64 tronPowerLimit = 11;
11381141

11391142
int64 EnergyUsed = 13;
11401143
int64 EnergyLimit = 14;

src/main/protos/core/Tron.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ message Account {
9797
//Freeze and provide balances to other accounts
9898
int64 delegated_frozen_balance_for_bandwidth = 42;
9999

100+
int64 old_tron_power = 46;
101+
Frozen tron_power = 47;
102+
100103
// this account create time
101104
int64 create_time = 0x09;
102105
// this last operation time, including transfer, voting and so on. //FIXME fix grammar

src/main/protos/core/contract/common.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ option go_package = "github.com/tronprotocol/grpc-gateway/core";
99
enum ResourceCode {
1010
BANDWIDTH = 0x00;
1111
ENERGY = 0x01;
12+
TRON_POWER = 0x02;
1213
}

0 commit comments

Comments
 (0)