File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/main/java/org/tron/common/utils Expand file tree Collapse file tree 1 file changed +4
-3
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 ();
You can’t perform that action at this time.
0 commit comments