Skip to content

Commit

Permalink
Merge pull request hyperledger-web3j#50 from GemHQ/default-type-values
Browse files Browse the repository at this point in the history
Default type values
  • Loading branch information
conor10 authored Jan 30, 2017
2 parents e47fa75 + 91996d3 commit 903d66d
Show file tree
Hide file tree
Showing 1,097 changed files with 3,325 additions and 1,100 deletions.
6 changes: 4 additions & 2 deletions src/main/java/org/web3j/abi/datatypes/Address.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package org.web3j.abi.datatypes;

import java.math.BigInteger;

import org.web3j.crypto.Keys;
import org.web3j.utils.Numeric;

import java.math.BigInteger;

/**
* Address type, which is equivalent to uint160.
*/
public class Address extends Uint {

public static final String TYPE_NAME = "address";
public static final int LENGTH = 160;
public static final Address DEFAULT = new Address(BigInteger.ZERO);

public Address(BigInteger value) {
super(TYPE_NAME, LENGTH, value);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/web3j/abi/datatypes/Bool.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
public class Bool implements Type<Boolean> {

public static final String TYPE_NAME = "bool";
public static final Bool DEFAULT = new Bool(false);

private boolean value;

Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/web3j/abi/datatypes/DynamicBytes.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
public class DynamicBytes extends BytesType {

public static final String TYPE_NAME = "bytes";
public static final DynamicBytes DEFAULT = new DynamicBytes(new byte[]{});

public DynamicBytes(byte[] value) {
super(value, TYPE_NAME);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/web3j/abi/datatypes/Fixed.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
public class Fixed extends FixedPointType {

public static final String TYPE_NAME = "fixed";
public static final Fixed DEFAULT = new Fixed(BigInteger.ZERO);

protected Fixed(int mBitSize, int nBitSize, BigInteger value) {
super(TYPE_NAME , mBitSize, nBitSize, value);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/web3j/abi/datatypes/Int.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
public class Int extends IntType {

public static final String TYPE_NAME = "int";
public static final Int DEFAULT = new Int(BigInteger.ZERO);

public Int(BigInteger value) {
// "int" values should be declared as int256 in computing function selectors
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/web3j/abi/datatypes/Ufixed.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
public class Ufixed extends FixedPointType {

public static final String TYPE_NAME = "ufixed";
public static final Ufixed DEFAULT = new Ufixed(BigInteger.ZERO);

protected Ufixed(int mBitSize, int nBitSize, BigInteger value) {
super(TYPE_NAME, mBitSize, nBitSize, value);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/web3j/abi/datatypes/Uint.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
public class Uint extends IntType {

public static final String TYPE_NAME = "uint";
public static final Uint DEFAULT = new Uint(BigInteger.ZERO);

/**
* This constructor is required by the {@link Address} type.
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/web3j/abi/datatypes/Utf8String.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
public class Utf8String implements Type<String> {

public static final String TYPE_NAME = "string";
public static final Utf8String DEFAULT = new Utf8String("");

private String value;

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes1.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes1 extends Bytes {
public static final Bytes1 DEFAULT = new Bytes1(new byte[1]);

public Bytes1(byte[] value) {
super(1, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes10.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes10 extends Bytes {
public static final Bytes10 DEFAULT = new Bytes10(new byte[10]);

public Bytes10(byte[] value) {
super(10, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes11.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes11 extends Bytes {
public static final Bytes11 DEFAULT = new Bytes11(new byte[11]);

public Bytes11(byte[] value) {
super(11, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes12.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes12 extends Bytes {
public static final Bytes12 DEFAULT = new Bytes12(new byte[12]);

public Bytes12(byte[] value) {
super(12, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes13.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes13 extends Bytes {
public static final Bytes13 DEFAULT = new Bytes13(new byte[13]);

public Bytes13(byte[] value) {
super(13, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes14.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes14 extends Bytes {
public static final Bytes14 DEFAULT = new Bytes14(new byte[14]);

public Bytes14(byte[] value) {
super(14, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes15.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes15 extends Bytes {
public static final Bytes15 DEFAULT = new Bytes15(new byte[15]);

public Bytes15(byte[] value) {
super(15, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes16.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes16 extends Bytes {
public static final Bytes16 DEFAULT = new Bytes16(new byte[16]);

public Bytes16(byte[] value) {
super(16, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes17.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes17 extends Bytes {
public static final Bytes17 DEFAULT = new Bytes17(new byte[17]);

public Bytes17(byte[] value) {
super(17, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes18.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes18 extends Bytes {
public static final Bytes18 DEFAULT = new Bytes18(new byte[18]);

public Bytes18(byte[] value) {
super(18, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes19.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes19 extends Bytes {
public static final Bytes19 DEFAULT = new Bytes19(new byte[19]);

public Bytes19(byte[] value) {
super(19, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes2.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes2 extends Bytes {
public static final Bytes2 DEFAULT = new Bytes2(new byte[2]);

public Bytes2(byte[] value) {
super(2, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes20.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes20 extends Bytes {
public static final Bytes20 DEFAULT = new Bytes20(new byte[20]);

public Bytes20(byte[] value) {
super(20, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes21.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes21 extends Bytes {
public static final Bytes21 DEFAULT = new Bytes21(new byte[21]);

public Bytes21(byte[] value) {
super(21, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes22.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes22 extends Bytes {
public static final Bytes22 DEFAULT = new Bytes22(new byte[22]);

public Bytes22(byte[] value) {
super(22, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes23.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes23 extends Bytes {
public static final Bytes23 DEFAULT = new Bytes23(new byte[23]);

public Bytes23(byte[] value) {
super(23, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes24.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes24 extends Bytes {
public static final Bytes24 DEFAULT = new Bytes24(new byte[24]);

public Bytes24(byte[] value) {
super(24, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes25.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes25 extends Bytes {
public static final Bytes25 DEFAULT = new Bytes25(new byte[25]);

public Bytes25(byte[] value) {
super(25, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes26.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes26 extends Bytes {
public static final Bytes26 DEFAULT = new Bytes26(new byte[26]);

public Bytes26(byte[] value) {
super(26, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes27.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes27 extends Bytes {
public static final Bytes27 DEFAULT = new Bytes27(new byte[27]);

public Bytes27(byte[] value) {
super(27, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes28.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes28 extends Bytes {
public static final Bytes28 DEFAULT = new Bytes28(new byte[28]);

public Bytes28(byte[] value) {
super(28, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes29.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes29 extends Bytes {
public static final Bytes29 DEFAULT = new Bytes29(new byte[29]);

public Bytes29(byte[] value) {
super(29, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes3.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes3 extends Bytes {
public static final Bytes3 DEFAULT = new Bytes3(new byte[3]);

public Bytes3(byte[] value) {
super(3, value);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/web3j/abi/datatypes/generated/Bytes30.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use Generator located in project X to update.</p>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Bytes30 extends Bytes {
public static final Bytes30 DEFAULT = new Bytes30(new byte[30]);

public Bytes30(byte[] value) {
super(30, value);
}
Expand Down
Loading

0 comments on commit 903d66d

Please sign in to comment.