Skip to content

Commit 5892a79

Browse files
committed
merge from develop
2 parents 25e5a92 + 571cd61 commit 5892a79

276 files changed

Lines changed: 27914 additions & 1166 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.travis.yml‎

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
sudo: required
2+
dist: trusty
23
language: java
4+
dist: trusty
35
jdk: oraclejdk8
46
addons:
57
ssh_known_hosts:
@@ -18,25 +20,25 @@ cache:
1820
- '$HOME/.sonar/cache'
1921
matrix:
2022
include:
21-
- name: build
22-
script:
23-
- sh tron.sh
24-
- "./gradlew build"
25-
- "./gradlew jacocoTestReport"
23+
- name: build
24+
script:
25+
- sh tron.sh
26+
- "./gradlew build"
27+
- "./gradlew jacocoTestReport"
2628

2729

28-
- name: stest
29-
script:
30-
- sh tron.sh
31-
- bash deploy.sh
30+
- name: stest
31+
script:
32+
- sh tron.sh
33+
- bash deploy.sh
3234

3335

3436
after_success:
35-
- "bash <(curl -s https://codecov.io/bash) -t 060bb400-c6fe-4d5f-a6c8-427105c746ac -s build/reports/jacoco/"
37+
- "bash <(curl -s https://codecov.io/bash) -t 060bb400-c6fe-4d5f-a6c8-427105c746ac -s build/reports/jacoco/"
3638

3739
skip_build:
38-
- README.md:
39-
- LICENSE
40+
- README.md:
41+
- LICENSE
4042

4143

4244

