Skip to content

Commit

Permalink
Merge pull request #139 from endiaoekoe/0.9.1
Browse files Browse the repository at this point in the history
0.9.1
  • Loading branch information
lvs007 authored Oct 10, 2024
2 parents 0ae6710 + dca793b commit efac9cc
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 16 deletions.
8 changes: 4 additions & 4 deletions trident-java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Then add required packages as dependencies. Please add dependencies locally.
```groovy
dependencies {
// protobuf & grpc
implementation 'com.google.protobuf:protobuf-java:3.25.0'
implementation 'com.google.protobuf:protobuf-java:3.25.5'
implementation fileTree(dir:'../core')
implementation fileTree(dir:'../utils')
Expand All @@ -51,21 +51,21 @@ dependencies {
<dependency>
<groupId>org.tron.trident</groupId>
<artifactId>abi</artifactId>
<version>0.9.0</version>
<version>0.9.1</version>
<scope>system</scope>
<systemPath>your path</systemPath>
</dependency>
<dependency>
<groupId>org.tron.trident</groupId>
<artifactId>utils</artifactId>
<version>0.9.0</version>
<version>0.9.1</version>
<scope>system</scope>
<systemPath>your path</systemPath>
</dependency>
<dependency>
<groupId>org.tron.trident</groupId>
<artifactId>core</artifactId>
<version>0.9.0</version>
<version>0.9.1</version>
<scope>system</scope>
<systemPath>your path</systemPath>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion trident-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ext {
}

allprojects {
version '0.9.0'
version '0.9.1'
group = 'org.tron.trident'

repositories {
Expand Down
4 changes: 2 additions & 2 deletions trident-java/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ dependencies {
implementation 'io.grpc:grpc-stub:1.58.1'
compileOnly 'org.apache.tomcat:annotations-api:6.0.53' // necessary for Java 9+
//json parsing
implementation 'com.google.protobuf:protobuf-java-util:3.25.0'
implementation 'com.google.protobuf:protobuf-java-util:3.25.5'

implementation "org.bouncycastle:bcprov-jdk15on:$bouncycastleVersion"
}

protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.25.0'
artifact = 'com.google.protobuf:protoc:3.25.5'
}
plugins {
grpc {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public static ApiWrapper ofMainnet(String hexPrivateKey) {
* @return a ApiWrapper object
*/
public static ApiWrapper ofShasta(String hexPrivateKey) {
return new ApiWrapper(Constant.TRONGRID_SHASTA, Constant.TRONGRID_SHASTA_SOLIDITY, hexPrivateKey);
return new ApiWrapper(Constant.TRONGRID_SHASTA, Constant.TRONGRID_SHASTA_SOLIDITY, hexPrivateKey);
}

/**
Expand Down Expand Up @@ -360,15 +360,18 @@ private TransactionCapsule createTransaction(
*/
public TransactionExtention createTransactionExtention(Message request, Transaction.Contract.ContractType contractType) throws IllegalException {
TransactionExtention.Builder trxExtBuilder = TransactionExtention.newBuilder();

TransactionReturn.Builder retBuilder = TransactionReturn.newBuilder();
try {
TransactionCapsule trx = createTransaction(request, contractType);
trxExtBuilder.setTransaction(trx.getTransaction());
trxExtBuilder.setTxid(ByteString.copyFrom(Sha256Hash.hash(true, trx.getTransaction().getRawData().toByteArray())));
retBuilder.setResult(true).setCode(TransactionReturn.response_code.SUCCESS);
} catch (Exception e) {
retBuilder.setResult(false).setCode(TransactionReturn.response_code.OTHER_ERROR)
.setMessage(ByteString.copyFromUtf8(e.getClass() + " : " + e.getMessage()));
throw new IllegalException("createTransactionExtention error,"+e.getMessage());
}

trxExtBuilder.setResult(retBuilder);
return trxExtBuilder.build();
}

Expand All @@ -394,30 +397,43 @@ private String resolveResultCode(int code) {
switch (code) {
case 0:
responseCode = "SUCCESS";
break;
case 1:
responseCode = "SIGERROR";
break;
case 2:
responseCode = "CONTRACT_VALIDATE_ERROR";
break;
case 3:
responseCode = "CONTRACT_EXE_ERROR";
break;
case 4:
responseCode = "BANDWITH_ERROR";
break;
case 5:
responseCode = "DUP_TRANSACTION_ERROR";
break;
case 6:
responseCode = "TAPOS_ERROR";
break;
case 7:
responseCode = "TOO_BIG_TRANSACTION_ERROR";
break;
case 8:
responseCode = "TRANSACTION_EXPIRATION_ERROR";
break;
case 9:
responseCode = "SERVER_BUSY";
break;
case 10:
responseCode = "NO_CONNECTION";
break;
case 11:
responseCode = "NOT_ENOUGH_EFFECTIVE_CONNECTION";
break;
case 20:
responseCode = "OTHER_ERROR";
break;
}
return responseCode;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public final class Constant{
public static final String TRONGRID_MAIN_NET_SOLIDITY = "grpc.trongrid.io:50052";

public static final String TRONGRID_SHASTA = "grpc.shasta.trongrid.io:50051";
public static final String TRONGRID_SHASTA_SOLIDITY = "grpc.shasta.trongrid.io:50052";
public static final String TRONGRID_SHASTA_SOLIDITY = "grpc.shasta.trongrid.io:50052";

//Public Fullnode, maintained by official team
public static final String FULLNODE_NILE = "grpc.nile.trongrid.io:50051";
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit efac9cc

Please sign in to comment.