Skip to content

Commit

Permalink
Merge pull request #109 from mikeluxue/0.8.0
Browse files Browse the repository at this point in the history
0.8.0
  • Loading branch information
eodiandie authored Nov 1, 2023
2 parents c87a9a8 + c67944a commit e194eaf
Show file tree
Hide file tree
Showing 11 changed files with 1,102 additions and 30 deletions.
6 changes: 3 additions & 3 deletions trident-java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,21 @@ dependencies {
<dependency>
<groupId>org.tron.trident</groupId>
<artifactId>abi</artifactId>
<version>0.7.0</version>
<version>0.8.0</version>
<scope>system</scope>
<systemPath>your path</systemPath>
</dependency>
<dependency>
<groupId>org.tron.trident</groupId>
<artifactId>utils</artifactId>
<version>0.7.0</version>
<version>0.8.0</version>
<scope>system</scope>
<systemPath>your path</systemPath>
</dependency>
<dependency>
<groupId>org.tron.trident</groupId>
<artifactId>core</artifactId>
<version>0.7.0</version>
<version>0.8.0</version>
<scope>system</scope>
<systemPath>your path</systemPath>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ static <T extends Type> T decode(String input, Class<T> type) {
return decode(input, 0, type);
}

static Address decodeAddress(String input) {
public static Address decodeAddress(String input) {
return new Address(decodeNumeric(input, Uint160.class));
}

static <T extends NumericType> T decodeNumeric(String input, Class<T> type) {
public static <T extends NumericType> T decodeNumeric(String input, Class<T> type) {
try {
byte[] inputByteArray = Numeric.hexStringToByteArray(input);
int typeLengthAsBytes = getTypeLengthInBytes(type);
Expand Down Expand Up @@ -245,18 +245,18 @@ static int decodeUintAsInt(String rawInput, int offset) {
return decode(input, 0, Uint.class).getValue().intValue();
}

static Bool decodeBool(String rawInput, int offset) {
public static Bool decodeBool(String rawInput, int offset) {
String input = rawInput.substring(offset, offset + MAX_BYTE_LENGTH_FOR_HEX_STRING);
BigInteger numericValue = Numeric.toBigInt(input);
boolean value = numericValue.equals(BigInteger.ONE);
return new Bool(value);
}

static <T extends Bytes> T decodeBytes(String input, Class<T> type) {
public static <T extends Bytes> T decodeBytes(String input, Class<T> type) {
return decodeBytes(input, 0, type);
}

static <T extends Bytes> T decodeBytes(String input, int offset, Class<T> type) {
public static <T extends Bytes> T decodeBytes(String input, int offset, Class<T> type) {
try {
String simpleName = type.getSimpleName();
String[] splitName = simpleName.split(Bytes.class.getSimpleName());
Expand All @@ -277,7 +277,7 @@ static <T extends Bytes> T decodeBytes(String input, int offset, Class<T> type)
}
}

static DynamicBytes decodeDynamicBytes(String input, int offset) {
public static DynamicBytes decodeDynamicBytes(String input, int offset) {
int encodedLength = decodeUintAsInt(input, offset);
int hexStringEncodedLength = encodedLength << 1;

Expand All @@ -289,7 +289,7 @@ static DynamicBytes decodeDynamicBytes(String input, int offset) {
return new DynamicBytes(bytes);
}

static Utf8String decodeUtf8String(String input, int offset) {
public static Utf8String decodeUtf8String(String input, int offset) {
DynamicBytes dynamicBytesResult = decodeDynamicBytes(input, offset);
byte[] bytes = dynamicBytesResult.getValue();

Expand Down Expand Up @@ -411,7 +411,7 @@ private static <T extends Type> T instantiateStruct(
}

@SuppressWarnings("unchecked")
static <T extends Type> T decodeDynamicArray(
public static <T extends Type> T decodeDynamicArray(
String input, int offset, TypeReference<T> typeReference) {

int length = decodeUintAsInt(input, offset);
Expand All @@ -424,7 +424,7 @@ static <T extends Type> T decodeDynamicArray(
return decodeArrayElements(input, valueOffset, typeReference, length, function);
}

static <T extends Type> T decodeDynamicStruct(
public static <T extends Type> T decodeDynamicStruct(
String input, int offset, TypeReference<T> typeReference) {

BiFunction<List<T>, String, T> function =
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.7.0'
version '0.8.0'
group = 'org.tron.trident'

repositories {
Expand Down
Loading

0 comments on commit e194eaf

Please sign in to comment.