4949import com .google .common .collect .Range ;
5050import com .google .protobuf .ByteString ;
5151import com .google .protobuf .InvalidProtocolBufferException ;
52- import com .google .protobuf .ProtocolStringList ;
5352import java .math .BigInteger ;
5453import java .security .SignatureException ;
5554import java .util .ArrayList ;
163162import org .tron .core .capsule .TransactionCapsule ;
164163import org .tron .core .capsule .TransactionInfoCapsule ;
165164import org .tron .core .capsule .TransactionResultCapsule ;
166- import org .tron .core .capsule .TransactionRetCapsule ;
167165import org .tron .core .capsule .VotesCapsule ;
168166import org .tron .core .capsule .WitnessCapsule ;
169167import org .tron .core .capsule .utils .MarketUtils ;
@@ -780,7 +778,7 @@ public WitnessList getPaginatedNowWitnessList(long offset, long limit) throws
780778 if (limit > WITNESS_COUNT_LIMIT_MAX ) {
781779 limit = WITNESS_COUNT_LIMIT_MAX ;
782780 }
783-
781+
784782 /*
785783 In the maintenance period, the VoteStores will be cleared.
786784 To avoid the race condition of VoteStores deleted but Witness vote counts not updated,
@@ -1502,8 +1500,8 @@ public Protocol.ChainParameters getChainParameters() {
15021500 builder .addChainParameter (Protocol .ChainParameters .ChainParameter .newBuilder ()
15031501 .setKey ("getAllowTvmSelfdestructRestriction" )
15041502 .setValue (dbManager .getDynamicPropertiesStore ().getAllowTvmSelfdestructRestriction ())
1505- .build ());
1506-
1503+ .build ());
1504+
15071505 builder .addChainParameter (Protocol .ChainParameters .ChainParameter .newBuilder ()
15081506 .setKey ("getProposalExpireTime" )
15091507 .setValue (dbManager .getDynamicPropertiesStore ().getProposalExpireTime ())
@@ -3852,8 +3850,8 @@ public ShieldedTRC20Parameters createShieldedContractParametersWithoutAsk(
38523850 return builder .build (false );
38533851 }
38543852
3855- private int getShieldedTRC20LogType (TransactionInfo .Log log , byte [] contractAddress ,
3856- ProtocolStringList topicsList ) throws ZksnarkException {
3853+ private int getShieldedTRC20LogType (TransactionInfo .Log log , byte [] contractAddress )
3854+ throws ZksnarkException {
38573855 byte [] logAddress = log .getAddress ().toByteArray ();
38583856 byte [] addressWithoutPrefix = new byte [20 ];
38593857 if (ArrayUtils .isEmpty (contractAddress ) || contractAddress .length != 21 ) {
@@ -3866,33 +3864,14 @@ private int getShieldedTRC20LogType(TransactionInfo.Log log, byte[] contractAddr
38663864 for (ByteString bs : logTopicsList ) {
38673865 topicsBytes = ByteUtil .merge (topicsBytes , bs .toByteArray ());
38683866 }
3869- if (Objects .isNull (topicsList ) || topicsList .isEmpty ()) {
3870- if (Arrays .equals (topicsBytes , SHIELDED_TRC20_LOG_TOPICS_MINT )) {
3871- return 1 ;
3872- } else if (Arrays .equals (topicsBytes , SHIELDED_TRC20_LOG_TOPICS_TRANSFER )) {
3873- return 2 ;
3874- } else if (Arrays .equals (topicsBytes , SHIELDED_TRC20_LOG_TOPICS_BURN_LEAF )) {
3875- return 3 ;
3876- } else if (Arrays .equals (topicsBytes , SHIELDED_TRC20_LOG_TOPICS_BURN_TOKEN )) {
3877- return 4 ;
3878- }
3879- } else {
3880- for (String topic : topicsList ) {
3881- byte [] topicHash = Hash .sha3 (ByteArray .fromString (topic ));
3882- if (Arrays .equals (topicsBytes , topicHash )) {
3883- if (topic .toLowerCase ().contains ("mint" )) {
3884- return 1 ;
3885- } else if (topic .toLowerCase ().contains ("transfer" )) {
3886- return 2 ;
3887- } else if (topic .toLowerCase ().contains ("burn" )) {
3888- if (topic .toLowerCase ().contains ("leaf" )) {
3889- return 3 ;
3890- } else if (topic .toLowerCase ().contains ("token" )) {
3891- return 4 ;
3892- }
3893- }
3894- }
3895- }
3867+ if (Arrays .equals (topicsBytes , SHIELDED_TRC20_LOG_TOPICS_MINT )) {
3868+ return 1 ;
3869+ } else if (Arrays .equals (topicsBytes , SHIELDED_TRC20_LOG_TOPICS_TRANSFER )) {
3870+ return 2 ;
3871+ } else if (Arrays .equals (topicsBytes , SHIELDED_TRC20_LOG_TOPICS_BURN_LEAF )) {
3872+ return 3 ;
3873+ } else if (Arrays .equals (topicsBytes , SHIELDED_TRC20_LOG_TOPICS_BURN_TOKEN )) {
3874+ return 4 ;
38963875 }
38973876 }
38983877 return 0 ;
@@ -3942,8 +3921,7 @@ private Optional<DecryptNotesTRC20.NoteTx> getNoteTxFromLogListByIvk(
39423921 }
39433922
39443923 private DecryptNotesTRC20 queryTRC20NoteByIvk (long startNum , long endNum ,
3945- byte [] shieldedTRC20ContractAddress , byte [] ivk , byte [] ak , byte [] nk ,
3946- ProtocolStringList topicsList )
3924+ byte [] shieldedTRC20ContractAddress , byte [] ivk , byte [] ak , byte [] nk )
39473925 throws BadItemException , ZksnarkException , ContractExeException {
39483926 if (!(startNum >= 0 && endNum > startNum && endNum - startNum <= 1000 )) {
39493927 throw new BadItemException (
@@ -3964,7 +3942,7 @@ private DecryptNotesTRC20 queryTRC20NoteByIvk(long startNum, long endNum,
39643942 Optional <DecryptNotesTRC20 .NoteTx > noteTx ;
39653943 int index = 0 ;
39663944 for (TransactionInfo .Log log : logList ) {
3967- int logType = getShieldedTRC20LogType (log , shieldedTRC20ContractAddress , topicsList );
3945+ int logType = getShieldedTRC20LogType (log , shieldedTRC20ContractAddress );
39683946 if (logType > 0 ) {
39693947 noteBuilder = DecryptNotesTRC20 .NoteTx .newBuilder ();
39703948 noteBuilder .setTxid (ByteString .copyFrom (txId ));
@@ -4048,12 +4026,11 @@ private boolean isShieldedTRC20NoteSpent(GrpcAPI.Note note, long pos, byte[] ak,
40484026
40494027 public DecryptNotesTRC20 scanShieldedTRC20NotesByIvk (
40504028 long startNum , long endNum , byte [] shieldedTRC20ContractAddress ,
4051- byte [] ivk , byte [] ak , byte [] nk , ProtocolStringList topicsList )
4029+ byte [] ivk , byte [] ak , byte [] nk )
40524030 throws BadItemException , ZksnarkException , ContractExeException {
40534031 checkAllowShieldedTransactionApi ();
40544032
4055- return queryTRC20NoteByIvk (startNum , endNum ,
4056- shieldedTRC20ContractAddress , ivk , ak , nk , topicsList );
4033+ return queryTRC20NoteByIvk (startNum , endNum , shieldedTRC20ContractAddress , ivk , ak , nk );
40574034 }
40584035
40594036 private Optional <DecryptNotesTRC20 .NoteTx > getNoteTxFromLogListByOvk (
@@ -4127,7 +4104,7 @@ private Optional<DecryptNotesTRC20.NoteTx> getNoteTxFromLogListByOvk(
41274104 }
41284105
41294106 public DecryptNotesTRC20 scanShieldedTRC20NotesByOvk (long startNum , long endNum ,
4130- byte [] ovk , byte [] shieldedTRC20ContractAddress , ProtocolStringList topicsList )
4107+ byte [] ovk , byte [] shieldedTRC20ContractAddress )
41314108 throws ZksnarkException , BadItemException {
41324109 checkAllowShieldedTransactionApi ();
41334110
@@ -4149,7 +4126,7 @@ public DecryptNotesTRC20 scanShieldedTRC20NotesByOvk(long startNum, long endNum,
41494126 Optional <DecryptNotesTRC20 .NoteTx > noteTx ;
41504127 int index = 0 ;
41514128 for (TransactionInfo .Log log : logList ) {
4152- int logType = getShieldedTRC20LogType (log , shieldedTRC20ContractAddress , topicsList );
4129+ int logType = getShieldedTRC20LogType (log , shieldedTRC20ContractAddress );
41534130 if (logType > 0 ) {
41544131 noteBuilder = DecryptNotesTRC20 .NoteTx .newBuilder ();
41554132 noteBuilder .setTxid (ByteString .copyFrom (txid ));
0 commit comments