From c1b0e758eaeb3c5779beaef8a45cd629bdb66874 Mon Sep 17 00:00:00 2001 From: a10zn8 Date: Tue, 22 Nov 2022 18:14:04 +0400 Subject: [PATCH] added proto as submodule and proto generation configured --- .gitmodules | 3 + build.gradle | 27 +- dshackle-cli/src/grpc-clent.js | 2 +- emerald-grpc | 1 + gradle.properties | 3 + gradle/libs.versions.toml | 4 +- proto/README.adoc | 7 - proto/blockchain.proto | 284 ------------------ proto/common.proto | 74 ----- .../io/emeraldpay/dshackle/BlockchainType.kt | 36 +++ .../kotlin/io/emeraldpay/dshackle/Chain.kt | 64 ++++ .../io/emeraldpay/dshackle/ChainValue.kt | 1 - .../kotlin/io/emeraldpay/dshackle/Global.kt | 1 - .../io/emeraldpay/dshackle/SilentException.kt | 1 - .../dshackle/cache/BlocksRedisCache.kt | 2 +- .../dshackle/cache/CachesFactory.kt | 4 +- .../dshackle/cache/HeightByHashRedisCache.kt | 2 +- .../dshackle/cache/OnBlockRedisCache.kt | 2 +- .../dshackle/cache/OnTxRedisCache.kt | 2 +- .../dshackle/cache/ReceiptRedisCache.kt | 2 +- .../emeraldpay/dshackle/cache/TxRedisCache.kt | 2 +- .../dshackle/config/HealthConfig.kt | 2 +- .../dshackle/config/HealthConfigReader.kt | 2 +- .../emeraldpay/dshackle/config/ProxyConfig.kt | 2 +- .../dshackle/config/ProxyConfigReader.kt | 2 +- .../dshackle/config/TokensConfig.kt | 4 +- .../config/context/MultistreamsConfig.kt | 4 +- .../monitoring/accesslog/AccessHandlerHttp.kt | 2 +- .../dshackle/monitoring/accesslog/Events.kt | 2 +- .../monitoring/accesslog/EventsBuilder.kt | 2 +- .../emeraldpay/dshackle/proxy/BaseHandler.kt | 2 +- .../emeraldpay/dshackle/proxy/HttpHandler.kt | 2 +- .../emeraldpay/dshackle/proxy/ProxyServer.kt | 2 +- .../dshackle/proxy/WebsocketHandler.kt | 2 +- .../emeraldpay/dshackle/rpc/BlockchainRpc.kt | 2 +- .../io/emeraldpay/dshackle/rpc/EstimateFee.kt | 2 +- .../io/emeraldpay/dshackle/rpc/NativeCall.kt | 4 +- .../dshackle/rpc/NativeSubscribe.kt | 4 +- .../io/emeraldpay/dshackle/rpc/StreamHead.kt | 2 +- .../dshackle/rpc/SubscribeStatus.kt | 2 +- .../emeraldpay/dshackle/rpc/TrackAddress.kt | 2 +- .../dshackle/rpc/TrackBitcoinAddress.kt | 4 +- .../emeraldpay/dshackle/rpc/TrackBitcoinTx.kt | 4 +- .../dshackle/rpc/TrackERC20Address.kt | 4 +- .../dshackle/rpc/TrackEthereumAddress.kt | 4 +- .../dshackle/rpc/TrackEthereumTx.kt | 4 +- .../io/emeraldpay/dshackle/rpc/TrackTx.kt | 2 +- .../dshackle/startup/ConfiguredUpstreams.kt | 4 +- .../dshackle/startup/UpstreamChangeEvent.kt | 2 +- .../dshackle/upstream/CallTargetsHolder.kt | 4 +- .../upstream/CurrentMultistreamHolder.kt | 2 +- .../dshackle/upstream/FilteredApis.kt | 2 +- .../dshackle/upstream/HttpFactory.kt | 2 +- .../dshackle/upstream/HttpRpcFactory.kt | 2 +- .../dshackle/upstream/Multistream.kt | 2 +- .../dshackle/upstream/MultistreamHolder.kt | 2 +- .../upstream/bitcoin/BitcoinMultistream.kt | 2 +- .../upstream/bitcoin/BitcoinRpcUpstream.kt | 2 +- .../upstream/bitcoin/BitcoinUpstream.kt | 2 +- .../upstream/calls/DefaultEthereumMethods.kt | 2 +- .../upstream/ethereum/EthereumMultistream.kt | 2 +- .../upstream/ethereum/EthereumRpcUpstream.kt | 2 +- .../upstream/ethereum/EthereumWsFactory.kt | 2 +- .../ethereum/connectors/ConnectorFactory.kt | 2 +- .../connectors/EthereumConnectorFactory.kt | 2 +- .../ethereum_pos/EthereumPosMultiStream.kt | 2 +- .../ethereum_pos/EthereumPosRpcUpstream.kt | 2 +- .../upstream/grpc/BitcoinGrpcUpstream.kt | 2 +- .../upstream/grpc/EthereumGrpcUpstream.kt | 2 +- .../upstream/grpc/EthereumPosGrpcUpstream.kt | 2 +- .../dshackle/upstream/grpc/GrpcHead.kt | 2 +- .../dshackle/upstream/grpc/GrpcUpstreams.kt | 4 +- .../upstream/rpcclient/JsonRpcGrpcClient.kt | 2 +- .../cache/BlocksRedisCacheSpec.groovy | 2 +- .../cache/HeightByHashRedisCacheSpec.groovy | 2 +- .../cache/ReceiptRedisCacheSpec.groovy | 2 +- .../dshackle/cache/TxRedisCacheSpec.groovy | 2 +- .../config/HealthConfigReaderSpec.groovy | 2 +- .../config/MainConfigReaderSpec.groovy | 2 +- .../config/ProxyConfigReaderSpec.groovy | 2 +- .../config/TokensConfigReaderSpec.groovy | 2 +- .../monitoring/HealthCheckSetupSpec.groovy | 2 +- .../accesslog/AccessLogWriterSpec.groovy | 2 +- .../accesslog/EventsBaseBuilderSpec.groovy | 2 +- .../EventsBuilderSubscribeBalanceSpec.groovy | 2 +- .../dshackle/proxy/BaseHandlerSpec.groovy | 2 +- .../dshackle/proxy/HttpHandlerSpec.groovy | 2 +- .../dshackle/proxy/ProxyServerSpec.groovy | 2 +- .../proxy/WebsocketHandlerSpec.groovy | 2 +- .../quorum/QuorumRpcReaderSpec.groovy | 2 +- .../dshackle/rpc/NativeCallSpec.groovy | 2 +- .../dshackle/rpc/NativeSubscribeSpec.groovy | 2 +- .../dshackle/rpc/StreamHeadSpec.groovy | 2 +- .../dshackle/rpc/SubscribeStatusSpec.groovy | 2 +- .../rpc/TrackBitcoinAddressSpec.groovy | 2 +- .../dshackle/rpc/TrackBitcoinTxSpec.groovy | 2 +- .../dshackle/rpc/TrackERC20AddressSpec.groovy | 2 +- .../rpc/TrackEthereumAddressSpec.groovy | 2 +- .../dshackle/rpc/TrackEthereumTxSpec.groovy | 2 +- .../startup/ConfiguredUpstreamsSpec.groovy | 2 +- .../dshackle/test/ConnectorFactoryMock.groovy | 2 +- .../test/EthereumPosRpcUpstreamMock.groovy | 2 +- .../test/EthereumRpcUpstreamMock.groovy | 2 +- .../test/MultistreamHolderMock.groovy | 5 +- .../dshackle/test/TestingCommons.groovy | 2 +- .../CurrentMultistreamHolderSpec.groovy | 2 +- .../dshackle/upstream/FilteredApisSpec.groovy | 2 +- .../dshackle/upstream/MultistreamSpec.groovy | 2 +- .../calls/DefaultEthereumMethodsSpec.groovy | 2 +- .../calls/ManagedCallMethodsSpec.groovy | 2 +- .../upstream/ethereum/ERC20BalanceSpec.groovy | 2 +- .../ethereum/EthereumDirectReaderSpec.groovy | 2 +- .../ethereum/EthereumReaderSpec.groovy | 2 +- .../ethereum/LocalCallRouterSpec.groovy | 2 +- .../ethereum/WsConnectionRealSpec.groovy | 2 +- .../upstream/ethereum/WsConnectionSpec.groovy | 2 +- .../grpc/EthereumGrpcUpstreamSpec.groovy | 2 +- .../upstream/grpc/GrpcHeadSpec.groovy | 2 +- 118 files changed, 249 insertions(+), 496 deletions(-) create mode 160000 emerald-grpc delete mode 100644 proto/README.adoc delete mode 100644 proto/blockchain.proto delete mode 100644 proto/common.proto create mode 100644 src/main/kotlin/io/emeraldpay/dshackle/BlockchainType.kt create mode 100644 src/main/kotlin/io/emeraldpay/dshackle/Chain.kt diff --git a/.gitmodules b/.gitmodules index 041a1d48..44248f44 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "dshackle-cli/grpc"] path = dshackle-cli/grpc url = https://github.com/p2p-org/emerald-grpc.git +[submodule "emerald-grpc"] + path = emerald-grpc + url = git@github.com:p2p-org/emerald-grpc.git diff --git a/build.gradle b/build.gradle index eb15c928..fe016704 100644 --- a/build.gradle +++ b/build.gradle @@ -5,6 +5,15 @@ import java.time.ZoneId import java.time.format.DateTimeFormatter import java.time.temporal.ChronoUnit +buildscript { + repositories { + gradlePluginPortal() + } + dependencies { + classpath 'com.google.protobuf:protobuf-gradle-plugin:0.9.1' + } +} + plugins { id 'java' id 'groovy' @@ -70,10 +79,6 @@ dependencies { implementation libs.bundles.etherjar - implementation(libs.emerald.api) { - exclude group: 'com.salesforce.servicelibs', module: 'reactor-grpc' - } - implementation libs.bitcoinj implementation libs.snake.yaml @@ -188,14 +193,26 @@ protobuf { artifact = System.getenv("PROTOC_PATH") == null ? "com.google.protobuf:protoc:${libs.versions.protoc.get()}" : null } plugins { + grpc { + artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" + } + reactor { artifact = "com.salesforce.servicelibs:reactor-grpc:${reactiveGrpcVersion}" } } generateProtoTasks { + all()*.plugins { + grpc {} + reactor {} + } } } sourceSets { main { - resources.srcDirs += project.buildDir.absolutePath + "/generated/version" + //resources.srcDirs += project.buildDir.absolutePath + "/generated/version" + + proto { + srcDir 'emerald-grpc/proto' + } } } diff --git a/dshackle-cli/src/grpc-clent.js b/dshackle-cli/src/grpc-clent.js index a4b33d92..9aeeb2a8 100644 --- a/dshackle-cli/src/grpc-clent.js +++ b/dshackle-cli/src/grpc-clent.js @@ -3,7 +3,7 @@ const path = require('path') const protoLoader = require("@grpc/proto-loader"); const fs = require('fs'); -const PROTO_PATH = path.join(__dirname, "../grpc/proto/blockchain.proto"); +const PROTO_PATH = path.join(__dirname, "../../emerald-grpc/proto/blockchain.proto"); const options = { keepCase: true, diff --git a/emerald-grpc b/emerald-grpc new file mode 160000 index 00000000..441f828e --- /dev/null +++ b/emerald-grpc @@ -0,0 +1 @@ +Subproject commit 441f828eb6d4a0d5d91d6575911eec80271a24aa diff --git a/gradle.properties b/gradle.properties index 974d2f80..fd99adb0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,6 @@ kotlin.code.style=official +grpcVersion=1.49.2 +reactiveGrpcVersion=1.2.0 + diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3b66bf30..4cb7d9bd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -31,8 +31,6 @@ cglib-nodep = "cglib:cglib-nodep:3.3.0" detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" } -emerald-api = "io.emeraldpay:emerald-api:0.12-alpha.3" - equals-verifier = "nl.jqno.equalsverifier:equalsverifier:3.10.1" etherjar-domain = { module = "io.emeraldpay.etherjar:etherjar-domain", version.ref = "etherjar" } @@ -130,6 +128,6 @@ kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } jib = { id = "com.google.cloud.tools.jib", version = "2.5.0" } spring = { id = "org.springframework.boot", version = "2.3.5.RELEASE" } git = { id = "com.palantir.git-version", version = "0.12.3" } -protobuf = { id = "com.google.protobuf", version = "0.8.17" } +protobuf = { id = "com.google.protobuf", version = "0.9.1" } ktlint = { id = "org.jlleitschuh.gradle.ktlint", version = "10.2.0" } detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } \ No newline at end of file diff --git a/proto/README.adoc b/proto/README.adoc deleted file mode 100644 index bc5ea63d..00000000 --- a/proto/README.adoc +++ /dev/null @@ -1,7 +0,0 @@ -= Emerald Dshackle Protobuf definitions - -Protobuf definition for the external interface (i.e. gRPC) of the Emerald Dshackle. -This gRPC definitions are part of the general Emerald API, please see the project with whole API at https://github.com/emeraldpay/emerald-grpc - -Dshakle also has some internal Protobuf schemas, for example to serialize cached values. -You can find them in link:../src/main/proto/[]. \ No newline at end of file diff --git a/proto/blockchain.proto b/proto/blockchain.proto deleted file mode 100644 index 05d92c3c..00000000 --- a/proto/blockchain.proto +++ /dev/null @@ -1,284 +0,0 @@ -syntax = "proto3"; -package emerald; -option java_package = "io.emeraldpay.api.proto"; -import "common.proto"; - -service Blockchain { - rpc SubscribeHead (Chain) returns (stream ChainHead) {} - rpc SubscribeBalance (BalanceRequest) returns (stream AddressBalance) {} - rpc SubscribeTxStatus (TxStatusRequest) returns (stream TxStatus) {} - - rpc GetBalance (BalanceRequest) returns (stream AddressBalance) {} - - /** - * Fee Estimation service. The server tries to estimate a fair fee based on the last N blocks. - */ - rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse) {} - - rpc NativeCall (NativeCallRequest) returns (stream NativeCallReplyItem) {} - rpc NativeSubscribe (NativeSubscribeRequest) returns (stream NativeSubscribeReplyItem) {} - - rpc Describe (DescribeRequest) returns (DescribeResponse) {} - rpc SubscribeStatus (StatusRequest) returns (stream ChainStatus) {} -} - -message NativeCallRequest { - ChainRef chain = 1; - repeated NativeCallItem items = 2; - Selector selector = 3; - int32 quorum = 4; - AvailabilityEnum min_availability = 5; -} - -message NativeCallItem { - uint32 id = 1; - string method = 3; - bytes payload = 4; - uint64 nonce = 5; -} - -/** - * Signature for a response - */ -message NativeCallReplySignature { - /** - * Original nonce value used for the call - */ - uint64 nonce = 1; - /** - * Signature value - */ - bytes signature = 2; - /** - * Key Id used for the signing - */ - uint64 key_id = 3; - /** - * Id of the upstream produced the response - */ - string upstream_id = 4; -} - -message NativeCallReplyItem { - uint32 id = 1; - bool succeed = 2; - bytes payload = 3; - string errorMessage = 4; - /** - * Optional signature for the response. - * Available only when it's configured at the edge dshackle and nonce is provided wit the request. - */ - NativeCallReplySignature signature = 5; -} - -message NativeSubscribeRequest { - ChainRef chain = 1; - string method = 2; - bytes payload = 3; -} - -message NativeSubscribeReplyItem { - bytes payload = 1; -} - -message ChainHead { - ChainRef chain = 1; - uint64 height = 2; - string block_id = 3; - uint64 timestamp = 4; - bytes weight = 5; - uint64 reorg = 6; -} - -message TxStatusRequest { - ChainRef chain = 1; - string tx_id = 2; - uint32 confirmation_limit = 3; -} - -message TxStatus { - string tx_id = 1; - bool broadcasted = 2; - bool mined = 3; - BlockInfo block = 4; - uint32 confirmations = 5; -} - -message BalanceRequest { - Asset asset = 1; - AnyAddress address = 2; - bool include_utxo = 3; -} - -message AddressBalance { - Asset asset = 1; - SingleAddress address = 2; - string balance = 3; - bool confirmed = 4; - repeated Utxo utxo = 5; -} - -message Utxo { - string tx_id = 1; - uint64 index = 2; - string balance = 3; - bool spent = 4; -} - -message DescribeRequest { -} - -message DescribeResponse { - repeated DescribeChain chains = 1; -} - -message DescribeChain { - ChainRef chain = 1; - ChainStatus status = 2; - repeated NodeDetails nodes = 3; - repeated string supportedMethods = 4; - repeated string excludedMethods = 5; - repeated Capabilities capabilities = 6; -} - -message StatusRequest { - repeated ChainRef chains = 1; -} - -message ChainStatus { - ChainRef chain = 1; - AvailabilityEnum availability = 2; - uint32 quorum = 3; -} - -enum AvailabilityEnum { - AVAIL_UNKNOWN = 0; - AVAIL_OK = 1; - AVAIL_LAGGING = 2; - AVAIL_IMMATURE = 3; - AVAIL_SYNCING = 4; - AVAIL_UNAVAILABLE = 5; -} - -message NodeDetails { - uint32 quorum = 1; - repeated Label labels = 2; -} - -enum Capabilities { - CAP_NONE = 0; - CAP_CALLS = 1; - CAP_BALANCE = 2; -} - -message Label { - string name = 1; - string value = 2; -} - -message Selector { - oneof selector_type { - LabelSelector labelSelector = 1; - OrSelector orSelector = 2; - AndSelector andSelector = 3; - NotSelector notSelector = 4; - ExistsSelector existsSelector = 5; - } -} - -message LabelSelector { - string name = 1; - repeated string value = 2; -} - -message OrSelector { - repeated Selector selectors = 1; -} - -message AndSelector { - repeated Selector selectors = 1; -} - -message NotSelector { - Selector selector = 1; -} - -message ExistsSelector { - string name = 1; -} - -/** - * Request for Fee Estimation Service - */ -message EstimateFeeRequest { - // Target chain - ChainRef chain = 1; - // The way how the fee should be estimated - FeeEstimationMode mode = 2; - // How many blocks the server is supposed to use to estimate current fee. Note that the server may use value, depending on configuration - uint32 blocks = 3; -} - -/** - * Responset for Fee Estimation Service - */ -message EstimateFeeResponse { - // May return different struct, depending on the blockchain - oneof fee_type { - // Standard Ethereum Fee, supported by majority of forks and by Ethereum Mainnet before EIP-1559 - EthereumStdFees ethereumStd = 1; - // Ethereum Fee for EIP-1559 compatible forks - EthereumExtFees ethereumExtended = 2; - // Standard Bitcoin Fee - BitcoinStdFees bitcoinStd = 3; - } -} - -/** - * The mode of how the fee must be estimated - */ -enum FeeEstimationMode { - INVALID = 0; - // Average over last transaction in each block - AVG_LAST = 1; - // Average over transaction 5th from the end in each block - AVG_T5 = 2; - // Average over transaction 20th from the end in each block - AVG_T20 = 3; - // Average over transaction 50th from the end in each block - AVG_T50 = 4; - // Minimal fee that would be accepted by every last block - MIN_ALWAYS = 5; - // Average over transaction in the middle of each block - AVG_MIDDLE = 6; - // Average over transaction in head of each block. Note that for Bitcoin it doesn't count COINBASE tx as top tx. - AVG_TOP = 7; -} - -/** - * Standard Ethereum Fee, supported by majority of forks and by Ethereum Mainnet before EIP-1559 - */ -message EthereumStdFees { - // Big Number encoded as string. Fee value in Wei - string fee = 1; -} - -/** - * Ethereum Fee for EIP-1559 compatible forks - */ -message EthereumExtFees { - // Big Number encoded as string. Estimated fee that expected to be actually paid. I.e. it's the Base Fee + Priority Fee - string expect = 1; - // Big Number encoded as string. Priority Fee in Wei - string priority = 2; - // Big Number encoded as string. Max Fee value in Wei. Note that it only indicates the current preference, and the actual Max may be significantly lower, depending on the usage scenario. - string max = 3; -} - -/** - * Standard Bitcoin Fee - */ -message BitcoinStdFees { - // Fee in Satoshi per Kilobyte. Note that the actual fee calculation MUST divide it by 1024 at the last step to get a fair fee. - uint64 satPerKb = 1; -} diff --git a/proto/common.proto b/proto/common.proto deleted file mode 100644 index 5d299d7e..00000000 --- a/proto/common.proto +++ /dev/null @@ -1,74 +0,0 @@ -syntax = "proto3"; -package emerald; -option java_package = "io.emeraldpay.api.proto"; - -message Chain { - ChainRef type = 1; -} - -enum ChainRef { - CHAIN_UNSPECIFIED = 0; - - CHAIN_BITCOIN = 1; - // CHAIN_GRIN = 2; - - CHAIN_ETHEREUM = 100; - CHAIN_ETHEREUM_CLASSIC = 101; - CHAIN_FANTOM = 102; // Fantom, https://fantom.foundation/ - - // Sidechains and state channels start with 1_000 - // CHAIN_LIGHTNING = 1001; - CHAIN_MATIC = 1002; // Matic PoS Ethereum sidechain based on Polygon - CHAIN_RSK = 1003; // RSK sidechain, https://www.rsk.co/ - - // Testnets start with 10_000 - CHAIN_MORDEN = 10001; - CHAIN_KOVAN = 10002; - CHAIN_TESTNET_BITCOIN = 10003; - // CHAIN_FLOONET = 10004; - CHAIN_GOERLI = 10005; - CHAIN_ROPSTEN = 10006; - CHAIN_RINKEBY = 10007; - - // Non-standard starts from 20_000 -} - -message SingleAddress { - string address = 1; -} - -message XpubAddress { - bytes xpub = 1; - string path = 2; - uint64 start = 3; - uint64 limit = 4; -} - -message MultiAddress { - repeated SingleAddress addresses = 1; -} - -message ReferenceAddress { - uint64 refid = 1; -} - -message AnyAddress { - oneof addr_type { - SingleAddress address_single = 1; - MultiAddress address_multi = 2; - XpubAddress address_xpub = 3; - ReferenceAddress address_ref = 4; - } -} - -message Asset { - ChainRef chain = 1; - string code = 2; -} - -message BlockInfo { - uint64 height = 1; - string block_id = 2; - uint64 timestamp = 3; - bytes weight = 4; -} \ No newline at end of file diff --git a/src/main/kotlin/io/emeraldpay/dshackle/BlockchainType.kt b/src/main/kotlin/io/emeraldpay/dshackle/BlockchainType.kt new file mode 100644 index 00000000..c4993d76 --- /dev/null +++ b/src/main/kotlin/io/emeraldpay/dshackle/BlockchainType.kt @@ -0,0 +1,36 @@ +package io.emeraldpay.dshackle + +enum class BlockchainType { + BITCOIN, EVM_POW, EVM_POS; + + companion object { + @JvmStatic + fun from(chain: Chain): BlockchainType { + if (chain == Chain.TESTNET_ROPSTEN || + chain == Chain.POLYGON || + chain == Chain.OPTIMISM || + chain == Chain.BSC || + chain == Chain.TESTNET_GOERLI || + chain == Chain.ETHEREUM + ) { + return EVM_POS + } + if (chain == Chain.ETHEREUM_CLASSIC || + chain == Chain.ARBITRUM || + chain == Chain.FANTOM || + chain == Chain.RSK || + chain == Chain.TESTNET_KOVAN || + chain == Chain.TESTNET_MORDEN || + chain == Chain.TESTNET_RINKEBY + ) { + return EVM_POW + } + if (chain == Chain.BITCOIN || + chain == Chain.TESTNET_BITCOIN + ) { + return BITCOIN + } + throw IllegalArgumentException("Unknown type of blockchain: $chain") + } + } +} diff --git a/src/main/kotlin/io/emeraldpay/dshackle/Chain.kt b/src/main/kotlin/io/emeraldpay/dshackle/Chain.kt new file mode 100644 index 00000000..c714d97e --- /dev/null +++ b/src/main/kotlin/io/emeraldpay/dshackle/Chain.kt @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2016-2019 ETCDEV GmbH, All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.emeraldpay.dshackle + +enum class Chain(val id: Int, val chainCode: String, val chainName: String) { + UNSPECIFIED(0, "UNSPECIFIED", "Unknown"), + BITCOIN(1, "BTC", "Bitcoin"), // GRIN(2, "GRIN", "Grin"), + + // Networks with tokens + ETHEREUM(100, "ETH", "Ethereum"), + ETHEREUM_CLASSIC(101, "ETC", "Ethereum Classic"), + FANTOM( + 102, + "FTM", + "Fantom" + ), // LIGHTNING(1001, "BTC_LN", "Bitcoin Lightning"), + POLYGON(1002, "POLYGON", "Polygon Matic"), + RSK(1003, "RSK", "Bitcoin RSK"), + ARBITRUM( + 1004, + "ARBITRUM", + "Arbitrum" + ), + OPTIMISM(1005, "OPTIMISM", "Optimism"), + BSC(1006, "BSC", "Binance Smart Chain"), // Testnets + TESTNET_MORDEN(10001, "MORDEN", "Morden Testnet"), + TESTNET_KOVAN(10002, "KOVAN", "Kovan Testnet"), + TESTNET_BITCOIN( + 10003, + "TESTNET_BITCOIN", + "Bitcoin Testnet" + ), // TESTNET_FLOONET(10004, "FLOONET", "Floonet Testnet"), + TESTNET_GOERLI(10005, "GOERLI", "Goerli Testnet"), + TESTNET_ROPSTEN( + 10006, + "ROPSTEN", + "Ropsten Testnet" + ), + TESTNET_RINKEBY(10007, "RINKEBY", "Rinkeby Testnet"); + + companion object { + fun byId(id: Int): Chain { + for (chain in values()) { + if (chain.id == id) { + return chain + } + } + return UNSPECIFIED + } + } +} diff --git a/src/main/kotlin/io/emeraldpay/dshackle/ChainValue.kt b/src/main/kotlin/io/emeraldpay/dshackle/ChainValue.kt index ce947786..a4ea2665 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/ChainValue.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/ChainValue.kt @@ -16,7 +16,6 @@ package io.emeraldpay.dshackle import io.emeraldpay.api.proto.Common -import io.emeraldpay.grpc.Chain import java.util.EnumMap import java.util.concurrent.locks.ReentrantLock import kotlin.concurrent.withLock diff --git a/src/main/kotlin/io/emeraldpay/dshackle/Global.kt b/src/main/kotlin/io/emeraldpay/dshackle/Global.kt index 29ff88cc..7be3c202 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/Global.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/Global.kt @@ -27,7 +27,6 @@ import io.emeraldpay.dshackle.upstream.bitcoin.data.RpcUnspent import io.emeraldpay.dshackle.upstream.bitcoin.data.RpcUnspentDeserializer import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse -import io.emeraldpay.grpc.Chain import java.text.SimpleDateFormat import java.util.Locale import java.util.TimeZone diff --git a/src/main/kotlin/io/emeraldpay/dshackle/SilentException.kt b/src/main/kotlin/io/emeraldpay/dshackle/SilentException.kt index e92e67f1..8c1e9ad2 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/SilentException.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/SilentException.kt @@ -16,7 +16,6 @@ package io.emeraldpay.dshackle import io.emeraldpay.dshackle.upstream.Selector -import io.emeraldpay.grpc.Chain /** * Exception that should be handled/logged without a stacktrace in production diff --git a/src/main/kotlin/io/emeraldpay/dshackle/cache/BlocksRedisCache.kt b/src/main/kotlin/io/emeraldpay/dshackle/cache/BlocksRedisCache.kt index c4c421e8..be7b4b17 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/cache/BlocksRedisCache.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/cache/BlocksRedisCache.kt @@ -16,12 +16,12 @@ package io.emeraldpay.dshackle.cache import com.google.protobuf.ByteString +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.data.BlockContainer import io.emeraldpay.dshackle.data.BlockId import io.emeraldpay.dshackle.data.TxId import io.emeraldpay.dshackle.proto.CachesProto import io.emeraldpay.dshackle.reader.Reader -import io.emeraldpay.grpc.Chain import io.lettuce.core.api.reactive.RedisReactiveCommands import org.slf4j.LoggerFactory import reactor.core.publisher.Mono diff --git a/src/main/kotlin/io/emeraldpay/dshackle/cache/CachesFactory.kt b/src/main/kotlin/io/emeraldpay/dshackle/cache/CachesFactory.kt index c37b2aca..99e1fcd6 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/cache/CachesFactory.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/cache/CachesFactory.kt @@ -15,8 +15,8 @@ */ package io.emeraldpay.dshackle.cache +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.config.CacheConfig -import io.emeraldpay.grpc.Chain import io.lettuce.core.RedisClient import io.lettuce.core.RedisConnectionException import io.lettuce.core.RedisURI @@ -42,7 +42,7 @@ open class CachesFactory( } private var redis: StatefulRedisConnection? = null - private val all = EnumMap(io.emeraldpay.grpc.Chain::class.java) + private val all = EnumMap(Chain::class.java) @PostConstruct fun init() { diff --git a/src/main/kotlin/io/emeraldpay/dshackle/cache/HeightByHashRedisCache.kt b/src/main/kotlin/io/emeraldpay/dshackle/cache/HeightByHashRedisCache.kt index c9c37dca..4ccaa13b 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/cache/HeightByHashRedisCache.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/cache/HeightByHashRedisCache.kt @@ -15,10 +15,10 @@ */ package io.emeraldpay.dshackle.cache +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.data.BlockContainer import io.emeraldpay.dshackle.data.BlockId import io.emeraldpay.dshackle.reader.Reader -import io.emeraldpay.grpc.Chain import io.lettuce.core.api.reactive.RedisReactiveCommands import org.slf4j.LoggerFactory import reactor.core.publisher.Mono diff --git a/src/main/kotlin/io/emeraldpay/dshackle/cache/OnBlockRedisCache.kt b/src/main/kotlin/io/emeraldpay/dshackle/cache/OnBlockRedisCache.kt index b4f99c8c..44006440 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/cache/OnBlockRedisCache.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/cache/OnBlockRedisCache.kt @@ -16,12 +16,12 @@ package io.emeraldpay.dshackle.cache import com.google.protobuf.ByteString +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.data.BlockContainer import io.emeraldpay.dshackle.data.BlockId import io.emeraldpay.dshackle.proto.CachesProto import io.emeraldpay.dshackle.proto.CachesProto.ValueContainer import io.emeraldpay.dshackle.reader.Reader -import io.emeraldpay.grpc.Chain import io.lettuce.core.api.reactive.RedisReactiveCommands import org.slf4j.LoggerFactory import reactor.core.publisher.Mono diff --git a/src/main/kotlin/io/emeraldpay/dshackle/cache/OnTxRedisCache.kt b/src/main/kotlin/io/emeraldpay/dshackle/cache/OnTxRedisCache.kt index 912ffc1d..51dc2ec9 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/cache/OnTxRedisCache.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/cache/OnTxRedisCache.kt @@ -16,12 +16,12 @@ package io.emeraldpay.dshackle.cache import com.google.protobuf.ByteString +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.data.BlockContainer import io.emeraldpay.dshackle.data.TxId import io.emeraldpay.dshackle.proto.CachesProto import io.emeraldpay.dshackle.reader.Reader import io.emeraldpay.dshackle.upstream.Head -import io.emeraldpay.grpc.Chain import io.lettuce.core.api.reactive.RedisReactiveCommands import org.slf4j.LoggerFactory import reactor.core.publisher.Mono diff --git a/src/main/kotlin/io/emeraldpay/dshackle/cache/ReceiptRedisCache.kt b/src/main/kotlin/io/emeraldpay/dshackle/cache/ReceiptRedisCache.kt index 3ffad9e7..0e648c15 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/cache/ReceiptRedisCache.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/cache/ReceiptRedisCache.kt @@ -15,10 +15,10 @@ */ package io.emeraldpay.dshackle.cache +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.data.DefaultContainer import io.emeraldpay.dshackle.proto.CachesProto import io.emeraldpay.etherjar.rpc.json.TransactionReceiptJson -import io.emeraldpay.grpc.Chain import io.lettuce.core.api.reactive.RedisReactiveCommands import reactor.core.publisher.Mono diff --git a/src/main/kotlin/io/emeraldpay/dshackle/cache/TxRedisCache.kt b/src/main/kotlin/io/emeraldpay/dshackle/cache/TxRedisCache.kt index 2daae9d1..0fc40ab9 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/cache/TxRedisCache.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/cache/TxRedisCache.kt @@ -16,13 +16,13 @@ package io.emeraldpay.dshackle.cache import com.google.protobuf.ByteString +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.data.BlockContainer import io.emeraldpay.dshackle.data.BlockId import io.emeraldpay.dshackle.data.TxContainer import io.emeraldpay.dshackle.data.TxId import io.emeraldpay.dshackle.proto.CachesProto import io.emeraldpay.dshackle.reader.Reader -import io.emeraldpay.grpc.Chain import io.lettuce.core.api.reactive.RedisReactiveCommands import org.slf4j.LoggerFactory import reactor.core.publisher.Mono diff --git a/src/main/kotlin/io/emeraldpay/dshackle/config/HealthConfig.kt b/src/main/kotlin/io/emeraldpay/dshackle/config/HealthConfig.kt index cf81781c..2a772390 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/config/HealthConfig.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/config/HealthConfig.kt @@ -15,7 +15,7 @@ */ package io.emeraldpay.dshackle.config -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain class HealthConfig { diff --git a/src/main/kotlin/io/emeraldpay/dshackle/config/HealthConfigReader.kt b/src/main/kotlin/io/emeraldpay/dshackle/config/HealthConfigReader.kt index 901c443d..fb6a23f7 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/config/HealthConfigReader.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/config/HealthConfigReader.kt @@ -15,8 +15,8 @@ */ package io.emeraldpay.dshackle.config +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.Global -import io.emeraldpay.grpc.Chain import org.slf4j.LoggerFactory import org.yaml.snakeyaml.nodes.CollectionNode import org.yaml.snakeyaml.nodes.MappingNode diff --git a/src/main/kotlin/io/emeraldpay/dshackle/config/ProxyConfig.kt b/src/main/kotlin/io/emeraldpay/dshackle/config/ProxyConfig.kt index c5a47254..ddca3a67 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/config/ProxyConfig.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/config/ProxyConfig.kt @@ -16,7 +16,7 @@ */ package io.emeraldpay.dshackle.config -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain /** * Configure HTTP Proxy to Upstreams diff --git a/src/main/kotlin/io/emeraldpay/dshackle/config/ProxyConfigReader.kt b/src/main/kotlin/io/emeraldpay/dshackle/config/ProxyConfigReader.kt index 0dc6b4a6..9c53dca1 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/config/ProxyConfigReader.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/config/ProxyConfigReader.kt @@ -16,8 +16,8 @@ */ package io.emeraldpay.dshackle.config +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.Global -import io.emeraldpay.grpc.Chain import org.apache.commons.lang3.StringUtils import org.slf4j.LoggerFactory import org.yaml.snakeyaml.nodes.MappingNode diff --git a/src/main/kotlin/io/emeraldpay/dshackle/config/TokensConfig.kt b/src/main/kotlin/io/emeraldpay/dshackle/config/TokensConfig.kt index d0944965..afa485e3 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/config/TokensConfig.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/config/TokensConfig.kt @@ -15,9 +15,9 @@ */ package io.emeraldpay.dshackle.config +import io.emeraldpay.dshackle.BlockchainType +import io.emeraldpay.dshackle.Chain import io.emeraldpay.etherjar.domain.Address -import io.emeraldpay.grpc.BlockchainType -import io.emeraldpay.grpc.Chain class TokensConfig( val tokens: List diff --git a/src/main/kotlin/io/emeraldpay/dshackle/config/context/MultistreamsConfig.kt b/src/main/kotlin/io/emeraldpay/dshackle/config/context/MultistreamsConfig.kt index 3329f93e..c3925848 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/config/context/MultistreamsConfig.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/config/context/MultistreamsConfig.kt @@ -1,13 +1,13 @@ package io.emeraldpay.dshackle.config.context +import io.emeraldpay.dshackle.BlockchainType +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.cache.CachesFactory import io.emeraldpay.dshackle.upstream.CallTargetsHolder import io.emeraldpay.dshackle.upstream.Multistream import io.emeraldpay.dshackle.upstream.bitcoin.BitcoinMultistream import io.emeraldpay.dshackle.upstream.ethereum.EthereumMultistream import io.emeraldpay.dshackle.upstream.ethereum.EthereumPosMultiStream -import io.emeraldpay.grpc.BlockchainType -import io.emeraldpay.grpc.Chain import org.springframework.beans.factory.config.ConfigurableListableBeanFactory import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration diff --git a/src/main/kotlin/io/emeraldpay/dshackle/monitoring/accesslog/AccessHandlerHttp.kt b/src/main/kotlin/io/emeraldpay/dshackle/monitoring/accesslog/AccessHandlerHttp.kt index 4b525349..7cea5cf2 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/monitoring/accesslog/AccessHandlerHttp.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/monitoring/accesslog/AccessHandlerHttp.kt @@ -1,9 +1,9 @@ package io.emeraldpay.dshackle.monitoring.accesslog import io.emeraldpay.api.proto.BlockchainOuterClass +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.config.MainConfig import io.emeraldpay.dshackle.rpc.NativeCall -import io.emeraldpay.grpc.Chain import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Service diff --git a/src/main/kotlin/io/emeraldpay/dshackle/monitoring/accesslog/Events.kt b/src/main/kotlin/io/emeraldpay/dshackle/monitoring/accesslog/Events.kt index c08aabc5..f69f9a4a 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/monitoring/accesslog/Events.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/monitoring/accesslog/Events.kt @@ -16,7 +16,7 @@ package io.emeraldpay.dshackle.monitoring.accesslog import com.fasterxml.jackson.annotation.JsonInclude -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import org.slf4j.LoggerFactory import java.time.Instant import java.util.UUID diff --git a/src/main/kotlin/io/emeraldpay/dshackle/monitoring/accesslog/EventsBuilder.kt b/src/main/kotlin/io/emeraldpay/dshackle/monitoring/accesslog/EventsBuilder.kt index 9b588d40..4049570a 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/monitoring/accesslog/EventsBuilder.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/monitoring/accesslog/EventsBuilder.kt @@ -17,8 +17,8 @@ package io.emeraldpay.dshackle.monitoring.accesslog import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.Common +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.config.AccessLogConfig -import io.emeraldpay.grpc.Chain import io.grpc.Attributes import io.grpc.Grpc import io.grpc.Metadata diff --git a/src/main/kotlin/io/emeraldpay/dshackle/proxy/BaseHandler.kt b/src/main/kotlin/io/emeraldpay/dshackle/proxy/BaseHandler.kt index 7025260e..ba31cdae 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/proxy/BaseHandler.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/proxy/BaseHandler.kt @@ -17,9 +17,9 @@ package io.emeraldpay.dshackle.proxy import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.Common +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.monitoring.accesslog.AccessHandlerHttp import io.emeraldpay.dshackle.rpc.NativeCall -import io.emeraldpay.grpc.Chain import org.reactivestreams.Publisher import org.slf4j.LoggerFactory import reactor.core.publisher.Flux diff --git a/src/main/kotlin/io/emeraldpay/dshackle/proxy/HttpHandler.kt b/src/main/kotlin/io/emeraldpay/dshackle/proxy/HttpHandler.kt index 56f52313..aff381e9 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/proxy/HttpHandler.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/proxy/HttpHandler.kt @@ -15,13 +15,13 @@ */ package io.emeraldpay.dshackle.proxy +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.Global import io.emeraldpay.dshackle.config.ProxyConfig import io.emeraldpay.dshackle.monitoring.accesslog.AccessHandlerHttp import io.emeraldpay.dshackle.rpc.NativeCall import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse import io.emeraldpay.etherjar.rpc.RpcException -import io.emeraldpay.grpc.Chain import io.netty.buffer.ByteBuf import io.netty.buffer.Unpooled import org.reactivestreams.Publisher diff --git a/src/main/kotlin/io/emeraldpay/dshackle/proxy/ProxyServer.kt b/src/main/kotlin/io/emeraldpay/dshackle/proxy/ProxyServer.kt index 9d84e9d0..4061e182 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/proxy/ProxyServer.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/proxy/ProxyServer.kt @@ -16,13 +16,13 @@ */ package io.emeraldpay.dshackle.proxy +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.Global import io.emeraldpay.dshackle.TlsSetup import io.emeraldpay.dshackle.config.ProxyConfig import io.emeraldpay.dshackle.monitoring.accesslog.AccessHandlerHttp import io.emeraldpay.dshackle.rpc.NativeCall import io.emeraldpay.dshackle.rpc.NativeSubscribe -import io.emeraldpay.grpc.Chain import io.micrometer.core.instrument.Counter import io.micrometer.core.instrument.Metrics import io.micrometer.core.instrument.Timer diff --git a/src/main/kotlin/io/emeraldpay/dshackle/proxy/WebsocketHandler.kt b/src/main/kotlin/io/emeraldpay/dshackle/proxy/WebsocketHandler.kt index e15be1ba..43928632 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/proxy/WebsocketHandler.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/proxy/WebsocketHandler.kt @@ -18,6 +18,7 @@ package io.emeraldpay.dshackle.proxy import com.google.protobuf.ByteString import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.BlockchainOuterClass.Selector +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.Global import io.emeraldpay.dshackle.config.ProxyConfig import io.emeraldpay.dshackle.monitoring.accesslog.AccessHandlerHttp @@ -25,7 +26,6 @@ import io.emeraldpay.dshackle.rpc.NativeCall import io.emeraldpay.dshackle.rpc.NativeSubscribe import io.emeraldpay.etherjar.rpc.json.RequestJson import io.emeraldpay.etherjar.rpc.json.ResponseJson -import io.emeraldpay.grpc.Chain import io.netty.buffer.ByteBufInputStream import io.netty.buffer.Unpooled import org.reactivestreams.Publisher diff --git a/src/main/kotlin/io/emeraldpay/dshackle/rpc/BlockchainRpc.kt b/src/main/kotlin/io/emeraldpay/dshackle/rpc/BlockchainRpc.kt index 10e7f108..15607fae 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/rpc/BlockchainRpc.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/rpc/BlockchainRpc.kt @@ -19,9 +19,9 @@ package io.emeraldpay.dshackle.rpc import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.Common import io.emeraldpay.api.proto.ReactorBlockchainGrpc +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.ChainValue import io.emeraldpay.dshackle.SilentException -import io.emeraldpay.grpc.Chain import io.micrometer.core.instrument.Counter import io.micrometer.core.instrument.Metrics import io.micrometer.core.instrument.Timer diff --git a/src/main/kotlin/io/emeraldpay/dshackle/rpc/EstimateFee.kt b/src/main/kotlin/io/emeraldpay/dshackle/rpc/EstimateFee.kt index 8328c45e..04c5207e 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/rpc/EstimateFee.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/rpc/EstimateFee.kt @@ -1,9 +1,9 @@ package io.emeraldpay.dshackle.rpc import io.emeraldpay.api.proto.BlockchainOuterClass +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.upstream.ChainFees import io.emeraldpay.dshackle.upstream.MultistreamHolder -import io.emeraldpay.grpc.Chain import io.grpc.Status import io.grpc.StatusException import org.slf4j.LoggerFactory diff --git a/src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeCall.kt b/src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeCall.kt index 93926399..288bfcb6 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeCall.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeCall.kt @@ -19,6 +19,8 @@ package io.emeraldpay.dshackle.rpc import com.fasterxml.jackson.databind.ObjectMapper import com.google.protobuf.ByteString import io.emeraldpay.api.proto.BlockchainOuterClass +import io.emeraldpay.dshackle.BlockchainType +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.Global import io.emeraldpay.dshackle.SilentException import io.emeraldpay.dshackle.quorum.CallQuorum @@ -39,8 +41,6 @@ import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse import io.emeraldpay.dshackle.upstream.signature.ResponseSigner import io.emeraldpay.etherjar.rpc.RpcException import io.emeraldpay.etherjar.rpc.RpcResponseError -import io.emeraldpay.grpc.BlockchainType -import io.emeraldpay.grpc.Chain import io.micrometer.core.instrument.Metrics import org.apache.commons.lang3.StringUtils import org.slf4j.LoggerFactory diff --git a/src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeSubscribe.kt b/src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeSubscribe.kt index 6edd8027..4f7e23a9 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeSubscribe.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeSubscribe.kt @@ -18,6 +18,8 @@ package io.emeraldpay.dshackle.rpc import com.google.protobuf.ByteString import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.BlockchainOuterClass.NativeSubscribeReplyItem +import io.emeraldpay.dshackle.BlockchainType +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.Global import io.emeraldpay.dshackle.SilentException import io.emeraldpay.dshackle.upstream.MultistreamHolder @@ -25,8 +27,6 @@ import io.emeraldpay.dshackle.upstream.Selector import io.emeraldpay.dshackle.upstream.ethereum.EthereumLikeMultistream import io.emeraldpay.dshackle.upstream.ethereum.subscribe.json.HasUpstream import io.emeraldpay.dshackle.upstream.signature.ResponseSigner -import io.emeraldpay.grpc.BlockchainType -import io.emeraldpay.grpc.Chain import io.grpc.Status import io.grpc.StatusException import org.reactivestreams.Publisher diff --git a/src/main/kotlin/io/emeraldpay/dshackle/rpc/StreamHead.kt b/src/main/kotlin/io/emeraldpay/dshackle/rpc/StreamHead.kt index 9aad6002..b8384c8e 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/rpc/StreamHead.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/rpc/StreamHead.kt @@ -19,9 +19,9 @@ package io.emeraldpay.dshackle.rpc import com.google.protobuf.ByteString import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.Common +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.data.BlockContainer import io.emeraldpay.dshackle.upstream.MultistreamHolder -import io.emeraldpay.grpc.Chain import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Service diff --git a/src/main/kotlin/io/emeraldpay/dshackle/rpc/SubscribeStatus.kt b/src/main/kotlin/io/emeraldpay/dshackle/rpc/SubscribeStatus.kt index 74ed1b27..5b75f605 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/rpc/SubscribeStatus.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/rpc/SubscribeStatus.kt @@ -18,10 +18,10 @@ package io.emeraldpay.dshackle.rpc import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.Common +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.upstream.Multistream import io.emeraldpay.dshackle.upstream.MultistreamHolder import io.emeraldpay.dshackle.upstream.UpstreamAvailability -import io.emeraldpay.grpc.Chain import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Service import reactor.core.publisher.Flux diff --git a/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackAddress.kt b/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackAddress.kt index df7d0210..005aed42 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackAddress.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackAddress.kt @@ -16,7 +16,7 @@ package io.emeraldpay.dshackle.rpc import io.emeraldpay.api.proto.BlockchainOuterClass -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import reactor.core.publisher.Flux /** diff --git a/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackBitcoinAddress.kt b/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackBitcoinAddress.kt index d64b493c..9df5ed7d 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackBitcoinAddress.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackBitcoinAddress.kt @@ -18,6 +18,8 @@ package io.emeraldpay.dshackle.rpc import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.Common import io.emeraldpay.api.proto.ReactorBlockchainGrpc +import io.emeraldpay.dshackle.BlockchainType +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.Defaults import io.emeraldpay.dshackle.SilentException import io.emeraldpay.dshackle.startup.UpstreamChangeEvent @@ -27,8 +29,6 @@ import io.emeraldpay.dshackle.upstream.Selector import io.emeraldpay.dshackle.upstream.bitcoin.BitcoinMultistream import io.emeraldpay.dshackle.upstream.bitcoin.data.SimpleUnspent import io.emeraldpay.dshackle.upstream.grpc.BitcoinGrpcUpstream -import io.emeraldpay.grpc.BlockchainType -import io.emeraldpay.grpc.Chain import org.apache.commons.lang3.StringUtils import org.bitcoinj.params.MainNetParams import org.bitcoinj.params.TestNet3Params diff --git a/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackBitcoinTx.kt b/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackBitcoinTx.kt index 6a0e0b3d..aec22cc7 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackBitcoinTx.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackBitcoinTx.kt @@ -17,12 +17,12 @@ package io.emeraldpay.dshackle.rpc import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.Common +import io.emeraldpay.dshackle.BlockchainType +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.SilentException import io.emeraldpay.dshackle.upstream.MultistreamHolder import io.emeraldpay.dshackle.upstream.bitcoin.BitcoinMultistream import io.emeraldpay.dshackle.upstream.bitcoin.ExtractBlock -import io.emeraldpay.grpc.BlockchainType -import io.emeraldpay.grpc.Chain import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Service diff --git a/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackERC20Address.kt b/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackERC20Address.kt index 6de9b522..86d47329 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackERC20Address.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackERC20Address.kt @@ -17,6 +17,8 @@ package io.emeraldpay.dshackle.rpc import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.Common +import io.emeraldpay.dshackle.BlockchainType +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.SilentException import io.emeraldpay.dshackle.config.TokensConfig import io.emeraldpay.dshackle.upstream.MultistreamHolder @@ -26,8 +28,6 @@ import io.emeraldpay.dshackle.upstream.ethereum.EthereumPosMultiStream import io.emeraldpay.etherjar.domain.Address import io.emeraldpay.etherjar.domain.EventId import io.emeraldpay.etherjar.erc20.ERC20Token -import io.emeraldpay.grpc.BlockchainType -import io.emeraldpay.grpc.Chain import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Service diff --git a/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackEthereumAddress.kt b/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackEthereumAddress.kt index 4bef295d..28359419 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackEthereumAddress.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackEthereumAddress.kt @@ -18,14 +18,14 @@ package io.emeraldpay.dshackle.rpc import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.Common +import io.emeraldpay.dshackle.BlockchainType +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.Defaults import io.emeraldpay.dshackle.SilentException import io.emeraldpay.dshackle.upstream.MultistreamHolder import io.emeraldpay.dshackle.upstream.ethereum.EthereumPosMultiStream import io.emeraldpay.etherjar.domain.Address import io.emeraldpay.etherjar.domain.Wei -import io.emeraldpay.grpc.BlockchainType -import io.emeraldpay.grpc.Chain import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Service diff --git a/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackEthereumTx.kt b/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackEthereumTx.kt index 75401d78..d37af85b 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackEthereumTx.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackEthereumTx.kt @@ -18,6 +18,8 @@ package io.emeraldpay.dshackle.rpc import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.Common +import io.emeraldpay.dshackle.BlockchainType +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.SilentException import io.emeraldpay.dshackle.data.BlockContainer import io.emeraldpay.dshackle.data.TxId @@ -29,8 +31,6 @@ import io.emeraldpay.etherjar.rpc.RpcException import io.emeraldpay.etherjar.rpc.json.BlockJson import io.emeraldpay.etherjar.rpc.json.TransactionJson import io.emeraldpay.etherjar.rpc.json.TransactionRefJson -import io.emeraldpay.grpc.BlockchainType -import io.emeraldpay.grpc.Chain import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Service diff --git a/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackTx.kt b/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackTx.kt index 4fe8b3a6..3b851152 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackTx.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackTx.kt @@ -16,7 +16,7 @@ package io.emeraldpay.dshackle.rpc import io.emeraldpay.api.proto.BlockchainOuterClass -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import reactor.core.publisher.Flux interface TrackTx { diff --git a/src/main/kotlin/io/emeraldpay/dshackle/startup/ConfiguredUpstreams.kt b/src/main/kotlin/io/emeraldpay/dshackle/startup/ConfiguredUpstreams.kt index 51aed124..1cfc3a57 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/startup/ConfiguredUpstreams.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/startup/ConfiguredUpstreams.kt @@ -17,6 +17,8 @@ package io.emeraldpay.dshackle.startup import com.google.common.annotations.VisibleForTesting +import io.emeraldpay.dshackle.BlockchainType +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.FileResolver import io.emeraldpay.dshackle.Global import io.emeraldpay.dshackle.config.UpstreamsConfig @@ -41,8 +43,6 @@ import io.emeraldpay.dshackle.upstream.forkchoice.NoChoiceWithPriorityForkChoice import io.emeraldpay.dshackle.upstream.grpc.GrpcUpstreams import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse -import io.emeraldpay.grpc.BlockchainType -import io.emeraldpay.grpc.Chain import org.slf4j.LoggerFactory import org.springframework.boot.ApplicationArguments import org.springframework.boot.ApplicationRunner diff --git a/src/main/kotlin/io/emeraldpay/dshackle/startup/UpstreamChangeEvent.kt b/src/main/kotlin/io/emeraldpay/dshackle/startup/UpstreamChangeEvent.kt index 34bcc8bf..1b8f35de 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/startup/UpstreamChangeEvent.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/startup/UpstreamChangeEvent.kt @@ -16,10 +16,10 @@ */ package io.emeraldpay.dshackle.startup +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.cache.Caches import io.emeraldpay.dshackle.cache.CachesEnabled import io.emeraldpay.dshackle.upstream.Upstream -import io.emeraldpay.grpc.Chain /** * An update event to the list of currently available upstreams. diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/CallTargetsHolder.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/CallTargetsHolder.kt index 2ad03f39..f868c8b0 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/CallTargetsHolder.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/CallTargetsHolder.kt @@ -1,10 +1,10 @@ package io.emeraldpay.dshackle.upstream +import io.emeraldpay.dshackle.BlockchainType +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.upstream.calls.CallMethods import io.emeraldpay.dshackle.upstream.calls.DefaultBitcoinMethods import io.emeraldpay.dshackle.upstream.calls.DefaultEthereumMethods -import io.emeraldpay.grpc.BlockchainType -import io.emeraldpay.grpc.Chain import org.springframework.stereotype.Component import java.util.HashMap diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/CurrentMultistreamHolder.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/CurrentMultistreamHolder.kt index 54a152b3..a15ead29 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/CurrentMultistreamHolder.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/CurrentMultistreamHolder.kt @@ -16,7 +16,7 @@ */ package io.emeraldpay.dshackle.upstream -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import org.slf4j.LoggerFactory import org.springframework.stereotype.Component import javax.annotation.PreDestroy diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/FilteredApis.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/FilteredApis.kt index 36ee6615..ab53deed 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/FilteredApis.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/FilteredApis.kt @@ -16,9 +16,9 @@ */ package io.emeraldpay.dshackle.upstream +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.Global import io.emeraldpay.dshackle.config.UpstreamsConfig -import io.emeraldpay.grpc.Chain import io.micrometer.core.instrument.DistributionSummary import io.micrometer.core.instrument.Metrics import io.micrometer.core.instrument.Tag diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/HttpFactory.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/HttpFactory.kt index 359476ed..ea6359b7 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/HttpFactory.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/HttpFactory.kt @@ -1,9 +1,9 @@ package io.emeraldpay.dshackle.upstream +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.reader.Reader import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse -import io.emeraldpay.grpc.Chain interface HttpFactory { fun create(id: String?, chain: Chain): Reader diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/HttpRpcFactory.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/HttpRpcFactory.kt index adf0aafd..a0f97c8c 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/HttpRpcFactory.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/HttpRpcFactory.kt @@ -1,12 +1,12 @@ package io.emeraldpay.dshackle.upstream +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.config.AuthConfig import io.emeraldpay.dshackle.reader.Reader import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcHttpClient import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse import io.emeraldpay.dshackle.upstream.rpcclient.RpcMetrics -import io.emeraldpay.grpc.Chain import io.micrometer.core.instrument.Counter import io.micrometer.core.instrument.Metrics import io.micrometer.core.instrument.Tag diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/Multistream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/Multistream.kt index b6de244c..4e239048 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/Multistream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/Multistream.kt @@ -16,6 +16,7 @@ */ package io.emeraldpay.dshackle.upstream +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.cache.Caches import io.emeraldpay.dshackle.cache.CachesEnabled import io.emeraldpay.dshackle.config.UpstreamsConfig @@ -25,7 +26,6 @@ import io.emeraldpay.dshackle.upstream.calls.AggregatedCallMethods import io.emeraldpay.dshackle.upstream.calls.CallMethods import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse -import io.emeraldpay.grpc.Chain import io.micrometer.core.instrument.Metrics import io.micrometer.core.instrument.Tag import org.apache.commons.collections4.Factory diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/MultistreamHolder.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/MultistreamHolder.kt index 80b4e564..b2c0a753 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/MultistreamHolder.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/MultistreamHolder.kt @@ -16,7 +16,7 @@ */ package io.emeraldpay.dshackle.upstream -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain /** * Holds Multistreams configured for a chain. diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinMultistream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinMultistream.kt index aca3d567..3393fd82 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinMultistream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinMultistream.kt @@ -15,6 +15,7 @@ */ package io.emeraldpay.dshackle.upstream.bitcoin +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.cache.Caches import io.emeraldpay.dshackle.config.UpstreamsConfig import io.emeraldpay.dshackle.reader.Reader @@ -24,7 +25,6 @@ import io.emeraldpay.dshackle.upstream.calls.DefaultBitcoinMethods import io.emeraldpay.dshackle.upstream.forkchoice.MostWorkForkChoice import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse -import io.emeraldpay.grpc.Chain import org.slf4j.LoggerFactory import reactor.core.publisher.Mono diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinRpcUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinRpcUpstream.kt index 23b82f35..2f500bf8 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinRpcUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinRpcUpstream.kt @@ -15,6 +15,7 @@ */ package io.emeraldpay.dshackle.upstream.bitcoin +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.config.UpstreamsConfig import io.emeraldpay.dshackle.reader.Reader import io.emeraldpay.dshackle.startup.QuorumForLabels @@ -26,7 +27,6 @@ import io.emeraldpay.dshackle.upstream.UpstreamAvailability import io.emeraldpay.dshackle.upstream.calls.CallMethods import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse -import io.emeraldpay.grpc.Chain import org.slf4j.LoggerFactory import reactor.core.Disposable diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinUpstream.kt index b09709ff..330d645e 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinUpstream.kt @@ -15,12 +15,12 @@ */ package io.emeraldpay.dshackle.upstream.bitcoin +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.config.UpstreamsConfig import io.emeraldpay.dshackle.startup.QuorumForLabels import io.emeraldpay.dshackle.upstream.DefaultUpstream import io.emeraldpay.dshackle.upstream.calls.CallMethods import io.emeraldpay.dshackle.upstream.calls.DefaultBitcoinMethods -import io.emeraldpay.grpc.Chain import org.slf4j.LoggerFactory abstract class BitcoinUpstream( 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 6f78cfe0..29994819 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt @@ -16,6 +16,7 @@ */ package io.emeraldpay.dshackle.upstream.calls +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.Global import io.emeraldpay.dshackle.quorum.AlwaysQuorum import io.emeraldpay.dshackle.quorum.BroadcastQuorum @@ -23,7 +24,6 @@ import io.emeraldpay.dshackle.quorum.CallQuorum import io.emeraldpay.dshackle.quorum.NonceQuorum import io.emeraldpay.dshackle.quorum.NotLaggingQuorum import io.emeraldpay.etherjar.rpc.RpcException -import io.emeraldpay.grpc.Chain /** * Default configuration for Ethereum based RPC. Defines optimal Quorum strategies for different methods, and provides 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 fd7f4cf3..69bb9ac7 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumMultistream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumMultistream.kt @@ -17,6 +17,7 @@ package io.emeraldpay.dshackle.upstream.ethereum import io.emeraldpay.api.proto.BlockchainOuterClass +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.cache.Caches import io.emeraldpay.dshackle.config.UpstreamsConfig import io.emeraldpay.dshackle.reader.Reader @@ -26,7 +27,6 @@ import io.emeraldpay.dshackle.upstream.forkchoice.MostWorkForkChoice import io.emeraldpay.dshackle.upstream.grpc.GrpcUpstream import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse -import io.emeraldpay.grpc.Chain import org.slf4j.LoggerFactory import org.springframework.util.ConcurrentReferenceHashMap import reactor.core.publisher.Flux diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumRpcUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumRpcUpstream.kt index bb2479df..164c60ee 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumRpcUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumRpcUpstream.kt @@ -16,6 +16,7 @@ */ package io.emeraldpay.dshackle.upstream.ethereum +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.cache.Caches import io.emeraldpay.dshackle.cache.CachesEnabled import io.emeraldpay.dshackle.config.UpstreamsConfig @@ -29,7 +30,6 @@ import io.emeraldpay.dshackle.upstream.ethereum.connectors.ConnectorFactory import io.emeraldpay.dshackle.upstream.ethereum.connectors.EthereumConnector import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse -import io.emeraldpay.grpc.Chain import org.slf4j.LoggerFactory import org.springframework.context.Lifecycle import reactor.core.Disposable diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumWsFactory.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumWsFactory.kt index fee1674d..9d926b5b 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumWsFactory.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumWsFactory.kt @@ -16,11 +16,11 @@ */ package io.emeraldpay.dshackle.upstream.ethereum +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.config.AuthConfig import io.emeraldpay.dshackle.config.UpstreamsConfig import io.emeraldpay.dshackle.upstream.DefaultUpstream import io.emeraldpay.dshackle.upstream.rpcclient.RpcMetrics -import io.emeraldpay.grpc.Chain import io.micrometer.core.instrument.Counter import io.micrometer.core.instrument.Metrics import io.micrometer.core.instrument.Tag diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/connectors/ConnectorFactory.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/connectors/ConnectorFactory.kt index 0e0d21e5..5dc4100e 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/connectors/ConnectorFactory.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/connectors/ConnectorFactory.kt @@ -1,8 +1,8 @@ package io.emeraldpay.dshackle.upstream.ethereum.connectors +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.upstream.DefaultUpstream import io.emeraldpay.dshackle.upstream.ethereum.EthereumUpstreamValidator -import io.emeraldpay.grpc.Chain interface ConnectorFactory { fun create(upstream: DefaultUpstream, validator: EthereumUpstreamValidator, chain: Chain): EthereumConnector diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/connectors/EthereumConnectorFactory.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/connectors/EthereumConnectorFactory.kt index f23efb6f..c5393408 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/connectors/EthereumConnectorFactory.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/connectors/EthereumConnectorFactory.kt @@ -1,12 +1,12 @@ package io.emeraldpay.dshackle.upstream.ethereum.connectors +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.upstream.BlockValidator import io.emeraldpay.dshackle.upstream.DefaultUpstream import io.emeraldpay.dshackle.upstream.HttpFactory import io.emeraldpay.dshackle.upstream.ethereum.EthereumUpstreamValidator import io.emeraldpay.dshackle.upstream.ethereum.EthereumWsFactory import io.emeraldpay.dshackle.upstream.forkchoice.ForkChoice -import io.emeraldpay.grpc.Chain import org.slf4j.LoggerFactory open class EthereumConnectorFactory( diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosMultiStream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosMultiStream.kt index 71477c37..252ce212 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosMultiStream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosMultiStream.kt @@ -17,6 +17,7 @@ package io.emeraldpay.dshackle.upstream.ethereum import io.emeraldpay.api.proto.BlockchainOuterClass +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.cache.Caches import io.emeraldpay.dshackle.config.UpstreamsConfig import io.emeraldpay.dshackle.reader.Reader @@ -26,7 +27,6 @@ import io.emeraldpay.dshackle.upstream.forkchoice.PriorityForkChoice import io.emeraldpay.dshackle.upstream.grpc.GrpcUpstream import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse -import io.emeraldpay.grpc.Chain import org.slf4j.LoggerFactory import org.springframework.util.ConcurrentReferenceHashMap import reactor.core.publisher.Flux diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosRpcUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosRpcUpstream.kt index 78ce2c24..504db013 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosRpcUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosRpcUpstream.kt @@ -16,6 +16,7 @@ */ package io.emeraldpay.dshackle.upstream.ethereum +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.cache.Caches import io.emeraldpay.dshackle.cache.CachesEnabled import io.emeraldpay.dshackle.config.UpstreamsConfig @@ -30,7 +31,6 @@ import io.emeraldpay.dshackle.upstream.ethereum.connectors.ConnectorFactory import io.emeraldpay.dshackle.upstream.ethereum.connectors.EthereumConnector import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse -import io.emeraldpay.grpc.Chain import org.slf4j.LoggerFactory import reactor.core.Disposable diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/BitcoinGrpcUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/BitcoinGrpcUpstream.kt index 35397e43..09ac0b5d 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/BitcoinGrpcUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/BitcoinGrpcUpstream.kt @@ -17,6 +17,7 @@ package io.emeraldpay.dshackle.upstream.grpc import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.ReactorBlockchainGrpc +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.Defaults import io.emeraldpay.dshackle.config.UpstreamsConfig import io.emeraldpay.dshackle.data.BlockContainer @@ -35,7 +36,6 @@ import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcGrpcClient import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse import io.emeraldpay.etherjar.rpc.RpcException -import io.emeraldpay.grpc.Chain import org.reactivestreams.Publisher import org.slf4j.LoggerFactory import reactor.core.publisher.Flux diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstream.kt index c0427a06..6c40e2a0 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstream.kt @@ -18,6 +18,7 @@ package io.emeraldpay.dshackle.upstream.grpc import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.ReactorBlockchainGrpc +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.Defaults import io.emeraldpay.dshackle.config.UpstreamsConfig import io.emeraldpay.dshackle.data.BlockContainer @@ -38,7 +39,6 @@ import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse import io.emeraldpay.etherjar.domain.BlockHash import io.emeraldpay.etherjar.rpc.RpcException -import io.emeraldpay.grpc.Chain import org.reactivestreams.Publisher import org.slf4j.LoggerFactory import reactor.core.publisher.Flux diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumPosGrpcUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumPosGrpcUpstream.kt index 72c03c28..f180bb6a 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumPosGrpcUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumPosGrpcUpstream.kt @@ -18,6 +18,7 @@ package io.emeraldpay.dshackle.upstream.grpc import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.ReactorBlockchainGrpc +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.Defaults import io.emeraldpay.dshackle.config.UpstreamsConfig import io.emeraldpay.dshackle.data.BlockContainer @@ -38,7 +39,6 @@ import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse import io.emeraldpay.etherjar.domain.BlockHash import io.emeraldpay.etherjar.rpc.RpcException -import io.emeraldpay.grpc.Chain import org.reactivestreams.Publisher import org.slf4j.LoggerFactory import reactor.core.publisher.Flux diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt index 78883e1c..aaf16960 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt @@ -18,6 +18,7 @@ package io.emeraldpay.dshackle.upstream.grpc import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.Common import io.emeraldpay.api.proto.ReactorBlockchainGrpc +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.Defaults import io.emeraldpay.dshackle.data.BlockContainer import io.emeraldpay.dshackle.upstream.AbstractHead @@ -25,7 +26,6 @@ import io.emeraldpay.dshackle.upstream.DefaultUpstream import io.emeraldpay.dshackle.upstream.Lifecycle import io.emeraldpay.dshackle.upstream.UpstreamAvailability import io.emeraldpay.dshackle.upstream.forkchoice.ForkChoice -import io.emeraldpay.grpc.Chain import org.reactivestreams.Publisher import org.slf4j.LoggerFactory import reactor.core.Disposable diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcUpstreams.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcUpstreams.kt index f74cb62c..e49a38d6 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcUpstreams.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcUpstreams.kt @@ -18,6 +18,8 @@ package io.emeraldpay.dshackle.upstream.grpc import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.ReactorBlockchainGrpc +import io.emeraldpay.dshackle.BlockchainType +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.Defaults import io.emeraldpay.dshackle.FileResolver import io.emeraldpay.dshackle.config.AuthConfig @@ -27,8 +29,6 @@ import io.emeraldpay.dshackle.upstream.DefaultUpstream import io.emeraldpay.dshackle.upstream.UpstreamAvailability import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcGrpcClient import io.emeraldpay.dshackle.upstream.rpcclient.RpcMetrics -import io.emeraldpay.grpc.BlockchainType -import io.emeraldpay.grpc.Chain import io.grpc.ManagedChannelBuilder import io.grpc.netty.NettyChannelBuilder import io.micrometer.core.instrument.Counter diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcGrpcClient.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcGrpcClient.kt index 8465f0c3..08f7e0f4 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcGrpcClient.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcGrpcClient.kt @@ -19,13 +19,13 @@ import com.google.protobuf.ByteString import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.BlockchainOuterClass.NativeCallReplySignature import io.emeraldpay.api.proto.ReactorBlockchainGrpc +import io.emeraldpay.dshackle.Chain import io.emeraldpay.dshackle.Global import io.emeraldpay.dshackle.reader.Reader import io.emeraldpay.dshackle.upstream.Selector import io.emeraldpay.dshackle.upstream.signature.ResponseSigner import io.emeraldpay.etherjar.rpc.RpcException import io.emeraldpay.etherjar.rpc.RpcResponseError -import io.emeraldpay.grpc.Chain import org.slf4j.LoggerFactory import reactor.core.publisher.Mono import java.util.concurrent.TimeUnit diff --git a/src/test/groovy/io/emeraldpay/dshackle/cache/BlocksRedisCacheSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/cache/BlocksRedisCacheSpec.groovy index 31bcf2a9..ba4ef7eb 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/cache/BlocksRedisCacheSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/cache/BlocksRedisCacheSpec.groovy @@ -21,7 +21,7 @@ import io.emeraldpay.dshackle.data.BlockContainer import io.emeraldpay.dshackle.data.BlockId import io.emeraldpay.dshackle.data.TxId import io.emeraldpay.dshackle.test.IntegrationTestingCommons -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.emeraldpay.etherjar.domain.BlockHash import io.emeraldpay.etherjar.rpc.json.BlockJson import io.emeraldpay.etherjar.rpc.json.TransactionRefJson diff --git a/src/test/groovy/io/emeraldpay/dshackle/cache/HeightByHashRedisCacheSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/cache/HeightByHashRedisCacheSpec.groovy index 632dcad2..b9b0c5cb 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/cache/HeightByHashRedisCacheSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/cache/HeightByHashRedisCacheSpec.groovy @@ -18,7 +18,7 @@ package io.emeraldpay.dshackle.cache import io.emeraldpay.dshackle.data.BlockContainer import io.emeraldpay.dshackle.data.BlockId import io.emeraldpay.dshackle.test.IntegrationTestingCommons -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.lettuce.core.api.StatefulRedisConnection import spock.lang.IgnoreIf import spock.lang.Specification diff --git a/src/test/groovy/io/emeraldpay/dshackle/cache/ReceiptRedisCacheSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/cache/ReceiptRedisCacheSpec.groovy index 4aa587bf..8138052b 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/cache/ReceiptRedisCacheSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/cache/ReceiptRedisCacheSpec.groovy @@ -6,7 +6,7 @@ import io.emeraldpay.dshackle.data.BlockId import io.emeraldpay.dshackle.data.DefaultContainer import io.emeraldpay.dshackle.data.TxId import io.emeraldpay.dshackle.test.IntegrationTestingCommons -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.emeraldpay.etherjar.domain.BlockHash import io.emeraldpay.etherjar.domain.TransactionId import io.emeraldpay.etherjar.rpc.json.TransactionReceiptJson diff --git a/src/test/groovy/io/emeraldpay/dshackle/cache/TxRedisCacheSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/cache/TxRedisCacheSpec.groovy index d0f93344..bc3401ef 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/cache/TxRedisCacheSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/cache/TxRedisCacheSpec.groovy @@ -23,7 +23,7 @@ import io.emeraldpay.dshackle.data.TxContainer import io.emeraldpay.dshackle.data.TxId import io.emeraldpay.dshackle.test.IntegrationTestingCommons import io.emeraldpay.dshackle.test.TestingCommons -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.emeraldpay.etherjar.domain.BlockHash import io.emeraldpay.etherjar.domain.TransactionId import io.emeraldpay.etherjar.domain.Wei diff --git a/src/test/groovy/io/emeraldpay/dshackle/config/HealthConfigReaderSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/config/HealthConfigReaderSpec.groovy index 6add6d56..a340c75c 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/config/HealthConfigReaderSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/config/HealthConfigReaderSpec.groovy @@ -15,7 +15,7 @@ */ package io.emeraldpay.dshackle.config -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import spock.lang.Specification class HealthConfigReaderSpec extends Specification { diff --git a/src/test/groovy/io/emeraldpay/dshackle/config/MainConfigReaderSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/config/MainConfigReaderSpec.groovy index f8fbdd7a..89d48c42 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/config/MainConfigReaderSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/config/MainConfigReaderSpec.groovy @@ -17,7 +17,7 @@ package io.emeraldpay.dshackle.config import io.emeraldpay.dshackle.test.TestingCommons -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import spock.lang.Specification class MainConfigReaderSpec extends Specification { diff --git a/src/test/groovy/io/emeraldpay/dshackle/config/ProxyConfigReaderSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/config/ProxyConfigReaderSpec.groovy index 076bcdda..8d2f827d 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/config/ProxyConfigReaderSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/config/ProxyConfigReaderSpec.groovy @@ -15,7 +15,7 @@ */ package io.emeraldpay.dshackle.config -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import spock.lang.Specification class ProxyConfigReaderSpec extends Specification { diff --git a/src/test/groovy/io/emeraldpay/dshackle/config/TokensConfigReaderSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/config/TokensConfigReaderSpec.groovy index 4ef8c3a4..2d67314e 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/config/TokensConfigReaderSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/config/TokensConfigReaderSpec.groovy @@ -15,7 +15,7 @@ */ package io.emeraldpay.dshackle.config -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import spock.lang.Specification class TokensConfigReaderSpec extends Specification { diff --git a/src/test/groovy/io/emeraldpay/dshackle/monitoring/HealthCheckSetupSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/monitoring/HealthCheckSetupSpec.groovy index c4772852..42579e9a 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/monitoring/HealthCheckSetupSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/monitoring/HealthCheckSetupSpec.groovy @@ -20,7 +20,7 @@ import io.emeraldpay.dshackle.upstream.Multistream import io.emeraldpay.dshackle.upstream.MultistreamHolder import io.emeraldpay.dshackle.upstream.Upstream import io.emeraldpay.dshackle.upstream.UpstreamAvailability -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import spock.lang.Specification class HealthCheckSetupSpec extends Specification { diff --git a/src/test/groovy/io/emeraldpay/dshackle/monitoring/accesslog/AccessLogWriterSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/monitoring/accesslog/AccessLogWriterSpec.groovy index 38dedfb9..2754363f 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/monitoring/accesslog/AccessLogWriterSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/monitoring/accesslog/AccessLogWriterSpec.groovy @@ -4,7 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper import io.emeraldpay.dshackle.Global import io.emeraldpay.dshackle.config.AccessLogConfig import io.emeraldpay.dshackle.config.MainConfig -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import spock.lang.Specification import java.time.Instant diff --git a/src/test/groovy/io/emeraldpay/dshackle/monitoring/accesslog/EventsBaseBuilderSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/monitoring/accesslog/EventsBaseBuilderSpec.groovy index a8375ac6..6c5c5c42 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/monitoring/accesslog/EventsBaseBuilderSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/monitoring/accesslog/EventsBaseBuilderSpec.groovy @@ -16,7 +16,7 @@ package io.emeraldpay.dshackle.monitoring.accesslog import io.emeraldpay.api.proto.BlockchainOuterClass -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.grpc.Attributes import io.grpc.Grpc import io.grpc.Metadata diff --git a/src/test/groovy/io/emeraldpay/dshackle/monitoring/accesslog/EventsBuilderSubscribeBalanceSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/monitoring/accesslog/EventsBuilderSubscribeBalanceSpec.groovy index 75d78f5a..aca4439e 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/monitoring/accesslog/EventsBuilderSubscribeBalanceSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/monitoring/accesslog/EventsBuilderSubscribeBalanceSpec.groovy @@ -2,7 +2,7 @@ package io.emeraldpay.dshackle.monitoring.accesslog import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.Common -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import spock.lang.Specification class EventsBuilderSubscribeBalanceSpec extends Specification { diff --git a/src/test/groovy/io/emeraldpay/dshackle/proxy/BaseHandlerSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/proxy/BaseHandlerSpec.groovy index 9fb32de3..9b052705 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/proxy/BaseHandlerSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/proxy/BaseHandlerSpec.groovy @@ -18,7 +18,7 @@ package io.emeraldpay.dshackle.proxy import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.dshackle.monitoring.accesslog.AccessHandlerHttp import io.emeraldpay.dshackle.rpc.NativeCall -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import org.jetbrains.annotations.NotNull import reactor.core.publisher.Flux import reactor.core.publisher.Mono diff --git a/src/test/groovy/io/emeraldpay/dshackle/proxy/HttpHandlerSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/proxy/HttpHandlerSpec.groovy index 69e5e8a7..79def24b 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/proxy/HttpHandlerSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/proxy/HttpHandlerSpec.groovy @@ -23,7 +23,7 @@ import io.emeraldpay.dshackle.monitoring.accesslog.AccessHandlerHttp import io.emeraldpay.dshackle.rpc.NativeCall import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse import io.emeraldpay.etherjar.rpc.RpcException -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.micrometer.core.instrument.Counter import io.micrometer.core.instrument.step.StepCounter import reactor.core.publisher.Flux diff --git a/src/test/groovy/io/emeraldpay/dshackle/proxy/ProxyServerSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/proxy/ProxyServerSpec.groovy index 3340ef2d..ba9bf779 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/proxy/ProxyServerSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/proxy/ProxyServerSpec.groovy @@ -6,7 +6,7 @@ import io.emeraldpay.dshackle.config.ProxyConfig import io.emeraldpay.dshackle.monitoring.accesslog.AccessHandlerHttp import io.emeraldpay.dshackle.rpc.NativeCall import io.emeraldpay.dshackle.rpc.NativeSubscribe -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import reactor.netty.http.server.HttpServerRoutes import spock.lang.Specification diff --git a/src/test/groovy/io/emeraldpay/dshackle/proxy/WebsocketHandlerSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/proxy/WebsocketHandlerSpec.groovy index 235f4778..b017ac24 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/proxy/WebsocketHandlerSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/proxy/WebsocketHandlerSpec.groovy @@ -20,7 +20,7 @@ import io.emeraldpay.dshackle.rpc.NativeCall import io.emeraldpay.dshackle.rpc.NativeSubscribe import io.emeraldpay.dshackle.upstream.Selector import io.emeraldpay.etherjar.rpc.json.RequestJson -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.micrometer.core.instrument.Counter import reactor.core.publisher.Flux import reactor.core.publisher.Sinks diff --git a/src/test/groovy/io/emeraldpay/dshackle/quorum/QuorumRpcReaderSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/quorum/QuorumRpcReaderSpec.groovy index c69450ca..a3f255d2 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/quorum/QuorumRpcReaderSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/quorum/QuorumRpcReaderSpec.groovy @@ -25,7 +25,7 @@ import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcException import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse import io.emeraldpay.etherjar.rpc.RpcResponseError -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.emeraldpay.etherjar.rpc.RpcException import reactor.core.publisher.Mono import reactor.test.StepVerifier diff --git a/src/test/groovy/io/emeraldpay/dshackle/rpc/NativeCallSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/rpc/NativeCallSpec.groovy index 93cc1fbc..28fa74cd 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/rpc/NativeCallSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/rpc/NativeCallSpec.groovy @@ -37,7 +37,7 @@ import io.emeraldpay.dshackle.upstream.calls.ManagedCallMethods import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse import io.emeraldpay.dshackle.upstream.signature.ResponseSigner -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.emeraldpay.etherjar.rpc.RpcException import io.emeraldpay.etherjar.rpc.RpcResponseError import reactor.core.publisher.Flux diff --git a/src/test/groovy/io/emeraldpay/dshackle/rpc/NativeSubscribeSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/rpc/NativeSubscribeSpec.groovy index 5793c17c..d589c48d 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/rpc/NativeSubscribeSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/rpc/NativeSubscribeSpec.groovy @@ -22,7 +22,7 @@ import io.emeraldpay.dshackle.upstream.Selector import io.emeraldpay.dshackle.upstream.ethereum.EthereumPosMultiStream import io.emeraldpay.dshackle.upstream.ethereum.EthereumSubscribe import io.emeraldpay.dshackle.upstream.signature.NoSigner -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import reactor.core.publisher.Flux import reactor.test.StepVerifier import spock.lang.Specification diff --git a/src/test/groovy/io/emeraldpay/dshackle/rpc/StreamHeadSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/rpc/StreamHeadSpec.groovy index b5880354..88e94cc3 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/rpc/StreamHeadSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/rpc/StreamHeadSpec.groovy @@ -26,7 +26,7 @@ import io.emeraldpay.dshackle.test.EthereumPosRpcUpstreamMock import io.emeraldpay.dshackle.test.TestingCommons import io.emeraldpay.dshackle.test.MultistreamHolderMock import io.emeraldpay.dshackle.upstream.ethereum.EthereumPosRpcUpstream -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.emeraldpay.etherjar.domain.BlockHash import io.emeraldpay.etherjar.rpc.json.BlockJson import io.emeraldpay.etherjar.rpc.json.TransactionRefJson diff --git a/src/test/groovy/io/emeraldpay/dshackle/rpc/SubscribeStatusSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/rpc/SubscribeStatusSpec.groovy index cb1b952d..082263c1 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/rpc/SubscribeStatusSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/rpc/SubscribeStatusSpec.groovy @@ -6,7 +6,7 @@ import io.emeraldpay.dshackle.upstream.Multistream import io.emeraldpay.dshackle.upstream.MultistreamHolder import io.emeraldpay.dshackle.upstream.Upstream import io.emeraldpay.dshackle.upstream.UpstreamAvailability -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import reactor.core.publisher.Mono import reactor.test.StepVerifier import spock.lang.Specification diff --git a/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackBitcoinAddressSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackBitcoinAddressSpec.groovy index b1d9f7c1..fabbf663 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackBitcoinAddressSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackBitcoinAddressSpec.groovy @@ -30,7 +30,7 @@ import io.emeraldpay.dshackle.upstream.bitcoin.BitcoinMultistream import io.emeraldpay.dshackle.upstream.bitcoin.BitcoinReader import io.emeraldpay.dshackle.upstream.bitcoin.XpubAddresses import io.emeraldpay.dshackle.upstream.bitcoin.data.SimpleUnspent -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import org.bitcoinj.core.Address import org.bitcoinj.params.MainNetParams import org.bitcoinj.params.TestNet3Params diff --git a/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackBitcoinTxSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackBitcoinTxSpec.groovy index a4f6e5df..8e9a26ef 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackBitcoinTxSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackBitcoinTxSpec.groovy @@ -22,7 +22,7 @@ import io.emeraldpay.dshackle.upstream.MultistreamHolder import io.emeraldpay.dshackle.upstream.bitcoin.BitcoinMultistream import io.emeraldpay.dshackle.upstream.bitcoin.BitcoinReader import io.emeraldpay.dshackle.upstream.bitcoin.CachingMempoolData -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import reactor.core.publisher.Flux import reactor.core.publisher.Mono import reactor.test.StepVerifier diff --git a/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackERC20AddressSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackERC20AddressSpec.groovy index 86fc1553..4c3a90af 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackERC20AddressSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackERC20AddressSpec.groovy @@ -14,7 +14,7 @@ import io.emeraldpay.dshackle.upstream.ethereum.subscribe.json.LogMessage import io.emeraldpay.etherjar.domain.BlockHash import io.emeraldpay.etherjar.domain.TransactionId import io.emeraldpay.etherjar.hex.Hex32 -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.emeraldpay.etherjar.domain.Address import io.emeraldpay.etherjar.erc20.ERC20Token import io.emeraldpay.etherjar.hex.HexData diff --git a/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackEthereumAddressSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackEthereumAddressSpec.groovy index 05dc3aa9..cb98adb1 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackEthereumAddressSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackEthereumAddressSpec.groovy @@ -22,7 +22,7 @@ import io.emeraldpay.dshackle.data.BlockContainer import io.emeraldpay.dshackle.test.TestingCommons import io.emeraldpay.dshackle.test.MultistreamHolderMock import io.emeraldpay.dshackle.upstream.MultistreamHolder -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.emeraldpay.etherjar.domain.BlockHash import io.emeraldpay.etherjar.rpc.json.BlockJson import reactor.test.StepVerifier diff --git a/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackEthereumTxSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackEthereumTxSpec.groovy index 178b794f..e8d5c3fc 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackEthereumTxSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/rpc/TrackEthereumTxSpec.groovy @@ -28,7 +28,7 @@ import io.emeraldpay.dshackle.upstream.Head import io.emeraldpay.dshackle.upstream.MultistreamHolder import io.emeraldpay.dshackle.upstream.ethereum.EthereumMultistream import io.emeraldpay.dshackle.upstream.ethereum.EthereumPosMultiStream -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.emeraldpay.etherjar.domain.BlockHash import io.emeraldpay.etherjar.domain.TransactionId import io.emeraldpay.etherjar.rpc.json.BlockJson diff --git a/src/test/groovy/io/emeraldpay/dshackle/startup/ConfiguredUpstreamsSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/startup/ConfiguredUpstreamsSpec.groovy index f799729d..286458c1 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/startup/ConfiguredUpstreamsSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/startup/ConfiguredUpstreamsSpec.groovy @@ -8,7 +8,7 @@ import io.emeraldpay.dshackle.upstream.CallTargetsHolder import io.emeraldpay.dshackle.upstream.CurrentMultistreamHolder import io.emeraldpay.dshackle.upstream.calls.DefaultEthereumMethods import io.emeraldpay.dshackle.upstream.calls.ManagedCallMethods -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import org.springframework.context.ApplicationEventPublisher import spock.lang.Specification diff --git a/src/test/groovy/io/emeraldpay/dshackle/test/ConnectorFactoryMock.groovy b/src/test/groovy/io/emeraldpay/dshackle/test/ConnectorFactoryMock.groovy index 34d7e3d6..25010d0d 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/test/ConnectorFactoryMock.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/test/ConnectorFactoryMock.groovy @@ -8,7 +8,7 @@ import io.emeraldpay.dshackle.upstream.ethereum.connectors.ConnectorFactory import io.emeraldpay.dshackle.upstream.ethereum.connectors.EthereumConnector import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain class ConnectorFactoryMock implements ConnectorFactory { Reader api diff --git a/src/test/groovy/io/emeraldpay/dshackle/test/EthereumPosRpcUpstreamMock.groovy b/src/test/groovy/io/emeraldpay/dshackle/test/EthereumPosRpcUpstreamMock.groovy index e611b3d9..52ffe3fb 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/test/EthereumPosRpcUpstreamMock.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/test/EthereumPosRpcUpstreamMock.groovy @@ -31,7 +31,7 @@ import io.emeraldpay.dshackle.upstream.UpstreamAvailability import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse import io.emeraldpay.dshackle.reader.Reader -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import org.jetbrains.annotations.NotNull import org.reactivestreams.Publisher diff --git a/src/test/groovy/io/emeraldpay/dshackle/test/EthereumRpcUpstreamMock.groovy b/src/test/groovy/io/emeraldpay/dshackle/test/EthereumRpcUpstreamMock.groovy index 369dc612..4a490d5a 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/test/EthereumRpcUpstreamMock.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/test/EthereumRpcUpstreamMock.groovy @@ -30,7 +30,7 @@ import io.emeraldpay.dshackle.upstream.UpstreamAvailability import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse import io.emeraldpay.dshackle.reader.Reader -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import org.jetbrains.annotations.NotNull import org.reactivestreams.Publisher diff --git a/src/test/groovy/io/emeraldpay/dshackle/test/MultistreamHolderMock.groovy b/src/test/groovy/io/emeraldpay/dshackle/test/MultistreamHolderMock.groovy index e26cc9f7..81abb838 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/test/MultistreamHolderMock.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/test/MultistreamHolderMock.groovy @@ -30,10 +30,9 @@ import io.emeraldpay.dshackle.upstream.MultistreamHolder import io.emeraldpay.dshackle.upstream.ethereum.EthereumPosMultiStream import io.emeraldpay.dshackle.upstream.ethereum.EthereumPosRpcUpstream import io.emeraldpay.dshackle.upstream.ethereum.EthereumReader -import io.emeraldpay.grpc.BlockchainType -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.BlockchainType +import io.emeraldpay.dshackle.Chain import org.jetbrains.annotations.NotNull -import reactor.core.publisher.Flux class MultistreamHolderMock implements MultistreamHolder { diff --git a/src/test/groovy/io/emeraldpay/dshackle/test/TestingCommons.groovy b/src/test/groovy/io/emeraldpay/dshackle/test/TestingCommons.groovy index 7bfab88c..a6e4c114 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/test/TestingCommons.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/test/TestingCommons.groovy @@ -33,7 +33,7 @@ import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse import io.emeraldpay.etherjar.domain.BlockHash import io.emeraldpay.etherjar.rpc.json.BlockJson -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.micrometer.core.instrument.MeterRegistry import io.micrometer.core.instrument.logging.LoggingMeterRegistry import org.apache.commons.lang3.StringUtils diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/CurrentMultistreamHolderSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/CurrentMultistreamHolderSpec.groovy index 4e488e9d..1a9b8179 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/upstream/CurrentMultistreamHolderSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/CurrentMultistreamHolderSpec.groovy @@ -19,7 +19,7 @@ import io.emeraldpay.dshackle.startup.UpstreamChangeEvent import io.emeraldpay.dshackle.test.EthereumPosRpcUpstreamMock import io.emeraldpay.dshackle.test.EthereumRpcUpstreamMock import io.emeraldpay.dshackle.test.TestingCommons -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import spock.lang.Specification class CurrentMultistreamHolderSpec extends Specification { diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/FilteredApisSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/FilteredApisSpec.groovy index ecec9e4b..61a21bbf 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/upstream/FilteredApisSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/FilteredApisSpec.groovy @@ -24,7 +24,7 @@ import io.emeraldpay.dshackle.upstream.calls.DefaultEthereumMethods import io.emeraldpay.dshackle.upstream.ethereum.EthereumRpcUpstream import io.emeraldpay.dshackle.upstream.ethereum.connectors.EthereumConnectorFactory import io.emeraldpay.dshackle.upstream.forkchoice.MostWorkForkChoice -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import reactor.test.StepVerifier import spock.lang.Retry import spock.lang.Specification diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/MultistreamSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/MultistreamSpec.groovy index 8a28f4b3..2f54b1b0 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/upstream/MultistreamSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/MultistreamSpec.groovy @@ -33,7 +33,7 @@ import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse import io.emeraldpay.etherjar.domain.BlockHash import io.emeraldpay.etherjar.rpc.json.BlockJson import io.emeraldpay.etherjar.rpc.json.TransactionRefJson -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import org.jetbrains.annotations.NotNull import reactor.core.publisher.Flux import reactor.core.publisher.Mono diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethodsSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethodsSpec.groovy index e58d3baf..4f8febda 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethodsSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethodsSpec.groovy @@ -1,6 +1,6 @@ package io.emeraldpay.dshackle.upstream.calls -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import spock.lang.Specification class DefaultEthereumMethodsSpec extends Specification { diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/calls/ManagedCallMethodsSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/calls/ManagedCallMethodsSpec.groovy index 580c9669..8c1d5afd 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/upstream/calls/ManagedCallMethodsSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/calls/ManagedCallMethodsSpec.groovy @@ -23,7 +23,7 @@ import io.emeraldpay.dshackle.quorum.NonceQuorum import io.emeraldpay.dshackle.quorum.NotLaggingQuorum import io.emeraldpay.dshackle.upstream.calls.DirectCallMethods import io.emeraldpay.dshackle.upstream.calls.ManagedCallMethods -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import spock.lang.Specification class ManagedCallMethodsSpec extends Specification { diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/ERC20BalanceSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/ERC20BalanceSpec.groovy index 8de66c50..6570bad1 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/ERC20BalanceSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/ERC20BalanceSpec.groovy @@ -27,7 +27,7 @@ import io.emeraldpay.etherjar.domain.Address import io.emeraldpay.etherjar.erc20.ERC20Token import io.emeraldpay.etherjar.hex.HexData import io.emeraldpay.etherjar.rpc.json.TransactionCallJson -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import spock.lang.Specification import java.time.Duration diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumDirectReaderSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumDirectReaderSpec.groovy index 78bcbe27..d4f17cd0 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumDirectReaderSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumDirectReaderSpec.groovy @@ -11,7 +11,7 @@ import io.emeraldpay.dshackle.upstream.Head import io.emeraldpay.dshackle.upstream.Multistream import io.emeraldpay.dshackle.upstream.calls.DefaultEthereumMethods import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.emeraldpay.etherjar.domain.Address import io.emeraldpay.etherjar.domain.BlockHash import io.emeraldpay.etherjar.domain.TransactionId diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumReaderSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumReaderSpec.groovy index 30a273d1..c824e25f 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumReaderSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumReaderSpec.groovy @@ -29,7 +29,7 @@ import io.emeraldpay.dshackle.test.TestingCommons import io.emeraldpay.dshackle.upstream.Multistream import io.emeraldpay.dshackle.upstream.calls.CallMethods import io.emeraldpay.dshackle.upstream.calls.DefaultEthereumMethods -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.emeraldpay.etherjar.domain.Address import io.emeraldpay.etherjar.domain.BlockHash import io.emeraldpay.etherjar.domain.TransactionId diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/LocalCallRouterSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/LocalCallRouterSpec.groovy index fb84642b..c936b8b3 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/LocalCallRouterSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/LocalCallRouterSpec.groovy @@ -9,7 +9,7 @@ import io.emeraldpay.dshackle.upstream.Head import io.emeraldpay.dshackle.upstream.calls.DefaultEthereumMethods import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.reader.Reader -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.emeraldpay.etherjar.rpc.json.BlockJson import org.apache.commons.collections4.functors.ConstantFactory import reactor.core.publisher.Mono diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/WsConnectionRealSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/WsConnectionRealSpec.groovy index eb3f22c0..2b9412af 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/WsConnectionRealSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/WsConnectionRealSpec.groovy @@ -4,7 +4,7 @@ import io.emeraldpay.dshackle.test.MockWSServer import io.emeraldpay.dshackle.upstream.DefaultUpstream import io.emeraldpay.dshackle.upstream.UpstreamAvailability import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import reactor.test.StepVerifier import spock.lang.Shared import spock.lang.Specification diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/WsConnectionSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/WsConnectionSpec.groovy index b8996287..5fc78e37 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/WsConnectionSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/WsConnectionSpec.groovy @@ -25,7 +25,7 @@ import io.emeraldpay.etherjar.rpc.RpcResponseError import io.emeraldpay.etherjar.rpc.json.BlockJson import io.emeraldpay.etherjar.rpc.json.TransactionJson import io.emeraldpay.etherjar.rpc.json.TransactionRefJson -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import reactor.core.publisher.Flux import reactor.test.StepVerifier import spock.lang.Specification diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstreamSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstreamSpec.groovy index af98978b..e13f355e 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstreamSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstreamSpec.groovy @@ -29,7 +29,7 @@ import io.emeraldpay.dshackle.test.TestingCommons import io.emeraldpay.dshackle.upstream.UpstreamAvailability import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcGrpcClient import io.emeraldpay.dshackle.upstream.rpcclient.RpcMetrics -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.grpc.stub.StreamObserver import io.emeraldpay.etherjar.domain.BlockHash import io.emeraldpay.etherjar.rpc.json.BlockJson diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/grpc/GrpcHeadSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/grpc/GrpcHeadSpec.groovy index 0f8a1e49..638e51ef 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/upstream/grpc/GrpcHeadSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/grpc/GrpcHeadSpec.groovy @@ -22,7 +22,7 @@ import io.emeraldpay.dshackle.test.MockGrpcServer import io.emeraldpay.dshackle.test.TestingCommons import io.emeraldpay.dshackle.upstream.DefaultUpstream import io.emeraldpay.dshackle.upstream.forkchoice.MostWorkForkChoice -import io.emeraldpay.grpc.Chain +import io.emeraldpay.dshackle.Chain import io.grpc.stub.StreamObserver import reactor.test.StepVerifier import spock.lang.Specification