Skip to content

Commit

Permalink
Merge pull request #100 from web3j/bump_4.10.4
Browse files Browse the repository at this point in the history
bump versions
  • Loading branch information
gtebrean authored Sep 1, 2023
2 parents 017dd8e + 56ff389 commit c8b9934
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ repositories {
}
dependencies {
implementation "org.web3j:core:4.10.2"
implementation "org.web3j:web3j-evm:4.10.2"
implementation "org.web3j:core:4.10.3"
implementation "org.web3j:web3j-evm:4.10.3"
}
```

Expand Down
13 changes: 6 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ plugins {
id 'com.diffplug.gradle.spotless' version '4.5.1'
id 'io.codearte.nexus-staging' version '0.21.1'
id 'de.marcphilipp.nexus-publish' version '0.4.0'
id 'org.jetbrains.kotlin.jvm' version '1.6.21'
id 'de.undercouch.download' version '4.0.0'
id 'org.jetbrains.kotlin.jvm' version '1.8.10'
id 'de.undercouch.download' version '4.1.2'
}

description 'Web3j-evm extension'

ext {
web3jVersion = '4.10.2'
web3jVersion = '4.10.3'
log4jVersion = '2.15.0'
guavaVersion = '28.1-jre'
jacksonVersion = '2.10.0'
klaxonVersion = '5.0.1'
kotlinVersion = '1.6.21'
besuPluginVersion = '23.4.1'
besuInternalVersion = '23.4.1'
kotlinVersion = '1.8.10'
besuPluginVersion = '23.7.0'
besuInternalVersion = '23.7.0'
besuInternalCryptoVersion = '23.1.3'
besuCryptoDepVersion = '0.7.1'
}
Expand Down Expand Up @@ -59,7 +59,6 @@ dependencies {
implementation "org.web3j:core:$web3jVersion"
implementation "com.google.guava:guava:$guavaVersion"
implementation "com.beust:klaxon:$klaxonVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"

def withoutAbi = { exclude group: 'org.web3j', module: 'abi' }
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
kotlin.code.style=official
group=org.web3j
version=4.10.3-SNAPSHOT
version=4.10.4-SNAPSHOT
1 change: 1 addition & 0 deletions gradle/spotless/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ task downloadJavaLicense(type: Download) {
onlyIfModified true
}


task downloadFormatterProperties(type: Download) {
src 'https://raw.githubusercontent.com/web3j/build-tools/master/gradle/spotless/formatter.properties'
dest new File("$rootDir/gradle/spotless",'formatter.properties')
Expand Down
13 changes: 12 additions & 1 deletion src/main/kotlin/org/web3j/evm/EmbeddedEthereum.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ import java.util.Optional
import org.web3j.abi.datatypes.Address as wAddress
import org.web3j.protocol.core.methods.request.Transaction as wTransaction
import org.web3j.protocol.core.methods.response.TransactionReceipt as wTransactionReceipt
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.WithdrawalParameter
import org.web3j.evm.utils.TestAccountsConstants
import org.web3j.protocol.core.methods.response.EthBlock.Withdrawal

/**
* Embedded Web3j Ethereum blockchain.
Expand Down Expand Up @@ -309,10 +311,19 @@ class EmbeddedEthereum(
transactionResults,
null, // TODO?
null, // TODO?
blockResult.baseFeePerGas
blockResult.baseFeePerGas,
blockResult.withdrawalsRoot,
blockResult.withdrawals?.map { withdrawalParameter ->
toWithdrawal(withdrawalParameter)
}?.toList()
)
}

private fun toWithdrawal(withdrawalParameter: WithdrawalParameter): Withdrawal {
val withdrawal = withdrawalParameter.toWithdrawal()
return Withdrawal(withdrawal.index.toString(), withdrawal.validatorIndex.toString(), withdrawal.address.toHexString(), withdrawal.amount.toHexString())
}

fun ethGetCode(w3jAddress: wAddress, defaultBlockParameter: String): String {
val blockParameter = BlockParameter(defaultBlockParameter)
val blockNumber: Optional<Long> = blockParameter.number
Expand Down
4 changes: 3 additions & 1 deletion src/main/kotlin/org/web3j/evm/InMemoryBesuChain.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import org.slf4j.LoggerFactory
import java.math.BigInteger
import java.nio.charset.StandardCharsets
import java.util.Optional
import org.hyperledger.besu.ethereum.storage.keyvalue.VariablesKeyValueStorage
import org.hyperledger.besu.ethereum.vm.CachingBlockHashLookup
import org.hyperledger.besu.evm.internal.EvmConfiguration
import org.hyperledger.besu.evm.worldstate.WorldUpdater
Expand Down Expand Up @@ -105,8 +106,9 @@ class InMemoryBesuChain(
)

val keyValueStorage = InMemoryKeyValueStorage()
val variablesStorage = VariablesKeyValueStorage(keyValueStorage)
val blockchainStorage = KeyValueStoragePrefixedKeyBlockchainStorage(
keyValueStorage, MainnetBlockHeaderFunctions()
keyValueStorage, variablesStorage, MainnetBlockHeaderFunctions()
)
val worldStateStorage = WorldStateKeyValueStorage(InMemoryKeyValueStorage())
val worldStatePreimageStorage = WorldStatePreimageKeyValueStorage(InMemoryKeyValueStorage())
Expand Down

0 comments on commit c8b9934

Please sign in to comment.