-
Notifications
You must be signed in to change notification settings - Fork 834
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Diego López León <[email protected]> Signed-off-by: Diego López León <[email protected]>
- Loading branch information
Showing
21 changed files
with
736 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...st/java/org/hyperledger/besu/tests/acceptance/jsonrpc/ipc/Web3JSupportAcceptanceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package org.hyperledger.besu.tests.acceptance.jsonrpc.ipc; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.assertj.core.api.Assertions.fail; | ||
|
||
import org.hyperledger.besu.ethereum.api.jsonrpc.RpcApis; | ||
import org.hyperledger.besu.ethereum.api.jsonrpc.ipc.JsonRpcIpcConfiguration; | ||
import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBase; | ||
import org.hyperledger.besu.tests.acceptance.dsl.node.Node; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.util.Collections; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.web3j.protocol.Web3j; | ||
import org.web3j.protocol.core.Request; | ||
import org.web3j.protocol.core.methods.response.NetVersion; | ||
import org.web3j.protocol.ipc.UnixIpcService; | ||
|
||
public class Web3JSupportAcceptanceTest extends AcceptanceTestBase { | ||
|
||
private Node node; | ||
private Path socketPath; | ||
|
||
@Before | ||
public void setUp() throws Exception { | ||
socketPath = Files.createTempFile("besu-test-", ".ipc"); | ||
node = | ||
besu.createNode( | ||
"node1", | ||
(configurationBuilder) -> | ||
configurationBuilder.jsonRpcIpcConfiguration( | ||
new JsonRpcIpcConfiguration( | ||
true, socketPath, Collections.singletonList(RpcApis.NET.name())))); | ||
cluster.start(node); | ||
} | ||
|
||
@Test | ||
public void netVersionCall() { | ||
final Web3j web3 = Web3j.build(new UnixIpcService(socketPath.toString())); | ||
final Request<?, NetVersion> ethBlockNumberRequest = web3.netVersion(); | ||
node.verify( | ||
node -> { | ||
try { | ||
assertThat(ethBlockNumberRequest.send().getNetVersion()) | ||
.isEqualTo(String.valueOf(2018)); | ||
} catch (IOException e) { | ||
fail("Web3J net_version call failed", e); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.