3838import org .tron .api .GrpcAPI .Return .response_code ;
3939import org .tron .api .GrpcAPI .WitnessList ;
4040import org .tron .common .crypto .ECKey ;
41- import org .tron .common .crypto .Hash ;
4241import org .tron .common .overlay .message .Message ;
4342import org .tron .common .utils .Base58 ;
4443import org .tron .common .utils .ByteArray ;
44+ import org .tron .common .utils .Sha256Hash ;
4545import org .tron .common .utils .Utils ;
4646import org .tron .core .capsule .AccountCapsule ;
4747import org .tron .core .capsule .AssetIssueCapsule ;
@@ -140,8 +140,8 @@ public static boolean addressValid(byte[] address) {
140140 }
141141
142142 public static String encode58Check (byte [] input ) {
143- byte [] hash0 = Hash . sha256 (input );
144- byte [] hash1 = Hash . sha256 (hash0 );
143+ byte [] hash0 = Sha256Hash . of (input ). getBytes ( );
144+ byte [] hash1 = Sha256Hash . of (hash0 ). getBytes ( );
145145 byte [] inputCheck = new byte [input .length + 4 ];
146146 System .arraycopy (input , 0 , inputCheck , 0 , input .length );
147147 System .arraycopy (hash1 , 0 , inputCheck , input .length , 4 );
@@ -155,8 +155,8 @@ private static byte[] decode58Check(String input) {
155155 }
156156 byte [] decodeData = new byte [decodeCheck .length - 4 ];
157157 System .arraycopy (decodeCheck , 0 , decodeData , 0 , decodeData .length );
158- byte [] hash0 = Hash . sha256 (decodeData );
159- byte [] hash1 = Hash . sha256 (hash0 );
158+ byte [] hash0 = Sha256Hash . of (decodeData ). getBytes ( );
159+ byte [] hash1 = Sha256Hash . of (hash0 ). getBytes ( );
160160 if (hash1 [0 ] == decodeCheck [decodeData .length ] &&
161161 hash1 [1 ] == decodeCheck [decodeData .length + 1 ] &&
162162 hash1 [2 ] == decodeCheck [decodeData .length + 2 ] &&
@@ -439,7 +439,8 @@ public Transaction getTransactionById(ByteString transactionId) {
439439 try {
440440 transactionCapsule = dbManager .getTransactionStore ()
441441 .get (transactionId .toByteArray ());
442- } catch (BadItemException e ) {}
442+ } catch (BadItemException e ) {
443+ }
443444 if (transactionCapsule != null ) {
444445 return transactionCapsule .getInstance ();
445446 }
0 commit comments