Create junit folder in the existing folder structure.
Test that mocks a web3j instance.
Added an entry in .gitignore for Eclipse IDE files.
Create defaultTx class and test.
.gitignore IDE specific files.
Files
pom.xml
test/java/junit/Web3jTest.java
.gitignore
main/java/types/DefaultTx.java
main/java/junit/TypesTest.java
Visual
Considerations
For defaultTx class #19 :
(Initial) The address instance is of data type byte[20] (20 bytes for address) to save space, but web3j provides the Bytes32 object as well. Not sure which direction would be best.
(Current) Used the java contracts as a reference and set as String.
(Initial) I initially set the gas and gasPrice instances as java.lang.Number. That way you can set their types as either Double or Float wrapper classes to port the original TS advanced types [string | number | BN]. But the documentation advises using java.math.BigDecimal for currency and have refactored.
(Current) Used the java contracts as a reference and set as BigInteger.
Summary
Installed Mockito. Created JUnit folder structure. Instantiated mock web3j. Create defaultTx class.
Closes #15 Closes #16 Closes #19 Closes #27
Implementation
Files
pom.xml
test/java/junit/Web3jTest.java
.gitignore
main/java/types/DefaultTx.java
main/java/junit/TypesTest.java
Visual
Considerations
For defaultTx class #19 :
(Initial) The address instance is of data type byte[20] (20 bytes for address) to save space, but web3j provides the Bytes32 object as well. Not sure which direction would be best.
(Current) Used the java contracts as a reference and set as String.
(Initial) I initially set the gas and gasPrice instances as java.lang.Number. That way you can set their types as either Double or Float wrapper classes to port the original TS advanced types [string | number | BN]. But the documentation advises using java.math.BigDecimal for currency and have refactored.
(Current) Used the java contracts as a reference and set as BigInteger.