Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo owner Changed and Geth Tests Fix #79

Merged
merged 9 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Build Workflow Dispatch
uses: convictional/[email protected]
with:
owner: web3j
owner: hyperledger
repo: web3j-unit
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow_file_name: build.yml
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

### Bug Fixes

*
* Fix Geth integration tests [#79](https://github.com/hyperledger/web3j-evm/pull/79)

### Features

* bump snapshot version 4.11.3 [#76](https://github.com/hyperledger/web3j-unit/pull/76)
* Repo owner Change [#79](https://github.com/hyperledger/web3j-evm/pull/79)

### BREAKING CHANGES

Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/org/web3j/container/KGenericContainer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import org.testcontainers.containers.wait.strategy.WaitStrategy
import org.testcontainers.utility.MountableFile
import org.web3j.protocol.Web3jService
import org.web3j.protocol.http.HttpService
import java.time.Duration

// https://github.com/testcontainers/testcontainers-java/issues/318
open class KGenericContainer(
Expand Down Expand Up @@ -65,5 +66,5 @@ open class KGenericContainer(
private fun inClassPath(path: String) = this.javaClass.classLoader.getResource(path) != null

protected open fun withWaitStrategy(): WaitStrategy =
forHttp("/").forStatusCode(200).forPort(8545)
forHttp("/").forStatusCode(200).forPort(8545).withStartupTimeout(Duration.ofMinutes(2))
}
2 changes: 1 addition & 1 deletion src/main/kotlin/org/web3j/container/ServiceBuilder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ServiceBuilder {
fun build(): GenericService {
return when (type) {
NodeType.BESU -> BesuContainer(version, resourceFiles, hostFiles, genesisPath, servicePort)
NodeType.GETH -> GethContainer(version, resourceFiles, hostFiles, genesisPath, servicePort)
NodeType.GETH -> GethContainer("v1.13.15", resourceFiles, hostFiles, genesisPath, servicePort)
NodeType.EMBEDDED -> {
if (genesisPath == "dev")
EmbeddedService(Configuration(Address(selfAddress), 10), PassthroughTracer())
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/besu/besu_start.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
/opt/besu/bin/besu --rpc-http-enabled --miner-enabled --miner-coinbase=0x0000000000000000000000000000000000000000 --genesis-file=/genesis.json --rpc-http-api=ETH,NET,WEB3,TRACE,DEBUG --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-host=0.0.0.0
/opt/besu/bin/besu --rpc-http-enabled --miner-enabled --miner-coinbase=0x0000000000000000000000000000000000000000 --genesis-file=/genesis.json --rpc-http-api=ETH,NET,WEB3,TRACE,DEBUG --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-host=0.0.0.0 --rpc-http-port=8545
2 changes: 1 addition & 1 deletion src/main/resources/geth/geth_start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
geth init ./genesis.json
geth account import --password password.txt key.txt
geth --http --http.api "eth,net,txpool" --http.addr=0.0.0.0 --allow-insecure-unlock --unlock 0xfe3b557e8fb62b89f4916b721be55ceb828dbd73 --password /password.txt --mine --miner.etherbase 0xfe3b557e8fb62b89f4916b721be55ceb828dbd73 --rpc.allow-unprotected-txs
geth --http --http.api "eth,net,txpool" --http.addr=0.0.0.0 --http.port=8545 --http.corsdomain '*' --allow-insecure-unlock --unlock 0xfe3b557e8fb62b89f4916b721be55ceb828dbd73 --password /password.txt --mine --miner.etherbase 0xfe3b557e8fb62b89f4916b721be55ceb828dbd73 --rpc.allow-unprotected-txs
5 changes: 2 additions & 3 deletions src/test/kotlin/org/web3j/GethGreeterTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@
package org.web3j

import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.web3j.greeter.Greeter
import org.web3j.protocol.Web3j
import org.web3j.protocol.core.DefaultBlockParameterName
import org.web3j.tx.TransactionManager
import org.web3j.tx.gas.ContractGasProvider
@Disabled

@EVMTest(type = NodeType.GETH)
class GethGreeterTest {

Expand All @@ -30,7 +29,7 @@ class GethGreeterTest {
transactionManager: TransactionManager,
gasProvider: ContractGasProvider
) {
Thread.sleep(2000)
Thread.sleep(10000)
val balance =
web3j.ethGetBalance("0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", DefaultBlockParameterName.LATEST).send()
.balance
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/compose/geth.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
node1:
image: ethereum/client-go:stable
image: ethereum/client-go:v1.13.15
ports:
- 8545:8545
- 30303:30303
Expand Down
Loading