@Test public void testEthCompileSolidity() throws Exception { String sourceCode = "pragma solidity ^0.4.0;" + "\ncontract test { function multiply(uint a) returns(uint d) {" + " return a * 7; } }" + "\ncontract test2 { function multiply2(uint a) returns(uint d) {" + " return a * 7; } }"; EthCompileSolidity ethCompileSolidity = web3j.ethCompileSolidity(sourceCode) .send(); assertNotNull(ethCompileSolidity.getCompiledSolidity()); assertThat( ethCompileSolidity.getCompiledSolidity().get("test2").getInfo().getSource(), is(sourceCode)); }
@Override public int hashCode() { int result = getSource() != null ? getSource().hashCode() : 0; result = 31 * result + (getLanguage() != null ? getLanguage().hashCode() : 0); result = 31 * result + (getLanguageVersion() != null ? getLanguageVersion().hashCode() : 0); result = 31 * result + (getCompilerVersion() != null ? getCompilerVersion().hashCode() : 0); result = 31 * result + (getCompilerOptions() != null ? getCompilerOptions().hashCode() : 0); result = 31 * result + (getAbiDefinition() != null ? getAbiDefinition().hashCode() : 0); result = 31 * result + (getUserDoc() != null ? getUserDoc().hashCode() : 0); result = 31 * result + (getDeveloperDoc() != null ? getDeveloperDoc().hashCode() : 0); return result; } }
new EthCompileSolidity.SolidityInfo( "contract test {\n\tfunction multiply(uint a) returns(uint d) {\n" + "\t\treturn a * 7;\n\t}\n}\n",
if (getSource() != null ? !getSource().equals(that.getSource()) : that.getSource() != null) { return false; if (getLanguage() != null ? !getLanguage().equals(that.getLanguage()) : that.getLanguage() != null) { return false; if (getLanguageVersion() != null ? !getLanguageVersion().equals(that.getLanguageVersion()) : that.getLanguageVersion() != null) { return false; if (getCompilerVersion() != null ? !getCompilerVersion().equals(that.getCompilerVersion()) : that.getCompilerVersion() != null) { return false; if (getCompilerOptions() != null ? !getCompilerOptions().equals(that.getCompilerOptions()) : that.getCompilerOptions() != null) { return false; if (getAbiDefinition() != null ? !getAbiDefinition().equals(that.getAbiDefinition()) : that.getAbiDefinition() != null) { return false; if (getUserDoc() != null
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Code)) { return false; } Code code1 = (Code) o; if (getCode() != null ? !getCode().equals(code1.getCode()) : code1.getCode() != null) { return false; } return getInfo() != null ? getInfo().equals(code1.getInfo()) : code1.getInfo() == null; }