File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 11package org .tron .common .utils ;
22
33import com .fasterxml .jackson .databind .ObjectMapper ;
4+ import java .math .BigInteger ;
45import org .apache .commons .lang3 .StringUtils ;
56import org .spongycastle .util .encoders .Hex ;
67import org .tron .common .crypto .Hash ;
@@ -125,9 +126,9 @@ static class CoderNumber extends Coder {
125126
126127 @ Override
127128 byte [] encode (String value ) {
128- long n = Long . valueOf (value );
129- DataWord word = new DataWord (Math .abs (n ));
130- if (n < 0 ) {
129+ BigInteger bigInteger = new BigInteger (value );
130+ DataWord word = new DataWord (bigInteger .abs (). toByteArray ( ));
131+ if (bigInteger . compareTo ( new BigInteger ( "0" )) == - 1 ) {
131132 word .negate ();
132133 }
133134 return word .getData ();
Original file line number Diff line number Diff line change @@ -2094,7 +2094,7 @@ private void deployContract(String[] parameter)
20942094 if (isHex ) {
20952095 codeStr += argsStr ;
20962096 } else {
2097- codeStr += Hex . toHexString ( AbiUtil .encodeInput (constructorStr , argsStr ) );
2097+ codeStr += AbiUtil .parseMethod (constructorStr , argsStr );
20982098 }
20992099 }
21002100 long value = 0 ;
@@ -3498,7 +3498,7 @@ public static String[] getCmd(String cmdLine) {
34983498 || cmdLine .toLowerCase ().startsWith ("triggercontract" )
34993499 || cmdLine .toLowerCase ().startsWith ("triggerconstantcontract" )
35003500 || cmdLine .toLowerCase ().startsWith ("updateaccountpermission" )) {
3501- return cmdLine .split ("\\ s+" );
3501+ return cmdLine .split (" " , - 1 );
35023502 }
35033503 String [] strArray = cmdLine .split ("\" " );
35043504 int num = strArray .length ;
You can’t perform that action at this time.
0 commit comments