‎build.gradle‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ buildscript {
22
repositories {
33
mavenCentral()
44
jcenter()
5+
maven { url 'https://jitpack.io' }
56
}
67
dependencies {
78
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3'
@@ -23,7 +24,7 @@ apply plugin: 'com.github.johnrengelman.shadow'
2324
apply plugin: "jacoco"
2425
apply plugin: 'maven-publish'
2526

26-
jar.enabled = false
27+
jar.enabled = true
2728
shadowJar.enabled = true
2829

2930
sourceCompatibility = 1.8
@@ -51,6 +52,8 @@ repositories {
5152
mavenLocal()
5253
mavenCentral()
5354
maven { url 'http://repo.spring.io/plugins-release' }
55+
// maven { url 'https://maven.aliyun.com/nexus/content/repositories/central/' }
56+
maven { url 'https://jitpack.io' }
5457
}
5558
def versions = [
5659
checkstyle: '8.7',
@@ -176,12 +179,14 @@ dependencies {
176179
compile 'org.eclipse.jetty:jetty-server:9.4.11.v20180605'
177180
compile 'org.eclipse.jetty:jetty-servlet:9.4.11.v20180605'
178181
compile 'com.alibaba:fastjson:1.2.47'
179-
compile group: 'org.apache.httpcomponents', name:'httpasyncclient', version:'4.1.1'
182+
compile group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.1.1'
180183
// end http
181184

182185
compile "io.vavr:vavr:0.9.2"
183186
compile group: 'org.pf4j', name: 'pf4j', version: '2.5.0'
187+
184188
compile group: 'org.zeromq', name: 'jeromq', version: '0.5.0'
189+
compile 'com.github.tronprotocol:zksnark-java-sdk:master-SNAPSHOT'
185190

186191
}
187192

@@ -283,6 +288,12 @@ test {
283288
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
284289
classDumpDir = file("$buildDir/jacoco/classpathdumps")
285290
}
291+
if (isWindows()) {
292+
exclude '**/ShieldedTransferActuatorTest.class'
293+
exclude '**/BackupDbUtilTest.class'
294+
exclude '**/ManagerTest.class'
295+
exclude 'org/tron/core/zksnark/**'
296+
}
286297
}
287298

288299
task stest(type: Test) {

‎local.properties‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## This file is automatically generated by Android Studio.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must *NOT* be checked into Version Control Systems,
5+
# as it contains information specific to your local configuration.
6+
#
7+
# Location of the SDK. This is only used by Gradle.
8+
# For customization when using a Version Control System, please read the
9+
# header note.
10+
#Tue Jun 11 16:06:10 CST 2019
11+
sdk.dir=/Users/liangzhiyan/Library/Android/sdk

‎querySonar.sh‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
2-
PassFlag=`curl -s 'https://sonarcloud.io/api/project_badges/measure?project=java-tron&metric=alert_status'|grep -A4 "quality gate"|grep "pass"|wc -l`
3-
echo "Please visit https://sonarcloud.io/dashboard?id=java-tron for more details"
4-
if [ $PassFlag -eq 0 ]; then
1+
echo "current branch is : "$BUILDKITE_BRANCH
2+
SonarStatus_Url="https://sonarcloud.io/api/qualitygates/project_status?projectKey=java-tron&branch="$BUILDKITE_BRANCH
3+
Status=`curl -s $SonarStatus_Url | jq '.projectStatus.status'`
4+
echo "current branch sonarcloud status is : "$Status
5+
if [ "$Status" = '"ERROR"' ]; then
56
echo "Sonar Check Failed"
7+
echo "Please visit https://sonarcloud.io/dashboard?branch="$BUILDKITE_BRANCH"&id=java-tron for more details"
68
exit 1
79
else
810
echo "Sonar Check Pass"
911
exit 0
10-
fi
12+
fi

‎sprout-verifying.key‎

1.42 KB
Binary file not shown.

‎src/main/java/org/tron/common/crypto/SymmEncoder.java‎

Lines changed: 0 additions & 66 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* java-tron is free software: you can redistribute it and/or modify
3+
* it under the terms of the GNU General Public License as published by
4+
* the Free Software Foundation, either version 3 of the License, or
5+
* (at your option) any later version.
6+
*
7+
* java-tron is distributed in the hope that it will be useful,
8+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
* GNU General Public License for more details.
11+
*
12+
* You should have received a copy of the GNU General Public License
13+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
14+
*/
15+
16+
package org.tron.common.crypto.zksnark;
17+
18+
import java.math.BigInteger;
19+
import org.tron.common.utils.ByteArray;
20+
import org.tron.common.utils.ByteUtil;
21+
22+
public class ZksnarkUtils {
23+
public static void sort(byte[] bytes) {
24+
int len = bytes.length / 2;
25+
for (int i = 0; i < len; i++) {
26+
byte b = bytes[i];
27+
bytes[i] = bytes[bytes.length - i - 1];
28+
bytes[bytes.length - i - 1] = b;
29+
}
30+
}
31+
}

‎src/main/java/org/tron/common/runtime/config/VMConfig.java‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ public class VMConfig {
5151
@Setter
5252
private static boolean ALLOW_MULTI_SIGN = false;
5353

54+
@Setter
55+
private static boolean ALLOW_TVM_SOLIDITY_059 = false;
56+
57+
5458
private VMConfig() {
5559
}
5660

@@ -88,6 +92,10 @@ public static void initAllowTvmConstantinople(long allow) {
8892
ALLOW_TVM_CONSTANTINOPLE = allow == 1;
8993
}
9094

95+
public static void initAllowTvmSolidity059(long allow) {
96+
ALLOW_TVM_SOLIDITY_059 = allow == 1;
97+
}
98+
9199
public static boolean getEnergyLimitHardFork() {
92100
return ENERGY_LIMIT_HARD_FORK;
93101
}
@@ -104,4 +112,8 @@ public static boolean allowMultiSign() {
104112
return ALLOW_MULTI_SIGN;
105113
}
106114

115+
public static boolean allowTvmSolidity059() {
116+
return ALLOW_TVM_SOLIDITY_059;
117+
}
118+
107119
}

‎src/main/java/org/tron/common/runtime/vm/DataWord.java‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,4 +511,14 @@ public DataWord shiftRightSigned(DataWord arg) {
511511
public static long sizeInWords(long bytesSize) {
512512
return bytesSize == 0 ? 0 : (bytesSize - 1) / WORD_SIZE + 1;
513513
}
514+
515+
public static DataWord[] parseArray(byte[] data) {
516+
int len = data.length / WORD_SIZE;
517+
DataWord[] words = new DataWord[len];
518+
for (int i = 0; i < len; i++) {
519+
byte[] bytes = Arrays.copyOfRange(data, i * WORD_SIZE, (i + 1) * WORD_SIZE);
520+
words[i] = new DataWord(bytes);
521+
}
522+
return words;
523+
}
514524
}

‎src/main/java/org/tron/common/runtime/vm/OpCode.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,8 @@ public enum OpCode {
575575

576576
CALLTOKENID(0xd3, 0, 1, OpCode.Tier.BaseTier),
577577

578+
ISCONTRACT(0xd4, 1, 1, OpCode.Tier.ExtTier),
579+
578580
/**
579581
* (0xf0) Create a new account with associated code
580582
*/

0 commit comments

Comments
 (0)