Skip to content

Commit 56b8bbc

Browse files
authored
Merge pull request #919 from tronprotocol/release_v4.9.4
Release v4.9.4
2 parents 040c8de + 12b6668 commit 56b8bbc

File tree

9 files changed

+90
-7
lines changed

9 files changed

+90
-7
lines changed

README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ For more information on a specific command, just type the command in the termina
160160
| [UpdateEnergyLimit](#Update-smart-contract-parameters) | [UpdateSetting](#Update-smart-contract-parameters) | [UpdateWitness](#update-witness) |
161161
| [ViewBackupRecords](#View-backup-records) | [ViewTransactionHistory](#View-transaction-history) | [VoteWitness](#How-to-vote) |
162162
| [WithdrawBalance](#withdraw-balance) | [WithdrawExpireUnfreeze](#withdraw-expire-unfreeze) | [TronlinkMultiSign](#tronlink-multi-sign) |
163-
| [EncodingConverter](#encoding-converter) | [GetPrivateKeyByMnemonic](#How-to-get-privateKey-through-mnemonic) | |
163+
| [EncodingConverter](#encoding-converter) | [GetPrivateKeyByMnemonic](#How-to-get-privateKey-through-mnemonic) | [GetPaginatedNowWitnessList](#Get-paginated-now-witness-list) |
164164

165165

166166
Type any one of the listed commands, to display how-to tips.
@@ -2689,4 +2689,37 @@ Example:
26892689
wallet> GetPrivateKeyByMnemonic
26902690

26912691
Please enter 12 or 24 words (separated by spaces) [Attempt 1/3]:
2692+
```
2693+
### Get paginated now witness list
2694+
> GetPaginatedNowWitnessList
2695+
2696+
Get paginated now witness list.
2697+
2698+
Example:
2699+
```console
2700+
wallet> getPaginatedNowWitnessList 0 2
2701+
{
2702+
"witnesses": [
2703+
{
2704+
"address": "TJmka325yjJKeFpQDwKSQAoNwEyNGhsaEV",
2705+
"voteCount": 5405926918,
2706+
"url": "http://sr-8.com",
2707+
"totalProduced": 1801675,
2708+
"totalMissed": 456,
2709+
"latestBlockNum": 64577529,
2710+
"latestSlotNum": 590063589,
2711+
"isJobs": true
2712+
},
2713+
{
2714+
"address": "TFFLWM7tmKiwGtbh2mcz2rBssoFjHjSShG",
2715+
"voteCount": 2322244615,
2716+
"url": "http://sr-27.com",
2717+
"totalProduced": 1807756,
2718+
"totalMissed": 619,
2719+
"latestBlockNum": 64577530,
2720+
"latestSlotNum": 590063590,
2721+
"isJobs": true
2722+
}
2723+
]
2724+
}
26922725
```

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ repositories {
4343
maven { url 'https://jitpack.io' }
4444
}
4545

46-
def protobufVersion = "3.25.5"
47-
def grpcVersion = "1.60.0"
46+
def protobufVersion = "3.25.8"
47+
def grpcVersion = "1.75.0"
4848

4949
sourceSets {
5050
main {
@@ -97,7 +97,7 @@ dependencies {
9797
implementation group: 'org.hid4java', name: 'hid4java', version: '0.8.0'
9898
//implementation 'javax.annotation:javax.annotation-api:1.3.2'
9999
implementation("com.squareup.okhttp3:okhttp:4.12.0")
100-
implementation("io.github.tronprotocol:trident:0.10.0") {
100+
implementation("io.github.tronprotocol:trident:0.11.0") {
101101
exclude group: "com.google.guava", module: "guava"
102102
}
103103
implementation 'javax.annotation:javax.annotation-api:1.3.2'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public class Utils {
134134

135135
public static final int MIN_LENGTH = 2;
136136
public static final int MAX_LENGTH = 14;
137-
public static final String VERSION = " v4.9.3";
137+
public static final String VERSION = " v4.9.4";
138138
public static final String TRANSFER_METHOD_ID = "a9059cbb";
139139

140140
private static SecureRandom random = new SecureRandom();

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ public class Client {
193193
"GetMarketPriceByPair",
194194
"GetMemoFee",
195195
"GetNextMaintenanceTime",
196+
"GetPaginatedNowWitnessList",
196197
"GetPrivateKeyByMnemonic",
197198
"GetProposal",
198199
"GetReward",
@@ -4217,6 +4218,10 @@ private void run() {
42174218
getPrivateKeyByMnemonic();
42184219
break;
42194220
}
4221+
case "getpaginatednowwitnesslist": {
4222+
getPaginatedNowWitnessList(parameters);
4223+
break;
4224+
}
42204225
default: {
42214226
System.out.println("Invalid cmd: " + cmd);
42224227
help(new String[]{});
@@ -4241,6 +4246,22 @@ private void run() {
42414246
}
42424247
}
42434248

4249+
private void getPaginatedNowWitnessList(String[] parameters) {
4250+
if (ArrayUtils.isEmpty(parameters) || parameters.length != 2) {
4251+
System.out.println("getPaginatedNowWitnessList needs 2 parameters using the following syntax: ");
4252+
System.out.println("getPaginatedNowWitnessList offset limit ");
4253+
return;
4254+
}
4255+
int offset = Integer.parseInt(parameters[0]);
4256+
int limit = Integer.parseInt(parameters[1]);
4257+
Response.WitnessList witnessList = walletApiWrapper.getPaginatedNowWitnessList(offset, limit);
4258+
if (witnessList != null) {
4259+
System.out.println(Utils.formatMessageString(witnessList));
4260+
} else {
4261+
System.out.println("getPaginatedNowWitnessList " + failedHighlight() + " !!!");
4262+
}
4263+
}
4264+
42444265
private void getPrivateKeyByMnemonic() {
42454266
List<String> mnemonicWords = inputMnemonicWords();
42464267
byte[] privateKeyFromMnemonic = getPrivateKeyFromMnemonic(mnemonicWords);

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1955,4 +1955,13 @@ public void tronlinkMultiSign() {
19551955
public void encodingConverter() {
19561956
EncodingConverter.runCLI();
19571957
}
1958+
1959+
public Response.WitnessList getPaginatedNowWitnessList(int offset, int limit) {
1960+
try {
1961+
return WalletApi.getPaginatedNowWitnessList(offset, limit);
1962+
} catch (Exception ex) {
1963+
ex.printStackTrace();
1964+
return null;
1965+
}
1966+
}
19581967
}

src/main/java/org/tron/walletserver/ApiClient.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,4 +599,13 @@ public Response.TransactionExtention triggerContract(byte[] owner, byte[] contra
599599
public Response.TransactionExtention deployContract(String contractName, String abi, String code, List<Type<?>> constructorParams, long feeLimit, long consumeUserResourcePercent, long originEnergyLimit, long value, String tokenId, long tokenValue) throws Exception {// pass
600600
return client.deployContract(contractName, abi, code, constructorParams, feeLimit, consumeUserResourcePercent, originEnergyLimit, value, tokenId, tokenValue);
601601
}
602+
603+
public Response.WitnessList getPaginatedNowWitnessList(int offset, int limit) {
604+
if (!emptySolidityNode) {
605+
return client.getPaginatedNowWitnessList(offset, limit, SOLIDITY_NODE);
606+
} else {
607+
return client.getPaginatedNowWitnessList(offset, limit, FULL_NODE);
608+
}
609+
}
610+
602611
}

src/main/java/org/tron/walletserver/WalletApi.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3422,4 +3422,8 @@ public boolean modifyWalletName(String newName) throws IOException {
34223422
public void tronlinkMultiSign() {
34233423
multiSignService.runCLI(encode58Check(getAddress()), this);
34243424
}
3425+
3426+
public static Response.WitnessList getPaginatedNowWitnessList(int offset, int limit) {
3427+
return apiCli.getPaginatedNowWitnessList(offset, limit);
3428+
}
34253429
}

src/main/resources/commands.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,4 +846,10 @@ GetPrivateKeyByMnemonic
846846
Summary:
847847
Get the private key through mnemonics.
848848
Usage example:
849-
wallet> GetPrivateKeyByMnemonic
849+
wallet> GetPrivateKeyByMnemonic
850+
Syntax:
851+
GetPaginatedNowWitnessList offset limit
852+
Summary:
853+
Get witnesses voting information in pages.
854+
Usage example:
855+
wallet> GetPaginatedNowWitnessList 0 10

src/main/resources/help_summary.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,15 @@
8484
| ListProposals | Display all proposals |
8585
| ListProposalsPaginated | Display all proposals through pagination |
8686
|---------------------------------------------------+-------------------------------------------------------------------------+
87-
| WITNESS (6) | |
87+
| WITNESS (7) | |
8888
+---------------------------------------------------+-------------------------------------------------------------------------+
8989
| CreateWitness | Apply to become a super representative candidate |
9090
| UpdateWitness | Edit the URL of the SR's official website |
9191
| ListWitnesses | Show all witnesses |
9292
| VoteWitness | Vote for witnesses |
9393
| GetBrokerage | Get the brokerage ratio of a super representative |
9494
| UpdateBrokerage | Update SR's brokerage ratio |
95+
| GetPaginatedNowWitnessList | Get witnesses voting information in pages |
9596
+---------------------------------------------------+-------------------------------------------------------------------------+
9697
| TRC10 (24) | |
9798
+---------------------------------------------------+-------------------------------------------------------------------------+

0 commit comments

Comments
 (0)