diff --git a/emerald-grpc b/emerald-grpc index 0e10f0de..8e814567 160000 --- a/emerald-grpc +++ b/emerald-grpc @@ -1 +1 @@ -Subproject commit 0e10f0de5695658a92bf7f1436e815adf931af59 +Subproject commit 8e814567e1a3820f22a78329ec24cb90d2fb2322 diff --git a/src/main/kotlin/io/emeraldpay/dshackle/BlockchainType.kt b/src/main/kotlin/io/emeraldpay/dshackle/BlockchainType.kt index c4993d76..26f51209 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/BlockchainType.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/BlockchainType.kt @@ -11,7 +11,8 @@ enum class BlockchainType { chain == Chain.OPTIMISM || chain == Chain.BSC || chain == Chain.TESTNET_GOERLI || - chain == Chain.ETHEREUM + chain == Chain.ETHEREUM || + chain == Chain.TESTNET_SEPOLIA ) { return EVM_POS } diff --git a/src/main/kotlin/io/emeraldpay/dshackle/Chain.kt b/src/main/kotlin/io/emeraldpay/dshackle/Chain.kt index c714d97e..e6bf1c5f 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/Chain.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/Chain.kt @@ -49,7 +49,8 @@ enum class Chain(val id: Int, val chainCode: String, val chainName: String) { "ROPSTEN", "Ropsten Testnet" ), - TESTNET_RINKEBY(10007, "RINKEBY", "Rinkeby Testnet"); + TESTNET_RINKEBY(10007, "RINKEBY", "Rinkeby Testnet"), + TESTNET_SEPOLIA(10008, "SEPOLIA", "Sepolia Testnet"); companion object { fun byId(id: Int): Chain { diff --git a/src/main/kotlin/io/emeraldpay/dshackle/Global.kt b/src/main/kotlin/io/emeraldpay/dshackle/Global.kt index aadeb033..5c456b66 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/Global.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/Global.kt @@ -64,7 +64,9 @@ class Global { "ropsten" to Chain.TESTNET_ROPSTEN, "ropsten-testnet" to Chain.TESTNET_ROPSTEN, "bitcoin" to Chain.BITCOIN, - "bitcoin-testnet" to Chain.TESTNET_BITCOIN + "bitcoin-testnet" to Chain.TESTNET_BITCOIN, + "sepolia" to Chain.TESTNET_SEPOLIA, + "sepolia-testnet" to Chain.TESTNET_SEPOLIA, ) fun chainById(id: String?): Chain { diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt index 1ddae212..d98e99b7 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt @@ -225,6 +225,10 @@ class DefaultEthereumMethods( "\"5\"" } + Chain.TESTNET_SEPOLIA == chain -> { + "\"11155111\"" + } + else -> throw RpcException(-32602, "Invalid chain") } } @@ -263,6 +267,10 @@ class DefaultEthereumMethods( "\"0x5\"" } + Chain.TESTNET_SEPOLIA == chain -> { + "\"0xaa36a7\"" + } + else -> throw RpcException(-32602, "Invalid chain") } } diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumMultistream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumMultistream.kt index 5c8af8fe..f59fcaf4 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumMultistream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumMultistream.kt @@ -59,7 +59,7 @@ open class EthereumMultistream( private var subscribe = EthereumEgressSubscription(this, NoPendingTxes()) private val supportsEIP1559 = when (chain) { - Chain.ETHEREUM, Chain.TESTNET_ROPSTEN, Chain.TESTNET_GOERLI, Chain.TESTNET_RINKEBY -> true + Chain.ETHEREUM, Chain.TESTNET_ROPSTEN, Chain.TESTNET_GOERLI, Chain.TESTNET_RINKEBY, Chain.TESTNET_SEPOLIA -> true else -> false } private val feeEstimation = if (supportsEIP1559) EthereumPriorityFees(this, reader, 256)