From f1ce64d86f652553dc6fcf6e13635dd9229085b0 Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Thu, 13 Apr 2023 15:36:48 +0800 Subject: [PATCH 1/6] Rename and flatten --- src/rust/Cargo.lock | 42 +- src/rust/Cargo.toml | 5 +- .../.gitignore | 0 .../Cargo.toml | 2 +- .../build.rs.disabled | 0 .../src/lib.rs | 0 src/rust/{crates => }/ain-evm/.gitignore | 0 src/rust/{crates => }/ain-evm/Cargo.toml | 0 src/rust/{crates => }/ain-evm/src/block.rs | 0 .../{crates => }/ain-evm/src/ecrecover.rs | 0 src/rust/{crates => }/ain-evm/src/evm.rs | 0 src/rust/{crates => }/ain-evm/src/executor.rs | 0 src/rust/{crates => }/ain-evm/src/handler.rs | 0 src/rust/{crates => }/ain-evm/src/lib.rs | 0 src/rust/{crates => }/ain-evm/src/runtime.rs | 0 src/rust/{crates => }/ain-evm/src/traits.rs | 0 .../{crates => }/ain-evm/src/transaction.rs | 0 src/rust/{crates => }/ain-evm/src/tx_queue.rs | 0 src/rust/{crates => }/ain-evm/tests/block.rs | 0 src/rust/{crates => }/ain-grpc/Cargo.toml | 2 +- src/rust/{crates => }/ain-grpc/build.rs | 6 +- src/rust/{crates => }/ain-grpc/src/codegen.rs | 0 src/rust/ain-grpc/src/gen/rpc.rs | 748 +++++++++++ src/rust/ain-grpc/src/gen/types.rs | 1 + src/rust/{crates => }/ain-grpc/src/lib.rs | 0 src/rust/{crates => }/ain-grpc/src/rpc.rs | 7 +- src/rust/{crates => }/ain-grpc/src/tests.rs | 0 .../ain-evm-ffi => ain-rs-exports}/Cargo.toml | 2 +- .../ain-evm-ffi => ain-rs-exports}/build.rs | 0 .../ain-evm-ffi => ain-rs-exports}/src/lib.rs | 0 src/rust/crates/ain-grpc/src/gen/.gitkeep | 0 src/rust/crates/ain-grpc/src/gen/rpc.rs | 748 ----------- src/rust/crates/ain-grpc/src/gen/types.rs | 1167 ----------------- .../google/protobuf/any.proto | 0 .../google/protobuf/api.proto | 0 .../google/protobuf/compiler/plugin.proto | 0 .../google/protobuf/descriptor.proto | 0 .../google/protobuf/duration.proto | 0 .../google/protobuf/empty.proto | 0 .../google/protobuf/field_mask.proto | 0 .../google/protobuf/source_context.proto | 0 .../google/protobuf/struct.proto | 0 .../google/protobuf/timestamp.proto | 0 .../google/protobuf/type.proto | 0 .../google/protobuf/wrappers.proto | 0 .../{protobuf => proto}/rpc/blockchain.proto | 0 src/rust/{protobuf => proto}/rpc/eth.proto | 0 .../{protobuf => proto}/types/block.proto | 0 src/rust/{protobuf => proto}/types/eth.proto | 0 src/rust/{protobuf => proto}/types/tx.proto | 0 50 files changed, 780 insertions(+), 1950 deletions(-) rename src/rust/{crates/ain-evm-cpp-ffi => ain-cpp-exports}/.gitignore (100%) rename src/rust/{crates/ain-evm-cpp-ffi => ain-cpp-exports}/Cargo.toml (89%) rename src/rust/{crates/ain-evm-cpp-ffi => ain-cpp-exports}/build.rs.disabled (100%) rename src/rust/{crates/ain-evm-cpp-ffi => ain-cpp-exports}/src/lib.rs (100%) rename src/rust/{crates => }/ain-evm/.gitignore (100%) rename src/rust/{crates => }/ain-evm/Cargo.toml (100%) rename src/rust/{crates => }/ain-evm/src/block.rs (100%) rename src/rust/{crates => }/ain-evm/src/ecrecover.rs (100%) rename src/rust/{crates => }/ain-evm/src/evm.rs (100%) rename src/rust/{crates => }/ain-evm/src/executor.rs (100%) rename src/rust/{crates => }/ain-evm/src/handler.rs (100%) rename src/rust/{crates => }/ain-evm/src/lib.rs (100%) rename src/rust/{crates => }/ain-evm/src/runtime.rs (100%) rename src/rust/{crates => }/ain-evm/src/traits.rs (100%) rename src/rust/{crates => }/ain-evm/src/transaction.rs (100%) rename src/rust/{crates => }/ain-evm/src/tx_queue.rs (100%) rename src/rust/{crates => }/ain-evm/tests/block.rs (100%) rename src/rust/{crates => }/ain-grpc/Cargo.toml (93%) rename src/rust/{crates => }/ain-grpc/build.rs (99%) rename src/rust/{crates => }/ain-grpc/src/codegen.rs (100%) create mode 100644 src/rust/ain-grpc/src/gen/rpc.rs create mode 100644 src/rust/ain-grpc/src/gen/types.rs rename src/rust/{crates => }/ain-grpc/src/lib.rs (100%) rename src/rust/{crates => }/ain-grpc/src/rpc.rs (97%) rename src/rust/{crates => }/ain-grpc/src/tests.rs (100%) rename src/rust/{crates/ain-evm-ffi => ain-rs-exports}/Cargo.toml (94%) rename src/rust/{crates/ain-evm-ffi => ain-rs-exports}/build.rs (100%) rename src/rust/{crates/ain-evm-ffi => ain-rs-exports}/src/lib.rs (100%) delete mode 100644 src/rust/crates/ain-grpc/src/gen/.gitkeep delete mode 100644 src/rust/crates/ain-grpc/src/gen/rpc.rs delete mode 100644 src/rust/crates/ain-grpc/src/gen/types.rs rename src/rust/{protobuf => proto}/google/protobuf/any.proto (100%) rename src/rust/{protobuf => proto}/google/protobuf/api.proto (100%) rename src/rust/{protobuf => proto}/google/protobuf/compiler/plugin.proto (100%) rename src/rust/{protobuf => proto}/google/protobuf/descriptor.proto (100%) rename src/rust/{protobuf => proto}/google/protobuf/duration.proto (100%) rename src/rust/{protobuf => proto}/google/protobuf/empty.proto (100%) rename src/rust/{protobuf => proto}/google/protobuf/field_mask.proto (100%) rename src/rust/{protobuf => proto}/google/protobuf/source_context.proto (100%) rename src/rust/{protobuf => proto}/google/protobuf/struct.proto (100%) rename src/rust/{protobuf => proto}/google/protobuf/timestamp.proto (100%) rename src/rust/{protobuf => proto}/google/protobuf/type.proto (100%) rename src/rust/{protobuf => proto}/google/protobuf/wrappers.proto (100%) rename src/rust/{protobuf => proto}/rpc/blockchain.proto (100%) rename src/rust/{protobuf => proto}/rpc/eth.proto (100%) rename src/rust/{protobuf => proto}/types/block.proto (100%) rename src/rust/{protobuf => proto}/types/eth.proto (100%) rename src/rust/{protobuf => proto}/types/tx.proto (100%) diff --git a/src/rust/Cargo.lock b/src/rust/Cargo.lock index c43ac25c02..a025ead0cd 100644 --- a/src/rust/Cargo.lock +++ b/src/rust/Cargo.lock @@ -11,6 +11,14 @@ dependencies = [ "memchr", ] +[[package]] +name = "ain-cpp-exports" +version = "0.1.0" +dependencies = [ + "cxx", + "cxx-build", +] + [[package]] name = "ain-evm" version = "0.1.0" @@ -34,32 +42,12 @@ dependencies = [ "tokio", ] -[[package]] -name = "ain-evm-cpp-ffi" -version = "0.1.0" -dependencies = [ - "cxx", - "cxx-build", -] - -[[package]] -name = "ain-evm-ffi" -version = "0.1.0" -dependencies = [ - "ain-evm", - "ain-grpc", - "cxx", - "cxx-gen", - "proc-macro2", - "rlp", -] - [[package]] name = "ain-grpc" version = "0.1.0" dependencies = [ + "ain-cpp-exports", "ain-evm", - "ain-evm-cpp-ffi", "cxx", "cxx-gen", "env_logger", @@ -86,6 +74,18 @@ dependencies = [ "tonic-build", ] +[[package]] +name = "ain-rs-exports" +version = "0.1.0" +dependencies = [ + "ain-evm", + "ain-grpc", + "cxx", + "cxx-gen", + "proc-macro2", + "rlp", +] + [[package]] name = "anyhow" version = "1.0.70" diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml index 8277388023..99f6d8c9b4 100644 --- a/src/rust/Cargo.toml +++ b/src/rust/Cargo.toml @@ -1,8 +1,5 @@ [workspace] members = [ - "crates/ain-evm", - "crates/ain-evm-ffi", - "crates/ain-evm-cpp-ffi", - "crates/ain-grpc", + "ain-*", ] diff --git a/src/rust/crates/ain-evm-cpp-ffi/.gitignore b/src/rust/ain-cpp-exports/.gitignore similarity index 100% rename from src/rust/crates/ain-evm-cpp-ffi/.gitignore rename to src/rust/ain-cpp-exports/.gitignore diff --git a/src/rust/crates/ain-evm-cpp-ffi/Cargo.toml b/src/rust/ain-cpp-exports/Cargo.toml similarity index 89% rename from src/rust/crates/ain-evm-cpp-ffi/Cargo.toml rename to src/rust/ain-cpp-exports/Cargo.toml index 42358bf7ec..16aa99980d 100644 --- a/src/rust/crates/ain-evm-cpp-ffi/Cargo.toml +++ b/src/rust/ain-cpp-exports/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "ain-evm-cpp-ffi" +name = "ain-cpp-exports" version = "0.1.0" edition = "2021" diff --git a/src/rust/crates/ain-evm-cpp-ffi/build.rs.disabled b/src/rust/ain-cpp-exports/build.rs.disabled similarity index 100% rename from src/rust/crates/ain-evm-cpp-ffi/build.rs.disabled rename to src/rust/ain-cpp-exports/build.rs.disabled diff --git a/src/rust/crates/ain-evm-cpp-ffi/src/lib.rs b/src/rust/ain-cpp-exports/src/lib.rs similarity index 100% rename from src/rust/crates/ain-evm-cpp-ffi/src/lib.rs rename to src/rust/ain-cpp-exports/src/lib.rs diff --git a/src/rust/crates/ain-evm/.gitignore b/src/rust/ain-evm/.gitignore similarity index 100% rename from src/rust/crates/ain-evm/.gitignore rename to src/rust/ain-evm/.gitignore diff --git a/src/rust/crates/ain-evm/Cargo.toml b/src/rust/ain-evm/Cargo.toml similarity index 100% rename from src/rust/crates/ain-evm/Cargo.toml rename to src/rust/ain-evm/Cargo.toml diff --git a/src/rust/crates/ain-evm/src/block.rs b/src/rust/ain-evm/src/block.rs similarity index 100% rename from src/rust/crates/ain-evm/src/block.rs rename to src/rust/ain-evm/src/block.rs diff --git a/src/rust/crates/ain-evm/src/ecrecover.rs b/src/rust/ain-evm/src/ecrecover.rs similarity index 100% rename from src/rust/crates/ain-evm/src/ecrecover.rs rename to src/rust/ain-evm/src/ecrecover.rs diff --git a/src/rust/crates/ain-evm/src/evm.rs b/src/rust/ain-evm/src/evm.rs similarity index 100% rename from src/rust/crates/ain-evm/src/evm.rs rename to src/rust/ain-evm/src/evm.rs diff --git a/src/rust/crates/ain-evm/src/executor.rs b/src/rust/ain-evm/src/executor.rs similarity index 100% rename from src/rust/crates/ain-evm/src/executor.rs rename to src/rust/ain-evm/src/executor.rs diff --git a/src/rust/crates/ain-evm/src/handler.rs b/src/rust/ain-evm/src/handler.rs similarity index 100% rename from src/rust/crates/ain-evm/src/handler.rs rename to src/rust/ain-evm/src/handler.rs diff --git a/src/rust/crates/ain-evm/src/lib.rs b/src/rust/ain-evm/src/lib.rs similarity index 100% rename from src/rust/crates/ain-evm/src/lib.rs rename to src/rust/ain-evm/src/lib.rs diff --git a/src/rust/crates/ain-evm/src/runtime.rs b/src/rust/ain-evm/src/runtime.rs similarity index 100% rename from src/rust/crates/ain-evm/src/runtime.rs rename to src/rust/ain-evm/src/runtime.rs diff --git a/src/rust/crates/ain-evm/src/traits.rs b/src/rust/ain-evm/src/traits.rs similarity index 100% rename from src/rust/crates/ain-evm/src/traits.rs rename to src/rust/ain-evm/src/traits.rs diff --git a/src/rust/crates/ain-evm/src/transaction.rs b/src/rust/ain-evm/src/transaction.rs similarity index 100% rename from src/rust/crates/ain-evm/src/transaction.rs rename to src/rust/ain-evm/src/transaction.rs diff --git a/src/rust/crates/ain-evm/src/tx_queue.rs b/src/rust/ain-evm/src/tx_queue.rs similarity index 100% rename from src/rust/crates/ain-evm/src/tx_queue.rs rename to src/rust/ain-evm/src/tx_queue.rs diff --git a/src/rust/crates/ain-evm/tests/block.rs b/src/rust/ain-evm/tests/block.rs similarity index 100% rename from src/rust/crates/ain-evm/tests/block.rs rename to src/rust/ain-evm/tests/block.rs diff --git a/src/rust/crates/ain-grpc/Cargo.toml b/src/rust/ain-grpc/Cargo.toml similarity index 93% rename from src/rust/crates/ain-grpc/Cargo.toml rename to src/rust/ain-grpc/Cargo.toml index f09d580eac..d5751b265e 100644 --- a/src/rust/crates/ain-grpc/Cargo.toml +++ b/src/rust/ain-grpc/Cargo.toml @@ -6,7 +6,7 @@ build = "build.rs" [dependencies] ain-evm = { path = "../ain-evm" } -ain-evm-cpp-ffi = { path = "../ain-evm-cpp-ffi" } +ain-cpp-exports = { path = "../ain-cpp-exports" } cxx = "1.0" env_logger = "0.9" jsonrpsee-core = "0.15" diff --git a/src/rust/crates/ain-grpc/build.rs b/src/rust/ain-grpc/build.rs similarity index 99% rename from src/rust/crates/ain-grpc/build.rs rename to src/rust/ain-grpc/build.rs index 38039ecfff..d1a4abc08c 100644 --- a/src/rust/crates/ain-grpc/build.rs +++ b/src/rust/ain-grpc/build.rs @@ -764,11 +764,10 @@ fn main() { let proto_path = manifest_path .parent() .unwrap() - .parent() - .unwrap() - .join("protobuf"); + .join("proto"); let src_path = manifest_path.join("src"); let gen_path = src_path.join("gen"); + std::fs::create_dir_all(&gen_path).unwrap(); let methods = generate_from_protobuf(&proto_path, Path::new(&gen_path)); let _tt = modify_codegen( @@ -777,6 +776,7 @@ fn main() { &Path::new(&gen_path).join("rpc.rs"), &src_path.join("lib.rs"), ); + println!( "cargo:rerun-if-changed={}", src_path.join("rpc.rs").to_string_lossy() diff --git a/src/rust/crates/ain-grpc/src/codegen.rs b/src/rust/ain-grpc/src/codegen.rs similarity index 100% rename from src/rust/crates/ain-grpc/src/codegen.rs rename to src/rust/ain-grpc/src/codegen.rs diff --git a/src/rust/ain-grpc/src/gen/rpc.rs b/src/rust/ain-grpc/src/gen/rpc.rs new file mode 100644 index 0000000000..0577cba589 --- /dev/null +++ b/src/rust/ain-grpc/src/gen/rpc.rs @@ -0,0 +1,748 @@ +/// Generated server implementations. +pub mod blockchain_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with BlockchainServer. + #[async_trait] + pub trait Blockchain: Send + Sync + 'static { + /// [ignore] + /// Returns the hash of the best (tip) block in the most-work fully-validated chain. + async fn get_best_block_hash( + &self, + request: tonic::Request<()>, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// [ignore] + async fn get_block( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + #[derive(Debug)] + pub struct BlockchainServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + } + struct _Inner(Arc); + impl BlockchainServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + } + impl tonic::codegen::Service> for BlockchainServer + where + T: Blockchain, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/rpc.Blockchain/GetBestBlockHash" => { + #[allow(non_camel_case_types)] + struct GetBestBlockHashSvc(pub Arc); + impl tonic::server::UnaryService<()> + for GetBestBlockHashSvc { + type Response = super::super::types::BlockHashResult; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call(&mut self, request: tonic::Request<()>) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).get_best_block_hash(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetBestBlockHashSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/rpc.Blockchain/GetBlock" => { + #[allow(non_camel_case_types)] + struct GetBlockSvc(pub Arc); + impl< + T: Blockchain, + > tonic::server::UnaryService + for GetBlockSvc { + type Response = super::super::types::BlockResult; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).get_block(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetBlockSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for BlockchainServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for BlockchainServer { + const NAME: &'static str = "rpc.Blockchain"; + } +} +/// Generated server implementations. +pub mod eth_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with EthServer. + #[async_trait] + pub trait Eth: Send + Sync + 'static { + /// / Returns eth_accounts list. + async fn eth_accounts( + &self, + request: tonic::Request<()>, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// / Call contract, returning the output data. Does not create a transaction. + async fn eth_call( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// / Returns the balance for the given address. + async fn eth_get_balance( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + async fn eth_get_block_by_hash( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// / [ignore] + /// / Returns the balance for the given address. + async fn eth_send_transaction( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + async fn eth_chain_id( + &self, + request: tonic::Request<()>, + ) -> Result< + tonic::Response, + tonic::Status, + >; + async fn net_version( + &self, + request: tonic::Request<()>, + ) -> Result< + tonic::Response, + tonic::Status, + >; + async fn eth_block_number( + &self, + request: tonic::Request<()>, + ) -> Result< + tonic::Response, + tonic::Status, + >; + async fn eth_get_block_by_number( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn eth_mining( + &self, + request: tonic::Request<()>, + ) -> Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct EthServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + } + struct _Inner(Arc); + impl EthServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + } + impl tonic::codegen::Service> for EthServer + where + T: Eth, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/rpc.eth/Eth_Accounts" => { + #[allow(non_camel_case_types)] + struct Eth_AccountsSvc(pub Arc); + impl tonic::server::UnaryService<()> for Eth_AccountsSvc { + type Response = super::super::types::EthAccountsResult; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call(&mut self, request: tonic::Request<()>) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).eth_accounts(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = Eth_AccountsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/rpc.eth/Eth_Call" => { + #[allow(non_camel_case_types)] + struct Eth_CallSvc(pub Arc); + impl< + T: Eth, + > tonic::server::UnaryService + for Eth_CallSvc { + type Response = super::super::types::EthCallResult; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).eth_call(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = Eth_CallSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/rpc.eth/Eth_GetBalance" => { + #[allow(non_camel_case_types)] + struct Eth_GetBalanceSvc(pub Arc); + impl< + T: Eth, + > tonic::server::UnaryService< + super::super::types::EthGetBalanceInput, + > for Eth_GetBalanceSvc { + type Response = super::super::types::EthGetBalanceResult; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::types::EthGetBalanceInput, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).eth_get_balance(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = Eth_GetBalanceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/rpc.eth/Eth_GetBlockByHash" => { + #[allow(non_camel_case_types)] + struct Eth_GetBlockByHashSvc(pub Arc); + impl< + T: Eth, + > tonic::server::UnaryService< + super::super::types::EthGetBlockByHashInput, + > for Eth_GetBlockByHashSvc { + type Response = super::super::types::EthBlockInfo; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::types::EthGetBlockByHashInput, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).eth_get_block_by_hash(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = Eth_GetBlockByHashSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/rpc.eth/Eth_SendTransaction" => { + #[allow(non_camel_case_types)] + struct Eth_SendTransactionSvc(pub Arc); + impl< + T: Eth, + > tonic::server::UnaryService< + super::super::types::EthSendTransactionInput, + > for Eth_SendTransactionSvc { + type Response = super::super::types::EthSendTransactionResult; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::types::EthSendTransactionInput, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).eth_send_transaction(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = Eth_SendTransactionSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/rpc.eth/Eth_ChainId" => { + #[allow(non_camel_case_types)] + struct Eth_ChainIdSvc(pub Arc); + impl tonic::server::UnaryService<()> for Eth_ChainIdSvc { + type Response = super::super::types::EthChainIdResult; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call(&mut self, request: tonic::Request<()>) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).eth_chain_id(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = Eth_ChainIdSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/rpc.eth/Net_Version" => { + #[allow(non_camel_case_types)] + struct Net_VersionSvc(pub Arc); + impl tonic::server::UnaryService<()> for Net_VersionSvc { + type Response = super::super::types::EthChainIdResult; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call(&mut self, request: tonic::Request<()>) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).net_version(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = Net_VersionSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/rpc.eth/Eth_BlockNumber" => { + #[allow(non_camel_case_types)] + struct Eth_BlockNumberSvc(pub Arc); + impl tonic::server::UnaryService<()> + for Eth_BlockNumberSvc { + type Response = super::super::types::EthBlockNumberResult; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call(&mut self, request: tonic::Request<()>) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).eth_block_number(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = Eth_BlockNumberSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/rpc.eth/Eth_GetBlockByNumber" => { + #[allow(non_camel_case_types)] + struct Eth_GetBlockByNumberSvc(pub Arc); + impl< + T: Eth, + > tonic::server::UnaryService< + super::super::types::EthGetBlockByNumberInput, + > for Eth_GetBlockByNumberSvc { + type Response = super::super::types::EthBlockInfo; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::types::EthGetBlockByNumberInput, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).eth_get_block_by_number(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = Eth_GetBlockByNumberSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/rpc.eth/Eth_Mining" => { + #[allow(non_camel_case_types)] + struct Eth_MiningSvc(pub Arc); + impl tonic::server::UnaryService<()> for Eth_MiningSvc { + type Response = super::super::types::EthMiningResult; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call(&mut self, request: tonic::Request<()>) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).eth_mining(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = Eth_MiningSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for EthServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for EthServer { + const NAME: &'static str = "rpc.eth"; + } +} + +#[cxx::bridge] +pub mod ffi { +# [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Transaction { pub hash : String , pub raw : RawTransaction , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct RawTransaction { pub in_active_chain : bool , pub hex : String , pub txid : String , pub hash : String , pub size : u32 , pub vsize : u32 , pub weight : u32 , pub version : u32 , pub locktime : u64 , pub vin : Vec < Vin > , pub vout : Vec < Vout > , pub blockhash : String , pub confirmations : String , pub blocktime : u64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Vin { pub txid : String , pub vout : u32 , pub script_sig : ScriptSig , pub sequence : u64 , pub txinwitness : Vec < String > , pub coinbase : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct ScriptSig { pub field_asm : String , pub hex : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Vout { pub value : f64 , pub n : u64 , pub script_pub_key : PubKey , pub token_id : u64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct PubKey { pub field_asm : String , pub hex : String , pub field_type : String , pub req_sigs : i32 , pub addresses : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Block { pub hash : String , pub confirmations : i64 , pub size : u64 , pub strippedsize : u64 , pub weight : u64 , pub height : u64 , pub version : u64 , pub version_hex : String , pub merkleroot : String , pub tx : Vec < Transaction > , pub time : u64 , pub mediantime : u64 , pub nonce : u64 , pub bits : String , pub difficulty : f64 , pub chainwork : String , pub n_tx : u32 , pub previous_block_hash : String , pub next_block_hash : String , pub masternode : String , pub minter : String , pub minted_blocks : u64 , pub stake_modifier : String , pub nonutxo : Vec < NonUtxo > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct NonUtxo { pub anchor_reward : f64 , pub burnt : f64 , pub incentive_funding : f64 , pub loan : f64 , pub options : f64 , pub unknown : f64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct BlockInput { pub blockhash : String , pub verbosity : u32 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct BlockResult { pub hash : String , pub block : Block , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct BlockHashResult { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthAccountsResult { pub accounts : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthTransactionInfo { pub from : String , pub to : String , pub gas : u64 , pub price : u64 , pub value : u64 , pub data : String , pub nonce : u64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthChainIdResult { pub id : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthBlockInfo { pub block_number : String , pub hash : String , pub parent_hash : String , pub nonce : String , pub sha3_uncles : String , pub logs_bloom : String , pub transactions_root : String , pub state_root : String , pub receipt_root : String , pub miner : String , pub difficulty : String , pub total_difficulty : String , pub extra_data : String , pub size : String , pub gas_limit : String , pub gas_used : String , pub timestamps : String , pub transactions : Vec < String > , pub uncles : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthTransactionReceipt { pub transaction_hash : String , pub transaction_index : String , pub block_hash : String , pub block_number : String , pub from : String , pub to : String , pub cumulative_gas_used : String , pub effective_gas_price : String , pub gas_used : String , pub contract_address : String , pub logs : Vec < String > , pub logs_bloom : String , pub field_type : String , pub root : String , pub status : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCallInput { pub transaction_info : EthTransactionInfo , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCallResult { pub data : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignInput { pub address : String , pub message : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignResult { pub signature : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBalanceInput { pub address : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBalanceResult { pub balance : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendTransactionInput { pub transaction_info : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendTransactionResult { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCoinBaseResult { pub address : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthMiningResult { pub is_mining : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthHashRateResult { pub hash_rate : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGasPriceResult { pub gas_price : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthBlockNumberResult { pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionCountInput { pub address : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionCountResult { pub number_transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByHashInput { pub block_hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByHashResult { pub number_transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByNumberInput { pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByNumberResult { pub number_transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockHashInput { pub block_hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockHashResult { pub number_uncles : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockNumberInput { pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockNumberResult { pub number_uncles : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetCodeInput { pub address : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetCodeResult { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignTransactionInput { pub transaction_info : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignTransactionResult { pub transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendRawTransactionInput { pub transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendRawTransactionResult { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthEstimateGasInput { pub transaction_info : EthTransactionInfo , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthEstimateGasResult { pub gas_used : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByHashInput { pub hash : String , pub full_transaction : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByHashResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByNumberInput { pub number : String , pub full_transaction : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByNumberResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByHashInput { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByHashResult { pub transaction : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockHashAndIndexInput { pub block_hash : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockHashAndIndexResult { pub transaction : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockNumberAndIndexInput { pub block_number : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockNumberAndIndexResult { pub transaction : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockHashAndIndexInput { pub block_hash : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockHashAndIndexResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockNumberAndIndexInput { pub block_number : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockNumberAndIndexResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetCompilersResult { pub compilers : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSolidityInput { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSolidityResult { pub compiled_code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileLllInput { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileLllResult { pub compiled_code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSerpentInput { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSerpentResult { pub compiled_code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthProtocolVersionResult { pub protocol_version : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Web3Sha3Input { pub data : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Web3Sha3Result { pub data : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct NetPeerCountResult { pub number_peer : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct NetVersionResult { pub network_version : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Web3ClientVersionResult { pub client_version : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetWorkResult { pub currentblock : String , pub seed_hash : String , pub target : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitWorkInput { pub nounce : String , pub pow_hash : String , pub mix_digest : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitWorkResult { pub is_valid : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitHashrateInput { pub hash_rate : String , pub id : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitHashrateResult { pub is_valid : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetStorageAtInput { pub address : String , pub position : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetStorageAtResult { pub value : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionReceiptInput { pub transaction_hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionReceiptResult { pub transaction_receipt : EthTransactionReceipt , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSyncingInfo { pub starting_block : String , pub current_block : String , pub highest_block : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSyncingResult { pub status : bool , pub sync_info : EthSyncingInfo , } extern "Rust" { type Client ; fn NewClient (addr : & str) -> Result < Box < Client >> ; # [allow (clippy :: borrowed_box)] fn CallEth_Accounts (client : & Box < Client >) -> Result < EthAccountsResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_Call (client : & Box < Client > , eth_call_input : EthCallInput) -> Result < EthCallResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_GetBalance (client : & Box < Client > , eth_get_balance_input : EthGetBalanceInput) -> Result < EthGetBalanceResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByHash (client : & Box < Client > , eth_get_block_by_hash_input : EthGetBlockByHashInput) -> Result < EthBlockInfo > ; # [allow (clippy :: borrowed_box)] fn CallEth_ChainId (client : & Box < Client >) -> Result < EthChainIdResult > ; # [allow (clippy :: borrowed_box)] fn CallNet_Version (client : & Box < Client >) -> Result < EthChainIdResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_BlockNumber (client : & Box < Client >) -> Result < EthBlockNumberResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByNumber (client : & Box < Client > , eth_get_block_by_number_input : EthGetBlockByNumberInput) -> Result < EthBlockInfo > ; # [allow (clippy :: borrowed_box)] fn CallEth_Mining (client : & Box < Client >) -> Result < EthMiningResult > ; } +} +use jsonrpsee_core :: client :: ClientT ; use jsonrpsee_http_client :: { HttpClient , HttpClientBuilder } ; use std :: sync :: Arc ; use crate :: { CLIENTS } ; use ain_evm :: runtime :: RUNTIME ; use crate :: rpc :: * ; # [allow (unused_imports)] use self :: ffi :: * ; use ain_evm :: handler :: Handlers ; # [derive (Clone)] pub struct Client { inner : Arc < HttpClient > , handle : tokio :: runtime :: Handle , } # [allow (non_snake_case)] fn NewClient (addr : & str) -> Result < Box < Client > , Box < dyn std :: error :: Error >> { if CLIENTS . read () . unwrap () . get (addr) . is_none () { log :: info ! ("Initializing RPC client for {}" , addr) ; let c = Client { inner : Arc :: new (HttpClientBuilder :: default () . build (addr) ?) , handle : RUNTIME . rt_handle . clone () , } ; CLIENTS . write () . unwrap () . insert (addr . into () , c) ; } Ok (Box :: new (CLIENTS . read () . unwrap () . get (addr) . unwrap () . clone ())) } # [allow (dead_code)] fn missing_param (field : & str) -> jsonrpsee_core :: Error { jsonrpsee_core :: Error :: Call (jsonrpsee_types :: error :: CallError :: Custom (jsonrpsee_types :: ErrorObject :: borrowed (- 1 , & format ! ("Missing required parameter '{field}'") , None) . into_owned ())) } impl From < ffi :: EthGetBalanceResult > for super :: types :: EthGetBalanceResult { fn from (other : ffi :: EthGetBalanceResult) -> Self { super :: types :: EthGetBalanceResult { balance : other . balance . into () , } } } impl From < super :: types :: EthGetBalanceResult > for ffi :: EthGetBalanceResult { fn from (other : super :: types :: EthGetBalanceResult) -> Self { ffi :: EthGetBalanceResult { balance : other . balance . into () , } } } impl From < ffi :: EthGetWorkResult > for super :: types :: EthGetWorkResult { fn from (other : ffi :: EthGetWorkResult) -> Self { super :: types :: EthGetWorkResult { currentblock : other . currentblock . into () , seed_hash : other . seed_hash . into () , target : other . target . into () , } } } impl From < super :: types :: EthGetWorkResult > for ffi :: EthGetWorkResult { fn from (other : super :: types :: EthGetWorkResult) -> Self { ffi :: EthGetWorkResult { currentblock : other . currentblock . into () , seed_hash : other . seed_hash . into () , target : other . target . into () , } } } impl From < ffi :: EthGetUncleCountByBlockNumberResult > for super :: types :: EthGetUncleCountByBlockNumberResult { fn from (other : ffi :: EthGetUncleCountByBlockNumberResult) -> Self { super :: types :: EthGetUncleCountByBlockNumberResult { number_uncles : other . number_uncles . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockNumberResult > for ffi :: EthGetUncleCountByBlockNumberResult { fn from (other : super :: types :: EthGetUncleCountByBlockNumberResult) -> Self { ffi :: EthGetUncleCountByBlockNumberResult { number_uncles : other . number_uncles . into () , } } } impl From < ffi :: BlockResult > for super :: types :: BlockResult { fn from (other : ffi :: BlockResult) -> Self { super :: types :: BlockResult { hash : other . hash . into () , block : Some (other . block . into ()) , } } } impl From < super :: types :: BlockResult > for ffi :: BlockResult { fn from (other : super :: types :: BlockResult) -> Self { ffi :: BlockResult { hash : other . hash . into () , block : other . block . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthEstimateGasInput > for super :: types :: EthEstimateGasInput { fn from (other : ffi :: EthEstimateGasInput) -> Self { super :: types :: EthEstimateGasInput { transaction_info : Some (other . transaction_info . into ()) , block_number : Some (other . block_number . into ()) , } } } impl From < super :: types :: EthEstimateGasInput > for ffi :: EthEstimateGasInput { fn from (other : super :: types :: EthEstimateGasInput) -> Self { ffi :: EthEstimateGasInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , block_number : other . block_number . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: BlockHashResult > for super :: types :: BlockHashResult { fn from (other : ffi :: BlockHashResult) -> Self { super :: types :: BlockHashResult { hash : other . hash . into () , } } } impl From < super :: types :: BlockHashResult > for ffi :: BlockHashResult { fn from (other : super :: types :: BlockHashResult) -> Self { ffi :: BlockHashResult { hash : other . hash . into () , } } } impl From < ffi :: EthGetUncleByBlockNumberAndIndexInput > for super :: types :: EthGetUncleByBlockNumberAndIndexInput { fn from (other : ffi :: EthGetUncleByBlockNumberAndIndexInput) -> Self { super :: types :: EthGetUncleByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetUncleByBlockNumberAndIndexInput > for ffi :: EthGetUncleByBlockNumberAndIndexInput { fn from (other : super :: types :: EthGetUncleByBlockNumberAndIndexInput) -> Self { ffi :: EthGetUncleByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < ffi :: EthSubmitWorkInput > for super :: types :: EthSubmitWorkInput { fn from (other : ffi :: EthSubmitWorkInput) -> Self { super :: types :: EthSubmitWorkInput { nounce : other . nounce . into () , pow_hash : other . pow_hash . into () , mix_digest : other . mix_digest . into () , } } } impl From < super :: types :: EthSubmitWorkInput > for ffi :: EthSubmitWorkInput { fn from (other : super :: types :: EthSubmitWorkInput) -> Self { ffi :: EthSubmitWorkInput { nounce : other . nounce . into () , pow_hash : other . pow_hash . into () , mix_digest : other . mix_digest . into () , } } } impl From < ffi :: EthCallResult > for super :: types :: EthCallResult { fn from (other : ffi :: EthCallResult) -> Self { super :: types :: EthCallResult { data : other . data . into () , } } } impl From < super :: types :: EthCallResult > for ffi :: EthCallResult { fn from (other : super :: types :: EthCallResult) -> Self { ffi :: EthCallResult { data : other . data . into () , } } } impl From < ffi :: EthSyncingResult > for super :: types :: EthSyncingResult { fn from (other : ffi :: EthSyncingResult) -> Self { super :: types :: EthSyncingResult { status : Some (other . status . into ()) , sync_info : Some (other . sync_info . into ()) , } } } impl From < super :: types :: EthSyncingResult > for ffi :: EthSyncingResult { fn from (other : super :: types :: EthSyncingResult) -> Self { ffi :: EthSyncingResult { status : other . status . map (Into :: into) . unwrap_or_default () , sync_info : other . sync_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetUncleCountByBlockHashResult > for super :: types :: EthGetUncleCountByBlockHashResult { fn from (other : ffi :: EthGetUncleCountByBlockHashResult) -> Self { super :: types :: EthGetUncleCountByBlockHashResult { number_uncles : other . number_uncles . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockHashResult > for ffi :: EthGetUncleCountByBlockHashResult { fn from (other : super :: types :: EthGetUncleCountByBlockHashResult) -> Self { ffi :: EthGetUncleCountByBlockHashResult { number_uncles : other . number_uncles . into () , } } } impl From < ffi :: EthGetBlockTransactionCountByHashInput > for super :: types :: EthGetBlockTransactionCountByHashInput { fn from (other : ffi :: EthGetBlockTransactionCountByHashInput) -> Self { super :: types :: EthGetBlockTransactionCountByHashInput { block_hash : other . block_hash . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByHashInput > for ffi :: EthGetBlockTransactionCountByHashInput { fn from (other : super :: types :: EthGetBlockTransactionCountByHashInput) -> Self { ffi :: EthGetBlockTransactionCountByHashInput { block_hash : other . block_hash . into () , } } } impl From < ffi :: BlockInput > for super :: types :: BlockInput { fn from (other : ffi :: BlockInput) -> Self { super :: types :: BlockInput { blockhash : other . blockhash . into () , verbosity : other . verbosity . into () , } } } impl From < super :: types :: BlockInput > for ffi :: BlockInput { fn from (other : super :: types :: BlockInput) -> Self { ffi :: BlockInput { blockhash : other . blockhash . into () , verbosity : other . verbosity . into () , } } } impl From < ffi :: EthSubmitWorkResult > for super :: types :: EthSubmitWorkResult { fn from (other : ffi :: EthSubmitWorkResult) -> Self { super :: types :: EthSubmitWorkResult { is_valid : other . is_valid . into () , } } } impl From < super :: types :: EthSubmitWorkResult > for ffi :: EthSubmitWorkResult { fn from (other : super :: types :: EthSubmitWorkResult) -> Self { ffi :: EthSubmitWorkResult { is_valid : other . is_valid . into () , } } } impl From < ffi :: EthGetTransactionReceiptResult > for super :: types :: EthGetTransactionReceiptResult { fn from (other : ffi :: EthGetTransactionReceiptResult) -> Self { super :: types :: EthGetTransactionReceiptResult { transaction_receipt : Some (other . transaction_receipt . into ()) , } } } impl From < super :: types :: EthGetTransactionReceiptResult > for ffi :: EthGetTransactionReceiptResult { fn from (other : super :: types :: EthGetTransactionReceiptResult) -> Self { ffi :: EthGetTransactionReceiptResult { transaction_receipt : other . transaction_receipt . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetTransactionCountResult > for super :: types :: EthGetTransactionCountResult { fn from (other : ffi :: EthGetTransactionCountResult) -> Self { super :: types :: EthGetTransactionCountResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetTransactionCountResult > for ffi :: EthGetTransactionCountResult { fn from (other : super :: types :: EthGetTransactionCountResult) -> Self { ffi :: EthGetTransactionCountResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: NetVersionResult > for super :: types :: NetVersionResult { fn from (other : ffi :: NetVersionResult) -> Self { super :: types :: NetVersionResult { network_version : other . network_version . into () , } } } impl From < super :: types :: NetVersionResult > for ffi :: NetVersionResult { fn from (other : super :: types :: NetVersionResult) -> Self { ffi :: NetVersionResult { network_version : other . network_version . into () , } } } impl From < ffi :: Block > for super :: types :: Block { fn from (other : ffi :: Block) -> Self { super :: types :: Block { hash : other . hash . into () , confirmations : other . confirmations . into () , size : other . size . into () , strippedsize : other . strippedsize . into () , weight : other . weight . into () , height : other . height . into () , version : other . version . into () , version_hex : other . version_hex . into () , merkleroot : other . merkleroot . into () , tx : other . tx . into_iter () . map (Into :: into) . collect () , time : other . time . into () , mediantime : other . mediantime . into () , nonce : other . nonce . into () , bits : other . bits . into () , difficulty : other . difficulty . into () , chainwork : other . chainwork . into () , n_tx : other . n_tx . into () , previous_block_hash : other . previous_block_hash . into () , next_block_hash : other . next_block_hash . into () , masternode : other . masternode . into () , minter : other . minter . into () , minted_blocks : other . minted_blocks . into () , stake_modifier : other . stake_modifier . into () , nonutxo : other . nonutxo . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: Block > for ffi :: Block { fn from (other : super :: types :: Block) -> Self { ffi :: Block { hash : other . hash . into () , confirmations : other . confirmations . into () , size : other . size . into () , strippedsize : other . strippedsize . into () , weight : other . weight . into () , height : other . height . into () , version : other . version . into () , version_hex : other . version_hex . into () , merkleroot : other . merkleroot . into () , tx : other . tx . into_iter () . map (Into :: into) . collect () , time : other . time . into () , mediantime : other . mediantime . into () , nonce : other . nonce . into () , bits : other . bits . into () , difficulty : other . difficulty . into () , chainwork : other . chainwork . into () , n_tx : other . n_tx . into () , previous_block_hash : other . previous_block_hash . into () , next_block_hash : other . next_block_hash . into () , masternode : other . masternode . into () , minter : other . minter . into () , minted_blocks : other . minted_blocks . into () , stake_modifier : other . stake_modifier . into () , nonutxo : other . nonutxo . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: Transaction > for super :: types :: Transaction { fn from (other : ffi :: Transaction) -> Self { super :: types :: Transaction { hash : other . hash . into () , raw : Some (other . raw . into ()) , } } } impl From < super :: types :: Transaction > for ffi :: Transaction { fn from (other : super :: types :: Transaction) -> Self { ffi :: Transaction { hash : other . hash . into () , raw : other . raw . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetTransactionByHashInput > for super :: types :: EthGetTransactionByHashInput { fn from (other : ffi :: EthGetTransactionByHashInput) -> Self { super :: types :: EthGetTransactionByHashInput { hash : other . hash . into () , } } } impl From < super :: types :: EthGetTransactionByHashInput > for ffi :: EthGetTransactionByHashInput { fn from (other : super :: types :: EthGetTransactionByHashInput) -> Self { ffi :: EthGetTransactionByHashInput { hash : other . hash . into () , } } } impl From < ffi :: EthGetBlockByNumberInput > for super :: types :: EthGetBlockByNumberInput { fn from (other : ffi :: EthGetBlockByNumberInput) -> Self { super :: types :: EthGetBlockByNumberInput { number : other . number . into () , full_transaction : other . full_transaction . into () , } } } impl From < super :: types :: EthGetBlockByNumberInput > for ffi :: EthGetBlockByNumberInput { fn from (other : super :: types :: EthGetBlockByNumberInput) -> Self { ffi :: EthGetBlockByNumberInput { number : other . number . into () , full_transaction : other . full_transaction . into () , } } } impl From < ffi :: Vin > for super :: types :: Vin { fn from (other : ffi :: Vin) -> Self { super :: types :: Vin { txid : other . txid . into () , vout : other . vout . into () , script_sig : Some (other . script_sig . into ()) , sequence : other . sequence . into () , txinwitness : other . txinwitness . into_iter () . map (Into :: into) . collect () , coinbase : other . coinbase . into () , } } } impl From < super :: types :: Vin > for ffi :: Vin { fn from (other : super :: types :: Vin) -> Self { ffi :: Vin { txid : other . txid . into () , vout : other . vout . into () , script_sig : other . script_sig . map (Into :: into) . unwrap_or_default () , sequence : other . sequence . into () , txinwitness : other . txinwitness . into_iter () . map (Into :: into) . collect () , coinbase : other . coinbase . into () , } } } impl From < ffi :: EthChainIdResult > for super :: types :: EthChainIdResult { fn from (other : ffi :: EthChainIdResult) -> Self { super :: types :: EthChainIdResult { id : other . id . into () , } } } impl From < super :: types :: EthChainIdResult > for ffi :: EthChainIdResult { fn from (other : super :: types :: EthChainIdResult) -> Self { ffi :: EthChainIdResult { id : other . id . into () , } } } impl From < ffi :: EthCompileSerpentResult > for super :: types :: EthCompileSerpentResult { fn from (other : ffi :: EthCompileSerpentResult) -> Self { super :: types :: EthCompileSerpentResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileSerpentResult > for ffi :: EthCompileSerpentResult { fn from (other : super :: types :: EthCompileSerpentResult) -> Self { ffi :: EthCompileSerpentResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: Vout > for super :: types :: Vout { fn from (other : ffi :: Vout) -> Self { super :: types :: Vout { value : other . value . into () , n : other . n . into () , script_pub_key : Some (other . script_pub_key . into ()) , token_id : other . token_id . into () , } } } impl From < super :: types :: Vout > for ffi :: Vout { fn from (other : super :: types :: Vout) -> Self { ffi :: Vout { value : other . value . into () , n : other . n . into () , script_pub_key : other . script_pub_key . map (Into :: into) . unwrap_or_default () , token_id : other . token_id . into () , } } } impl From < ffi :: EthBlockNumberResult > for super :: types :: EthBlockNumberResult { fn from (other : ffi :: EthBlockNumberResult) -> Self { super :: types :: EthBlockNumberResult { block_number : other . block_number . into () , } } } impl From < super :: types :: EthBlockNumberResult > for ffi :: EthBlockNumberResult { fn from (other : super :: types :: EthBlockNumberResult) -> Self { ffi :: EthBlockNumberResult { block_number : other . block_number . into () , } } } impl From < ffi :: EthGetBlockTransactionCountByHashResult > for super :: types :: EthGetBlockTransactionCountByHashResult { fn from (other : ffi :: EthGetBlockTransactionCountByHashResult) -> Self { super :: types :: EthGetBlockTransactionCountByHashResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByHashResult > for ffi :: EthGetBlockTransactionCountByHashResult { fn from (other : super :: types :: EthGetBlockTransactionCountByHashResult) -> Self { ffi :: EthGetBlockTransactionCountByHashResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: PubKey > for super :: types :: PubKey { fn from (other : ffi :: PubKey) -> Self { super :: types :: PubKey { field_asm : other . field_asm . into () , hex : other . hex . into () , field_type : other . field_type . into () , req_sigs : other . req_sigs . into () , addresses : other . addresses . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: PubKey > for ffi :: PubKey { fn from (other : super :: types :: PubKey) -> Self { ffi :: PubKey { field_asm : other . field_asm . into () , hex : other . hex . into () , field_type : other . field_type . into () , req_sigs : other . req_sigs . into () , addresses : other . addresses . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetBlockTransactionCountByNumberInput > for super :: types :: EthGetBlockTransactionCountByNumberInput { fn from (other : ffi :: EthGetBlockTransactionCountByNumberInput) -> Self { super :: types :: EthGetBlockTransactionCountByNumberInput { block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByNumberInput > for ffi :: EthGetBlockTransactionCountByNumberInput { fn from (other : super :: types :: EthGetBlockTransactionCountByNumberInput) -> Self { ffi :: EthGetBlockTransactionCountByNumberInput { block_number : other . block_number . into () , } } } impl From < ffi :: EthSendRawTransactionResult > for super :: types :: EthSendRawTransactionResult { fn from (other : ffi :: EthSendRawTransactionResult) -> Self { super :: types :: EthSendRawTransactionResult { hash : other . hash . into () , } } } impl From < super :: types :: EthSendRawTransactionResult > for ffi :: EthSendRawTransactionResult { fn from (other : super :: types :: EthSendRawTransactionResult) -> Self { ffi :: EthSendRawTransactionResult { hash : other . hash . into () , } } } impl From < ffi :: EthGetBlockByHashResult > for super :: types :: EthGetBlockByHashResult { fn from (other : ffi :: EthGetBlockByHashResult) -> Self { super :: types :: EthGetBlockByHashResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetBlockByHashResult > for ffi :: EthGetBlockByHashResult { fn from (other : super :: types :: EthGetBlockByHashResult) -> Self { ffi :: EthGetBlockByHashResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetTransactionByBlockHashAndIndexResult > for super :: types :: EthGetTransactionByBlockHashAndIndexResult { fn from (other : ffi :: EthGetTransactionByBlockHashAndIndexResult) -> Self { super :: types :: EthGetTransactionByBlockHashAndIndexResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByBlockHashAndIndexResult > for ffi :: EthGetTransactionByBlockHashAndIndexResult { fn from (other : super :: types :: EthGetTransactionByBlockHashAndIndexResult) -> Self { ffi :: EthGetTransactionByBlockHashAndIndexResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetTransactionByBlockNumberAndIndexResult > for super :: types :: EthGetTransactionByBlockNumberAndIndexResult { fn from (other : ffi :: EthGetTransactionByBlockNumberAndIndexResult) -> Self { super :: types :: EthGetTransactionByBlockNumberAndIndexResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByBlockNumberAndIndexResult > for ffi :: EthGetTransactionByBlockNumberAndIndexResult { fn from (other : super :: types :: EthGetTransactionByBlockNumberAndIndexResult) -> Self { ffi :: EthGetTransactionByBlockNumberAndIndexResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetUncleByBlockHashAndIndexInput > for super :: types :: EthGetUncleByBlockHashAndIndexInput { fn from (other : ffi :: EthGetUncleByBlockHashAndIndexInput) -> Self { super :: types :: EthGetUncleByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetUncleByBlockHashAndIndexInput > for ffi :: EthGetUncleByBlockHashAndIndexInput { fn from (other : super :: types :: EthGetUncleByBlockHashAndIndexInput) -> Self { ffi :: EthGetUncleByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < ffi :: EthCompileLllResult > for super :: types :: EthCompileLllResult { fn from (other : ffi :: EthCompileLllResult) -> Self { super :: types :: EthCompileLllResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileLllResult > for ffi :: EthCompileLllResult { fn from (other : super :: types :: EthCompileLllResult) -> Self { ffi :: EthCompileLllResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: Web3Sha3Result > for super :: types :: Web3Sha3Result { fn from (other : ffi :: Web3Sha3Result) -> Self { super :: types :: Web3Sha3Result { data : other . data . into () , } } } impl From < super :: types :: Web3Sha3Result > for ffi :: Web3Sha3Result { fn from (other : super :: types :: Web3Sha3Result) -> Self { ffi :: Web3Sha3Result { data : other . data . into () , } } } impl From < ffi :: EthGetTransactionReceiptInput > for super :: types :: EthGetTransactionReceiptInput { fn from (other : ffi :: EthGetTransactionReceiptInput) -> Self { super :: types :: EthGetTransactionReceiptInput { transaction_hash : other . transaction_hash . into () , } } } impl From < super :: types :: EthGetTransactionReceiptInput > for ffi :: EthGetTransactionReceiptInput { fn from (other : super :: types :: EthGetTransactionReceiptInput) -> Self { ffi :: EthGetTransactionReceiptInput { transaction_hash : other . transaction_hash . into () , } } } impl From < ffi :: EthTransactionInfo > for super :: types :: EthTransactionInfo { fn from (other : ffi :: EthTransactionInfo) -> Self { super :: types :: EthTransactionInfo { from : Some (other . from . into ()) , to : Some (other . to . into ()) , gas : Some (other . gas . into ()) , price : Some (other . price . into ()) , value : Some (other . value . into ()) , data : Some (other . data . into ()) , nonce : Some (other . nonce . into ()) , } } } impl From < super :: types :: EthTransactionInfo > for ffi :: EthTransactionInfo { fn from (other : super :: types :: EthTransactionInfo) -> Self { ffi :: EthTransactionInfo { from : other . from . map (Into :: into) . unwrap_or_default () , to : other . to . map (Into :: into) . unwrap_or_default () , gas : other . gas . map (Into :: into) . unwrap_or_default () , price : other . price . map (Into :: into) . unwrap_or_default () , value : other . value . map (Into :: into) . unwrap_or_default () , data : other . data . map (Into :: into) . unwrap_or_default () , nonce : other . nonce . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthSignTransactionResult > for super :: types :: EthSignTransactionResult { fn from (other : ffi :: EthSignTransactionResult) -> Self { super :: types :: EthSignTransactionResult { transaction : other . transaction . into () , } } } impl From < super :: types :: EthSignTransactionResult > for ffi :: EthSignTransactionResult { fn from (other : super :: types :: EthSignTransactionResult) -> Self { ffi :: EthSignTransactionResult { transaction : other . transaction . into () , } } } impl From < ffi :: EthProtocolVersionResult > for super :: types :: EthProtocolVersionResult { fn from (other : ffi :: EthProtocolVersionResult) -> Self { super :: types :: EthProtocolVersionResult { protocol_version : other . protocol_version . into () , } } } impl From < super :: types :: EthProtocolVersionResult > for ffi :: EthProtocolVersionResult { fn from (other : super :: types :: EthProtocolVersionResult) -> Self { ffi :: EthProtocolVersionResult { protocol_version : other . protocol_version . into () , } } } impl From < ffi :: NonUtxo > for super :: types :: NonUtxo { fn from (other : ffi :: NonUtxo) -> Self { super :: types :: NonUtxo { anchor_reward : other . anchor_reward . into () , burnt : other . burnt . into () , incentive_funding : other . incentive_funding . into () , loan : other . loan . into () , options : other . options . into () , unknown : other . unknown . into () , } } } impl From < super :: types :: NonUtxo > for ffi :: NonUtxo { fn from (other : super :: types :: NonUtxo) -> Self { ffi :: NonUtxo { anchor_reward : other . anchor_reward . into () , burnt : other . burnt . into () , incentive_funding : other . incentive_funding . into () , loan : other . loan . into () , options : other . options . into () , unknown : other . unknown . into () , } } } impl From < ffi :: EthEstimateGasResult > for super :: types :: EthEstimateGasResult { fn from (other : ffi :: EthEstimateGasResult) -> Self { super :: types :: EthEstimateGasResult { gas_used : other . gas_used . into () , } } } impl From < super :: types :: EthEstimateGasResult > for ffi :: EthEstimateGasResult { fn from (other : super :: types :: EthEstimateGasResult) -> Self { ffi :: EthEstimateGasResult { gas_used : other . gas_used . into () , } } } impl From < ffi :: EthGetBalanceInput > for super :: types :: EthGetBalanceInput { fn from (other : ffi :: EthGetBalanceInput) -> Self { super :: types :: EthGetBalanceInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetBalanceInput > for ffi :: EthGetBalanceInput { fn from (other : super :: types :: EthGetBalanceInput) -> Self { ffi :: EthGetBalanceInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthSignInput > for super :: types :: EthSignInput { fn from (other : ffi :: EthSignInput) -> Self { super :: types :: EthSignInput { address : other . address . into () , message : other . message . into () , } } } impl From < super :: types :: EthSignInput > for ffi :: EthSignInput { fn from (other : super :: types :: EthSignInput) -> Self { ffi :: EthSignInput { address : other . address . into () , message : other . message . into () , } } } impl From < ffi :: EthGetTransactionByHashResult > for super :: types :: EthGetTransactionByHashResult { fn from (other : ffi :: EthGetTransactionByHashResult) -> Self { super :: types :: EthGetTransactionByHashResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByHashResult > for ffi :: EthGetTransactionByHashResult { fn from (other : super :: types :: EthGetTransactionByHashResult) -> Self { ffi :: EthGetTransactionByHashResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetBlockByNumberResult > for super :: types :: EthGetBlockByNumberResult { fn from (other : ffi :: EthGetBlockByNumberResult) -> Self { super :: types :: EthGetBlockByNumberResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetBlockByNumberResult > for ffi :: EthGetBlockByNumberResult { fn from (other : super :: types :: EthGetBlockByNumberResult) -> Self { ffi :: EthGetBlockByNumberResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: Web3ClientVersionResult > for super :: types :: Web3ClientVersionResult { fn from (other : ffi :: Web3ClientVersionResult) -> Self { super :: types :: Web3ClientVersionResult { client_version : other . client_version . into () , } } } impl From < super :: types :: Web3ClientVersionResult > for ffi :: Web3ClientVersionResult { fn from (other : super :: types :: Web3ClientVersionResult) -> Self { ffi :: Web3ClientVersionResult { client_version : other . client_version . into () , } } } impl From < ffi :: EthSignTransactionInput > for super :: types :: EthSignTransactionInput { fn from (other : ffi :: EthSignTransactionInput) -> Self { super :: types :: EthSignTransactionInput { transaction_info : Some (other . transaction_info . into ()) , } } } impl From < super :: types :: EthSignTransactionInput > for ffi :: EthSignTransactionInput { fn from (other : super :: types :: EthSignTransactionInput) -> Self { ffi :: EthSignTransactionInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetUncleCountByBlockNumberInput > for super :: types :: EthGetUncleCountByBlockNumberInput { fn from (other : ffi :: EthGetUncleCountByBlockNumberInput) -> Self { super :: types :: EthGetUncleCountByBlockNumberInput { block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockNumberInput > for ffi :: EthGetUncleCountByBlockNumberInput { fn from (other : super :: types :: EthGetUncleCountByBlockNumberInput) -> Self { ffi :: EthGetUncleCountByBlockNumberInput { block_number : other . block_number . into () , } } } impl From < ffi :: EthCompileLllInput > for super :: types :: EthCompileLllInput { fn from (other : ffi :: EthCompileLllInput) -> Self { super :: types :: EthCompileLllInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileLllInput > for ffi :: EthCompileLllInput { fn from (other : super :: types :: EthCompileLllInput) -> Self { ffi :: EthCompileLllInput { code : other . code . into () , } } } impl From < ffi :: EthGetUncleByBlockHashAndIndexResult > for super :: types :: EthGetUncleByBlockHashAndIndexResult { fn from (other : ffi :: EthGetUncleByBlockHashAndIndexResult) -> Self { super :: types :: EthGetUncleByBlockHashAndIndexResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetUncleByBlockHashAndIndexResult > for ffi :: EthGetUncleByBlockHashAndIndexResult { fn from (other : super :: types :: EthGetUncleByBlockHashAndIndexResult) -> Self { ffi :: EthGetUncleByBlockHashAndIndexResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthSyncingInfo > for super :: types :: EthSyncingInfo { fn from (other : ffi :: EthSyncingInfo) -> Self { super :: types :: EthSyncingInfo { starting_block : other . starting_block . into () , current_block : other . current_block . into () , highest_block : other . highest_block . into () , } } } impl From < super :: types :: EthSyncingInfo > for ffi :: EthSyncingInfo { fn from (other : super :: types :: EthSyncingInfo) -> Self { ffi :: EthSyncingInfo { starting_block : other . starting_block . into () , current_block : other . current_block . into () , highest_block : other . highest_block . into () , } } } impl From < ffi :: EthSendTransactionResult > for super :: types :: EthSendTransactionResult { fn from (other : ffi :: EthSendTransactionResult) -> Self { super :: types :: EthSendTransactionResult { hash : other . hash . into () , } } } impl From < super :: types :: EthSendTransactionResult > for ffi :: EthSendTransactionResult { fn from (other : super :: types :: EthSendTransactionResult) -> Self { ffi :: EthSendTransactionResult { hash : other . hash . into () , } } } impl From < ffi :: EthGetBlockTransactionCountByNumberResult > for super :: types :: EthGetBlockTransactionCountByNumberResult { fn from (other : ffi :: EthGetBlockTransactionCountByNumberResult) -> Self { super :: types :: EthGetBlockTransactionCountByNumberResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByNumberResult > for ffi :: EthGetBlockTransactionCountByNumberResult { fn from (other : super :: types :: EthGetBlockTransactionCountByNumberResult) -> Self { ffi :: EthGetBlockTransactionCountByNumberResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: EthBlockInfo > for super :: types :: EthBlockInfo { fn from (other : ffi :: EthBlockInfo) -> Self { super :: types :: EthBlockInfo { block_number : other . block_number . into () , hash : other . hash . into () , parent_hash : other . parent_hash . into () , nonce : other . nonce . into () , sha3_uncles : other . sha3_uncles . into () , logs_bloom : other . logs_bloom . into () , transactions_root : other . transactions_root . into () , state_root : other . state_root . into () , receipt_root : other . receipt_root . into () , miner : other . miner . into () , difficulty : other . difficulty . into () , total_difficulty : other . total_difficulty . into () , extra_data : other . extra_data . into () , size : other . size . into () , gas_limit : other . gas_limit . into () , gas_used : other . gas_used . into () , timestamps : other . timestamps . into () , transactions : other . transactions . into_iter () . map (Into :: into) . collect () , uncles : other . uncles . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthBlockInfo > for ffi :: EthBlockInfo { fn from (other : super :: types :: EthBlockInfo) -> Self { ffi :: EthBlockInfo { block_number : other . block_number . into () , hash : other . hash . into () , parent_hash : other . parent_hash . into () , nonce : other . nonce . into () , sha3_uncles : other . sha3_uncles . into () , logs_bloom : other . logs_bloom . into () , transactions_root : other . transactions_root . into () , state_root : other . state_root . into () , receipt_root : other . receipt_root . into () , miner : other . miner . into () , difficulty : other . difficulty . into () , total_difficulty : other . total_difficulty . into () , extra_data : other . extra_data . into () , size : other . size . into () , gas_limit : other . gas_limit . into () , gas_used : other . gas_used . into () , timestamps : other . timestamps . into () , transactions : other . transactions . into_iter () . map (Into :: into) . collect () , uncles : other . uncles . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthTransactionReceipt > for super :: types :: EthTransactionReceipt { fn from (other : ffi :: EthTransactionReceipt) -> Self { super :: types :: EthTransactionReceipt { transaction_hash : other . transaction_hash . into () , transaction_index : other . transaction_index . into () , block_hash : other . block_hash . into () , block_number : other . block_number . into () , from : other . from . into () , to : other . to . into () , cumulative_gas_used : other . cumulative_gas_used . into () , effective_gas_price : other . effective_gas_price . into () , gas_used : other . gas_used . into () , contract_address : other . contract_address . into () , logs : other . logs . into_iter () . map (Into :: into) . collect () , logs_bloom : other . logs_bloom . into () , field_type : other . field_type . into () , root : Some (other . root . into ()) , status : Some (other . status . into ()) , } } } impl From < super :: types :: EthTransactionReceipt > for ffi :: EthTransactionReceipt { fn from (other : super :: types :: EthTransactionReceipt) -> Self { ffi :: EthTransactionReceipt { transaction_hash : other . transaction_hash . into () , transaction_index : other . transaction_index . into () , block_hash : other . block_hash . into () , block_number : other . block_number . into () , from : other . from . into () , to : other . to . into () , cumulative_gas_used : other . cumulative_gas_used . into () , effective_gas_price : other . effective_gas_price . into () , gas_used : other . gas_used . into () , contract_address : other . contract_address . into () , logs : other . logs . into_iter () . map (Into :: into) . collect () , logs_bloom : other . logs_bloom . into () , field_type : other . field_type . into () , root : other . root . map (Into :: into) . unwrap_or_default () , status : other . status . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: RawTransaction > for super :: types :: RawTransaction { fn from (other : ffi :: RawTransaction) -> Self { super :: types :: RawTransaction { in_active_chain : other . in_active_chain . into () , hex : other . hex . into () , txid : other . txid . into () , hash : other . hash . into () , size : other . size . into () , vsize : other . vsize . into () , weight : other . weight . into () , version : other . version . into () , locktime : other . locktime . into () , vin : other . vin . into_iter () . map (Into :: into) . collect () , vout : other . vout . into_iter () . map (Into :: into) . collect () , blockhash : other . blockhash . into () , confirmations : other . confirmations . into () , blocktime : other . blocktime . into () , } } } impl From < super :: types :: RawTransaction > for ffi :: RawTransaction { fn from (other : super :: types :: RawTransaction) -> Self { ffi :: RawTransaction { in_active_chain : other . in_active_chain . into () , hex : other . hex . into () , txid : other . txid . into () , hash : other . hash . into () , size : other . size . into () , vsize : other . vsize . into () , weight : other . weight . into () , version : other . version . into () , locktime : other . locktime . into () , vin : other . vin . into_iter () . map (Into :: into) . collect () , vout : other . vout . into_iter () . map (Into :: into) . collect () , blockhash : other . blockhash . into () , confirmations : other . confirmations . into () , blocktime : other . blocktime . into () , } } } impl From < ffi :: EthSignResult > for super :: types :: EthSignResult { fn from (other : ffi :: EthSignResult) -> Self { super :: types :: EthSignResult { signature : other . signature . into () , } } } impl From < super :: types :: EthSignResult > for ffi :: EthSignResult { fn from (other : super :: types :: EthSignResult) -> Self { ffi :: EthSignResult { signature : other . signature . into () , } } } impl From < ffi :: EthGetTransactionByBlockNumberAndIndexInput > for super :: types :: EthGetTransactionByBlockNumberAndIndexInput { fn from (other : ffi :: EthGetTransactionByBlockNumberAndIndexInput) -> Self { super :: types :: EthGetTransactionByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetTransactionByBlockNumberAndIndexInput > for ffi :: EthGetTransactionByBlockNumberAndIndexInput { fn from (other : super :: types :: EthGetTransactionByBlockNumberAndIndexInput) -> Self { ffi :: EthGetTransactionByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < ffi :: EthGetStorageAtResult > for super :: types :: EthGetStorageAtResult { fn from (other : ffi :: EthGetStorageAtResult) -> Self { super :: types :: EthGetStorageAtResult { value : other . value . into () , } } } impl From < super :: types :: EthGetStorageAtResult > for ffi :: EthGetStorageAtResult { fn from (other : super :: types :: EthGetStorageAtResult) -> Self { ffi :: EthGetStorageAtResult { value : other . value . into () , } } } impl From < ffi :: EthCallInput > for super :: types :: EthCallInput { fn from (other : ffi :: EthCallInput) -> Self { super :: types :: EthCallInput { transaction_info : Some (other . transaction_info . into ()) , block_number : other . block_number . into () , } } } impl From < super :: types :: EthCallInput > for ffi :: EthCallInput { fn from (other : super :: types :: EthCallInput) -> Self { ffi :: EthCallInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , block_number : other . block_number . into () , } } } impl From < ffi :: EthCoinBaseResult > for super :: types :: EthCoinBaseResult { fn from (other : ffi :: EthCoinBaseResult) -> Self { super :: types :: EthCoinBaseResult { address : other . address . into () , } } } impl From < super :: types :: EthCoinBaseResult > for ffi :: EthCoinBaseResult { fn from (other : super :: types :: EthCoinBaseResult) -> Self { ffi :: EthCoinBaseResult { address : other . address . into () , } } } impl From < ffi :: EthSendTransactionInput > for super :: types :: EthSendTransactionInput { fn from (other : ffi :: EthSendTransactionInput) -> Self { super :: types :: EthSendTransactionInput { transaction_info : Some (other . transaction_info . into ()) , } } } impl From < super :: types :: EthSendTransactionInput > for ffi :: EthSendTransactionInput { fn from (other : super :: types :: EthSendTransactionInput) -> Self { ffi :: EthSendTransactionInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetCodeInput > for super :: types :: EthGetCodeInput { fn from (other : ffi :: EthGetCodeInput) -> Self { super :: types :: EthGetCodeInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetCodeInput > for ffi :: EthGetCodeInput { fn from (other : super :: types :: EthGetCodeInput) -> Self { ffi :: EthGetCodeInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthCompileSolidityInput > for super :: types :: EthCompileSolidityInput { fn from (other : ffi :: EthCompileSolidityInput) -> Self { super :: types :: EthCompileSolidityInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileSolidityInput > for ffi :: EthCompileSolidityInput { fn from (other : super :: types :: EthCompileSolidityInput) -> Self { ffi :: EthCompileSolidityInput { code : other . code . into () , } } } impl From < ffi :: ScriptSig > for super :: types :: ScriptSig { fn from (other : ffi :: ScriptSig) -> Self { super :: types :: ScriptSig { field_asm : other . field_asm . into () , hex : other . hex . into () , } } } impl From < super :: types :: ScriptSig > for ffi :: ScriptSig { fn from (other : super :: types :: ScriptSig) -> Self { ffi :: ScriptSig { field_asm : other . field_asm . into () , hex : other . hex . into () , } } } impl From < ffi :: EthGetCodeResult > for super :: types :: EthGetCodeResult { fn from (other : ffi :: EthGetCodeResult) -> Self { super :: types :: EthGetCodeResult { code : other . code . into () , } } } impl From < super :: types :: EthGetCodeResult > for ffi :: EthGetCodeResult { fn from (other : super :: types :: EthGetCodeResult) -> Self { ffi :: EthGetCodeResult { code : other . code . into () , } } } impl From < ffi :: EthSubmitHashrateResult > for super :: types :: EthSubmitHashrateResult { fn from (other : ffi :: EthSubmitHashrateResult) -> Self { super :: types :: EthSubmitHashrateResult { is_valid : other . is_valid . into () , } } } impl From < super :: types :: EthSubmitHashrateResult > for ffi :: EthSubmitHashrateResult { fn from (other : super :: types :: EthSubmitHashrateResult) -> Self { ffi :: EthSubmitHashrateResult { is_valid : other . is_valid . into () , } } } impl From < ffi :: EthGetUncleByBlockNumberAndIndexResult > for super :: types :: EthGetUncleByBlockNumberAndIndexResult { fn from (other : ffi :: EthGetUncleByBlockNumberAndIndexResult) -> Self { super :: types :: EthGetUncleByBlockNumberAndIndexResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetUncleByBlockNumberAndIndexResult > for ffi :: EthGetUncleByBlockNumberAndIndexResult { fn from (other : super :: types :: EthGetUncleByBlockNumberAndIndexResult) -> Self { ffi :: EthGetUncleByBlockNumberAndIndexResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthHashRateResult > for super :: types :: EthHashRateResult { fn from (other : ffi :: EthHashRateResult) -> Self { super :: types :: EthHashRateResult { hash_rate : other . hash_rate . into () , } } } impl From < super :: types :: EthHashRateResult > for ffi :: EthHashRateResult { fn from (other : super :: types :: EthHashRateResult) -> Self { ffi :: EthHashRateResult { hash_rate : other . hash_rate . into () , } } } impl From < ffi :: EthGetTransactionCountInput > for super :: types :: EthGetTransactionCountInput { fn from (other : ffi :: EthGetTransactionCountInput) -> Self { super :: types :: EthGetTransactionCountInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetTransactionCountInput > for ffi :: EthGetTransactionCountInput { fn from (other : super :: types :: EthGetTransactionCountInput) -> Self { ffi :: EthGetTransactionCountInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthCompileSolidityResult > for super :: types :: EthCompileSolidityResult { fn from (other : ffi :: EthCompileSolidityResult) -> Self { super :: types :: EthCompileSolidityResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileSolidityResult > for ffi :: EthCompileSolidityResult { fn from (other : super :: types :: EthCompileSolidityResult) -> Self { ffi :: EthCompileSolidityResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: NetPeerCountResult > for super :: types :: NetPeerCountResult { fn from (other : ffi :: NetPeerCountResult) -> Self { super :: types :: NetPeerCountResult { number_peer : other . number_peer . into () , } } } impl From < super :: types :: NetPeerCountResult > for ffi :: NetPeerCountResult { fn from (other : super :: types :: NetPeerCountResult) -> Self { ffi :: NetPeerCountResult { number_peer : other . number_peer . into () , } } } impl From < ffi :: EthAccountsResult > for super :: types :: EthAccountsResult { fn from (other : ffi :: EthAccountsResult) -> Self { super :: types :: EthAccountsResult { accounts : other . accounts . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthAccountsResult > for ffi :: EthAccountsResult { fn from (other : super :: types :: EthAccountsResult) -> Self { ffi :: EthAccountsResult { accounts : other . accounts . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetStorageAtInput > for super :: types :: EthGetStorageAtInput { fn from (other : ffi :: EthGetStorageAtInput) -> Self { super :: types :: EthGetStorageAtInput { address : other . address . into () , position : other . position . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetStorageAtInput > for ffi :: EthGetStorageAtInput { fn from (other : super :: types :: EthGetStorageAtInput) -> Self { ffi :: EthGetStorageAtInput { address : other . address . into () , position : other . position . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthSubmitHashrateInput > for super :: types :: EthSubmitHashrateInput { fn from (other : ffi :: EthSubmitHashrateInput) -> Self { super :: types :: EthSubmitHashrateInput { hash_rate : other . hash_rate . into () , id : other . id . into () , } } } impl From < super :: types :: EthSubmitHashrateInput > for ffi :: EthSubmitHashrateInput { fn from (other : super :: types :: EthSubmitHashrateInput) -> Self { ffi :: EthSubmitHashrateInput { hash_rate : other . hash_rate . into () , id : other . id . into () , } } } impl From < ffi :: EthGasPriceResult > for super :: types :: EthGasPriceResult { fn from (other : ffi :: EthGasPriceResult) -> Self { super :: types :: EthGasPriceResult { gas_price : other . gas_price . into () , } } } impl From < super :: types :: EthGasPriceResult > for ffi :: EthGasPriceResult { fn from (other : super :: types :: EthGasPriceResult) -> Self { ffi :: EthGasPriceResult { gas_price : other . gas_price . into () , } } } impl From < ffi :: Web3Sha3Input > for super :: types :: Web3Sha3Input { fn from (other : ffi :: Web3Sha3Input) -> Self { super :: types :: Web3Sha3Input { data : other . data . into () , } } } impl From < super :: types :: Web3Sha3Input > for ffi :: Web3Sha3Input { fn from (other : super :: types :: Web3Sha3Input) -> Self { ffi :: Web3Sha3Input { data : other . data . into () , } } } impl From < ffi :: EthMiningResult > for super :: types :: EthMiningResult { fn from (other : ffi :: EthMiningResult) -> Self { super :: types :: EthMiningResult { is_mining : other . is_mining . into () , } } } impl From < super :: types :: EthMiningResult > for ffi :: EthMiningResult { fn from (other : super :: types :: EthMiningResult) -> Self { ffi :: EthMiningResult { is_mining : other . is_mining . into () , } } } impl From < ffi :: EthGetBlockByHashInput > for super :: types :: EthGetBlockByHashInput { fn from (other : ffi :: EthGetBlockByHashInput) -> Self { super :: types :: EthGetBlockByHashInput { hash : other . hash . into () , full_transaction : other . full_transaction . into () , } } } impl From < super :: types :: EthGetBlockByHashInput > for ffi :: EthGetBlockByHashInput { fn from (other : super :: types :: EthGetBlockByHashInput) -> Self { ffi :: EthGetBlockByHashInput { hash : other . hash . into () , full_transaction : other . full_transaction . into () , } } } impl From < ffi :: EthCompileSerpentInput > for super :: types :: EthCompileSerpentInput { fn from (other : ffi :: EthCompileSerpentInput) -> Self { super :: types :: EthCompileSerpentInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileSerpentInput > for ffi :: EthCompileSerpentInput { fn from (other : super :: types :: EthCompileSerpentInput) -> Self { ffi :: EthCompileSerpentInput { code : other . code . into () , } } } impl From < ffi :: EthGetCompilersResult > for super :: types :: EthGetCompilersResult { fn from (other : ffi :: EthGetCompilersResult) -> Self { super :: types :: EthGetCompilersResult { compilers : other . compilers . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthGetCompilersResult > for ffi :: EthGetCompilersResult { fn from (other : super :: types :: EthGetCompilersResult) -> Self { ffi :: EthGetCompilersResult { compilers : other . compilers . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthSendRawTransactionInput > for super :: types :: EthSendRawTransactionInput { fn from (other : ffi :: EthSendRawTransactionInput) -> Self { super :: types :: EthSendRawTransactionInput { transaction : other . transaction . into () , } } } impl From < super :: types :: EthSendRawTransactionInput > for ffi :: EthSendRawTransactionInput { fn from (other : super :: types :: EthSendRawTransactionInput) -> Self { ffi :: EthSendRawTransactionInput { transaction : other . transaction . into () , } } } impl From < ffi :: EthGetTransactionByBlockHashAndIndexInput > for super :: types :: EthGetTransactionByBlockHashAndIndexInput { fn from (other : ffi :: EthGetTransactionByBlockHashAndIndexInput) -> Self { super :: types :: EthGetTransactionByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetTransactionByBlockHashAndIndexInput > for ffi :: EthGetTransactionByBlockHashAndIndexInput { fn from (other : super :: types :: EthGetTransactionByBlockHashAndIndexInput) -> Self { ffi :: EthGetTransactionByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < ffi :: EthGetUncleCountByBlockHashInput > for super :: types :: EthGetUncleCountByBlockHashInput { fn from (other : ffi :: EthGetUncleCountByBlockHashInput) -> Self { super :: types :: EthGetUncleCountByBlockHashInput { block_hash : other . block_hash . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockHashInput > for ffi :: EthGetUncleCountByBlockHashInput { fn from (other : super :: types :: EthGetUncleCountByBlockHashInput) -> Self { ffi :: EthGetUncleCountByBlockHashInput { block_hash : other . block_hash . into () , } } } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Accounts (client : & Box < Client >) -> Result < ffi :: EthAccountsResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthAccountsResult , _ > = c . request ("eth_accounts" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Call (client : & Box < Client > , eth_call_input : EthCallInput) -> Result < ffi :: EthCallResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_call_input = super :: types :: EthCallInput :: from (eth_call_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_call_input . transaction_info , & eth_call_input . block_number] ; let resp : Result < super :: types :: EthCallResult , _ > = c . request ("eth_call" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBalance (client : & Box < Client > , eth_get_balance_input : EthGetBalanceInput) -> Result < ffi :: EthGetBalanceResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_balance_input = super :: types :: EthGetBalanceInput :: from (eth_get_balance_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_balance_input . address , & eth_get_balance_input . block_number] ; let resp : Result < super :: types :: EthGetBalanceResult , _ > = c . request ("eth_getbalance" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByHash (client : & Box < Client > , eth_get_block_by_hash_input : EthGetBlockByHashInput) -> Result < ffi :: EthBlockInfo , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_block_by_hash_input = super :: types :: EthGetBlockByHashInput :: from (eth_get_block_by_hash_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_block_by_hash_input . hash , & eth_get_block_by_hash_input . full_transaction] ; let resp : Result < super :: types :: EthBlockInfo , _ > = c . request ("eth_getblockbyhash" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_ChainId (client : & Box < Client >) -> Result < ffi :: EthChainIdResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthChainIdResult , _ > = c . request ("eth_chainid" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallNet_Version (client : & Box < Client >) -> Result < ffi :: EthChainIdResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthChainIdResult , _ > = c . request ("net_version" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_BlockNumber (client : & Box < Client >) -> Result < ffi :: EthBlockNumberResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthBlockNumberResult , _ > = c . request ("eth_blocknumber" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByNumber (client : & Box < Client > , eth_get_block_by_number_input : EthGetBlockByNumberInput) -> Result < ffi :: EthBlockInfo , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_block_by_number_input = super :: types :: EthGetBlockByNumberInput :: from (eth_get_block_by_number_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_block_by_number_input . number , & eth_get_block_by_number_input . full_transaction] ; let resp : Result < super :: types :: EthBlockInfo , _ > = c . request ("eth_getblockbynumber" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Mining (client : & Box < Client >) -> Result < ffi :: EthMiningResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthMiningResult , _ > = c . request ("eth_mining" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) }# [derive (Clone)] pub struct EthService { adapter : Arc < Handlers > } impl EthService { # [inline] # [allow (dead_code)] pub fn new (adapter : Arc < Handlers >) -> EthService { EthService { adapter } } # [inline] # [allow (dead_code)] pub fn service (& self) -> eth_server :: EthServer < EthService > { eth_server :: EthServer :: new (self . clone ()) } # [inline] # [allow (unused_mut , dead_code)] pub fn module (& self) -> Result < jsonrpsee_http_server :: RpcModule < () > , jsonrpsee_core :: Error > { let mut module = jsonrpsee_http_server :: RpcModule :: new (()) ; let adapter = self . adapter . clone () ; module . register_method ("eth_accounts" , move | _params , _ | { Self :: Eth_Accounts (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_call" , move | _params , _ | { let mut eth_call_input = super :: types :: EthCallInput :: default () ; if _params . is_object () { eth_call_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_call_input . transaction_info = seq . next () . map_err (| _ | missing_param ("transaction_info")) ? ; eth_call_input . block_number = seq . next () . map_err (| _ | missing_param ("block_number")) ? ; } let mut input = eth_call_input . into () ; Self :: Eth_Call (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getbalance" , move | _params , _ | { let mut eth_get_balance_input = super :: types :: EthGetBalanceInput :: default () ; if _params . is_object () { eth_get_balance_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_balance_input . address = seq . next () . map_err (| _ | missing_param ("address")) ? ; eth_get_balance_input . block_number = seq . next () . map_err (| _ | missing_param ("block_number")) ? ; } let mut input = eth_get_balance_input . into () ; Self :: Eth_GetBalance (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getblockbyhash" , move | _params , _ | { let mut eth_get_block_by_hash_input = super :: types :: EthGetBlockByHashInput :: default () ; if _params . is_object () { eth_get_block_by_hash_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_block_by_hash_input . hash = seq . next () . map_err (| _ | missing_param ("hash")) ? ; eth_get_block_by_hash_input . full_transaction = seq . next () . map_err (| _ | missing_param ("full_transaction")) ? ; } let mut input = eth_get_block_by_hash_input . into () ; Self :: Eth_GetBlockByHash (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_chainid" , move | _params , _ | { Self :: Eth_ChainId (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("net_version" , move | _params , _ | { Self :: Net_Version (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_blocknumber" , move | _params , _ | { Self :: Eth_BlockNumber (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getblockbynumber" , move | _params , _ | { let mut eth_get_block_by_number_input = super :: types :: EthGetBlockByNumberInput :: default () ; if _params . is_object () { eth_get_block_by_number_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_block_by_number_input . number = seq . next () . map_err (| _ | missing_param ("number")) ? ; eth_get_block_by_number_input . full_transaction = seq . next () . map_err (| _ | missing_param ("full_transaction")) ? ; } let mut input = eth_get_block_by_number_input . into () ; Self :: Eth_GetBlockByNumber (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_mining" , move | _params , _ | { Self :: Eth_Mining (adapter . clone () ,) }) ? ; Ok (module) } } # [tonic :: async_trait] impl eth_server :: Eth for EthService { async fn eth_accounts (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthAccountsResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_Accounts (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_call (& self , request : tonic :: Request < super :: types :: EthCallInput >) -> Result < tonic :: Response < super :: types :: EthCallResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_Call (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_balance (& self , request : tonic :: Request < super :: types :: EthGetBalanceInput >) -> Result < tonic :: Response < super :: types :: EthGetBalanceResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBalance (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_block_by_hash (& self , request : tonic :: Request < super :: types :: EthGetBlockByHashInput >) -> Result < tonic :: Response < super :: types :: EthBlockInfo > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBlockByHash (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } # [allow (unused_variables)] async fn eth_send_transaction (& self , request : tonic :: Request < super :: types :: EthSendTransactionInput >) -> Result < tonic :: Response < super :: types :: EthSendTransactionResult > , tonic :: Status > { unimplemented ! () ; } async fn eth_chain_id (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthChainIdResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_ChainId (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn net_version (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthChainIdResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Net_Version (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_block_number (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthBlockNumberResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_BlockNumber (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_block_by_number (& self , request : tonic :: Request < super :: types :: EthGetBlockByNumberInput >) -> Result < tonic :: Response < super :: types :: EthBlockInfo > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBlockByNumber (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_mining (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthMiningResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_Mining (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } }# [derive (Clone)] pub struct BlockchainService { adapter : Arc < Handlers > } impl BlockchainService { # [inline] # [allow (dead_code)] pub fn new (adapter : Arc < Handlers >) -> BlockchainService { BlockchainService { adapter } } # [inline] # [allow (dead_code)] pub fn service (& self) -> blockchain_server :: BlockchainServer < BlockchainService > { blockchain_server :: BlockchainServer :: new (self . clone ()) } # [inline] # [allow (unused_mut , dead_code)] pub fn module (& self) -> Result < jsonrpsee_http_server :: RpcModule < () > , jsonrpsee_core :: Error > { let mut module = jsonrpsee_http_server :: RpcModule :: new (()) ; Ok (module) } } # [tonic :: async_trait] impl blockchain_server :: Blockchain for BlockchainService { # [allow (unused_variables)] async fn get_best_block_hash (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: BlockHashResult > , tonic :: Status > { unimplemented ! () ; } # [allow (unused_variables)] async fn get_block (& self , request : tonic :: Request < super :: types :: BlockInput >) -> Result < tonic :: Response < super :: types :: BlockResult > , tonic :: Status > { unimplemented ! () ; } } \ No newline at end of file diff --git a/src/rust/ain-grpc/src/gen/types.rs b/src/rust/ain-grpc/src/gen/types.rs new file mode 100644 index 0000000000..bd8227bae5 --- /dev/null +++ b/src/rust/ain-grpc/src/gen/types.rs @@ -0,0 +1 @@ +fn ignore_integer < T : num_traits :: PrimInt + num_traits :: Signed + num_traits :: NumCast > (i : & T) -> bool { T :: from (- 1) . unwrap () == * i } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Transaction { # [doc = " Transaction hash"] # [prost (string , tag = "1")] pub hash : :: prost :: alloc :: string :: String , # [doc = " Raw transaction data"] # [prost (message , optional , tag = "2")] pub raw : :: core :: option :: Option < RawTransaction > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct RawTransaction { # [doc = " Whether specified block is in the active chain or not (only present with explicit \"blockhash\" argument)"] # [prost (bool , tag = "1")] pub in_active_chain : bool , # [doc = " The serialized, hex-encoded data for 'txid'"] # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub hex : :: prost :: alloc :: string :: String , # [doc = " The transaction id (same as provided)"] # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub txid : :: prost :: alloc :: string :: String , # [doc = " The transaction hash (differs from txid for witness transactions)"] # [prost (string , tag = "4")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , # [doc = " The serialized transaction size"] # [prost (uint32 , tag = "5")] pub size : u32 , # [doc = " The virtual transaction size (differs from size for witness transactions)"] # [prost (uint32 , tag = "6")] pub vsize : u32 , # [doc = " The transaction's weight (between vsize*4-3 and vsize*4)"] # [prost (uint32 , tag = "7")] pub weight : u32 , # [doc = " The transaction version"] # [prost (uint32 , tag = "8")] pub version : u32 , # [doc = " The lock time"] # [prost (uint64 , tag = "9")] pub locktime : u64 , # [doc = " List of inputs"] # [prost (message , repeated , tag = "10")] # [serde (skip_serializing_if = "Vec::is_empty")] pub vin : :: prost :: alloc :: vec :: Vec < Vin > , # [doc = " List of outputs"] # [prost (message , repeated , tag = "11")] # [serde (skip_serializing_if = "Vec::is_empty")] pub vout : :: prost :: alloc :: vec :: Vec < Vout > , # [doc = " The block hash"] # [prost (string , tag = "12")] # [serde (skip_serializing_if = "String::is_empty")] pub blockhash : :: prost :: alloc :: string :: String , # [doc = " The confirmations"] # [prost (string , tag = "13")] # [serde (skip_serializing_if = "String::is_empty")] pub confirmations : :: prost :: alloc :: string :: String , # [doc = " The block time in seconds since UNIX epoch"] # [prost (uint64 , tag = "14")] pub blocktime : u64 , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Vin { # [doc = " The transaction id"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub txid : :: prost :: alloc :: string :: String , # [doc = " The output index"] # [prost (uint32 , tag = "2")] pub vout : u32 , # [doc = " The script signature"] # [prost (message , optional , tag = "3")] pub script_sig : :: core :: option :: Option < ScriptSig > , # [doc = " The script sequence number"] # [prost (uint64 , tag = "4")] pub sequence : u64 , # [doc = " Hex-encoded witness data"] # [prost (string , repeated , tag = "5")] # [serde (skip_serializing_if = "Vec::is_empty")] pub txinwitness : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , # [doc = " DeFiChain fields"] # [prost (string , tag = "51")] # [serde (skip_serializing_if = "String::is_empty")] pub coinbase : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct ScriptSig { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] # [serde (rename = "asm")] pub field_asm : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub hex : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Vout { # [prost (double , tag = "1")] pub value : f64 , # [prost (uint64 , tag = "2")] pub n : u64 , # [prost (message , optional , tag = "3")] pub script_pub_key : :: core :: option :: Option < PubKey > , # [prost (uint64 , tag = "4")] pub token_id : u64 , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct PubKey { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] # [serde (rename = "asm")] pub field_asm : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub hex : :: prost :: alloc :: string :: String , # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] # [serde (rename = "type")] pub field_type : :: prost :: alloc :: string :: String , # [prost (int32 , tag = "4")] # [serde (skip_serializing_if = "ignore_integer")] pub req_sigs : i32 , # [prost (string , repeated , tag = "5")] # [serde (skip_serializing_if = "Vec::is_empty")] pub addresses : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Block { # [doc = " Block hash (same as input, if any)"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , # [doc = " The number of confirmations, or -1 if the block is not on the main chain"] # [prost (int64 , tag = "2")] pub confirmations : i64 , # [doc = " Block size"] # [prost (uint64 , tag = "3")] pub size : u64 , # [doc = " Block size without witness data"] # [prost (uint64 , tag = "4")] pub strippedsize : u64 , # [doc = " The block weight as defined in BIP 141"] # [prost (uint64 , tag = "5")] pub weight : u64 , # [doc = " The block height or index"] # [prost (uint64 , tag = "6")] pub height : u64 , # [doc = " The block version"] # [prost (uint64 , tag = "7")] pub version : u64 , # [doc = " The block version in hex"] # [prost (string , tag = "8")] # [serde (skip_serializing_if = "String::is_empty")] pub version_hex : :: prost :: alloc :: string :: String , # [doc = " The merkle root"] # [prost (string , tag = "9")] # [serde (skip_serializing_if = "String::is_empty")] pub merkleroot : :: prost :: alloc :: string :: String , # [doc = " List of transaction IDs"] # [prost (message , repeated , tag = "10")] # [serde (skip_serializing_if = "Vec::is_empty")] pub tx : :: prost :: alloc :: vec :: Vec < Transaction > , # [doc = " The block time in seconds since UNIX epoch"] # [prost (uint64 , tag = "11")] pub time : u64 , # [doc = " The median block time in seconds since UNIX epoch"] # [prost (uint64 , tag = "12")] pub mediantime : u64 , # [doc = " The nonce used to generate the block (property exists only when PoW is used)"] # [prost (uint64 , tag = "13")] pub nonce : u64 , # [doc = " The bits which represent the target difficulty"] # [prost (string , tag = "14")] # [serde (skip_serializing_if = "String::is_empty")] pub bits : :: prost :: alloc :: string :: String , # [doc = " The difficulty of the block"] # [prost (double , tag = "15")] pub difficulty : f64 , # [doc = " Expected number of hashes required to produce the chain up to this block (in hex)"] # [prost (string , tag = "16")] # [serde (skip_serializing_if = "String::is_empty")] pub chainwork : :: prost :: alloc :: string :: String , # [doc = " Number of transactions in the block"] # [prost (uint32 , tag = "17")] pub n_tx : u32 , # [doc = " The hash of the previous block"] # [prost (string , tag = "18")] # [serde (skip_serializing_if = "String::is_empty")] # [serde (rename = "previousblockhash")] pub previous_block_hash : :: prost :: alloc :: string :: String , # [doc = " The hash of the next block"] # [prost (string , tag = "19")] # [serde (skip_serializing_if = "String::is_empty")] # [serde (rename = "nextblockhash")] pub next_block_hash : :: prost :: alloc :: string :: String , # [doc = " DeFiChain fields"] # [prost (string , tag = "101")] # [serde (skip_serializing_if = "String::is_empty")] pub masternode : :: prost :: alloc :: string :: String , # [prost (string , tag = "102")] # [serde (skip_serializing_if = "String::is_empty")] pub minter : :: prost :: alloc :: string :: String , # [prost (uint64 , tag = "103")] pub minted_blocks : u64 , # [prost (string , tag = "104")] # [serde (skip_serializing_if = "String::is_empty")] pub stake_modifier : :: prost :: alloc :: string :: String , # [prost (message , repeated , tag = "105")] # [serde (skip_serializing_if = "Vec::is_empty")] pub nonutxo : :: prost :: alloc :: vec :: Vec < NonUtxo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "PascalCase")] pub struct NonUtxo { # [prost (double , tag = "1")] pub anchor_reward : f64 , # [prost (double , tag = "2")] pub burnt : f64 , # [prost (double , tag = "3")] pub incentive_funding : f64 , # [prost (double , tag = "4")] pub loan : f64 , # [prost (double , tag = "5")] pub options : f64 , # [prost (double , tag = "6")] pub unknown : f64 , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct BlockInput { # [doc = " Block hash"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub blockhash : :: prost :: alloc :: string :: String , # [doc = " 0 for hex-encoded data, 1 for a json object, and 2 for json object with transaction data [default: 1]"] # [prost (uint32 , tag = "2")] pub verbosity : u32 , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct BlockResult { # [doc = " Hex-encoded data for block hash (for verbosity 0)"] # [prost (string , tag = "1")] pub hash : :: prost :: alloc :: string :: String , # [doc = " Block data (for verbosity 1 and 2)"] # [prost (message , optional , tag = "2")] pub block : :: core :: option :: Option < Block > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct BlockHashResult { # [doc = " Hex-encoded data for block hash"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthAccountsResult { # [doc = " Accounts"] # [prost (string , repeated , tag = "1")] # [serde (skip_serializing_if = "Vec::is_empty")] pub accounts : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthTransactionInfo { # [doc = " The address from which the transaction is sent"] # [prost (string , optional , tag = "1")] pub from : :: core :: option :: Option < :: prost :: alloc :: string :: String > , # [doc = " The address to which the transaction is addressed"] # [prost (string , optional , tag = "2")] pub to : :: core :: option :: Option < :: prost :: alloc :: string :: String > , # [doc = " The integer of gas provided for the transaction execution"] # [prost (uint64 , optional , tag = "3")] pub gas : :: core :: option :: Option < u64 > , # [doc = " The integer of gas price used for each paid gas encoded as hexadecimal"] # [prost (uint64 , optional , tag = "4")] pub price : :: core :: option :: Option < u64 > , # [doc = " The integer of value sent with this transaction encoded as hexadecimal"] # [prost (uint64 , optional , tag = "5")] pub value : :: core :: option :: Option < u64 > , # [doc = " The hash of the method signature and encoded parameters."] # [prost (string , optional , tag = "6")] pub data : :: core :: option :: Option < :: prost :: alloc :: string :: String > , # [doc = " The integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce."] # [prost (uint64 , optional , tag = "7")] pub nonce : :: core :: option :: Option < u64 > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthChainIdResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub id : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthBlockInfo { # [doc = " The block number. null when its pending block."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , # [doc = " Hash of the block. null when its pending block."] # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , # [doc = " Hash of the parent block."] # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub parent_hash : :: prost :: alloc :: string :: String , # [doc = " Hash of the generated proof-of-work. null when its pending block."] # [prost (string , tag = "4")] # [serde (skip_serializing_if = "String::is_empty")] pub nonce : :: prost :: alloc :: string :: String , # [doc = " SHA3 of the uncles data in the block."] # [prost (string , tag = "5")] # [serde (skip_serializing_if = "String::is_empty")] pub sha3_uncles : :: prost :: alloc :: string :: String , # [doc = " The bloom filter for the logs of the block. null when its pending block."] # [prost (string , tag = "6")] # [serde (skip_serializing_if = "String::is_empty")] pub logs_bloom : :: prost :: alloc :: string :: String , # [doc = " The root of the transaction trie of the block."] # [prost (string , tag = "7")] # [serde (skip_serializing_if = "String::is_empty")] pub transactions_root : :: prost :: alloc :: string :: String , # [doc = " The root of the final state trie of the block."] # [prost (string , tag = "8")] # [serde (skip_serializing_if = "String::is_empty")] pub state_root : :: prost :: alloc :: string :: String , # [doc = " The root of the receipts trie of the block."] # [prost (string , tag = "9")] # [serde (skip_serializing_if = "String::is_empty")] pub receipt_root : :: prost :: alloc :: string :: String , # [doc = " The address of the beneficiary to whom the mining rewards were given."] # [prost (string , tag = "10")] # [serde (skip_serializing_if = "String::is_empty")] pub miner : :: prost :: alloc :: string :: String , # [doc = " Integer of the difficulty for this block."] # [prost (string , tag = "11")] # [serde (skip_serializing_if = "String::is_empty")] pub difficulty : :: prost :: alloc :: string :: String , # [doc = " Integer of the total difficulty of the chain until this block."] # [prost (string , tag = "12")] # [serde (skip_serializing_if = "String::is_empty")] pub total_difficulty : :: prost :: alloc :: string :: String , # [doc = " The \"extra data\" field of this block."] # [prost (string , tag = "13")] # [serde (skip_serializing_if = "String::is_empty")] pub extra_data : :: prost :: alloc :: string :: String , # [doc = " Integer the size of this block in bytes."] # [prost (string , tag = "14")] # [serde (skip_serializing_if = "String::is_empty")] pub size : :: prost :: alloc :: string :: String , # [doc = " The maximum gas allowed in this block."] # [prost (string , tag = "15")] # [serde (skip_serializing_if = "String::is_empty")] pub gas_limit : :: prost :: alloc :: string :: String , # [doc = " The total used gas by all transactions in this block."] # [prost (string , tag = "16")] # [serde (skip_serializing_if = "String::is_empty")] pub gas_used : :: prost :: alloc :: string :: String , # [doc = " The unix timestamp for when the block was collated."] # [prost (string , tag = "17")] # [serde (skip_serializing_if = "String::is_empty")] pub timestamps : :: prost :: alloc :: string :: String , # [doc = " Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter."] # [prost (string , repeated , tag = "18")] # [serde (skip_serializing_if = "Vec::is_empty")] pub transactions : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , # [doc = " Array of uncle hashes."] # [prost (string , repeated , tag = "19")] # [serde (skip_serializing_if = "Vec::is_empty")] pub uncles : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthTransactionReceipt { # [doc = " Hash of the transaction."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub transaction_hash : :: prost :: alloc :: string :: String , # [doc = " Integer of the transactions index position in the block."] # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub transaction_index : :: prost :: alloc :: string :: String , # [doc = " Hash of the block where this transaction was in."] # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub block_hash : :: prost :: alloc :: string :: String , # [doc = " Block number where this transaction was in."] # [prost (string , tag = "4")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , # [doc = " Address of the sender."] # [prost (string , tag = "5")] # [serde (skip_serializing_if = "String::is_empty")] pub from : :: prost :: alloc :: string :: String , # [doc = " Address of the receiver. null when its a contract creation transaction."] # [prost (string , tag = "6")] # [serde (skip_serializing_if = "String::is_empty")] pub to : :: prost :: alloc :: string :: String , # [doc = " The total amount of gas used when this transaction was executed in the block."] # [prost (string , tag = "7")] # [serde (skip_serializing_if = "String::is_empty")] pub cumulative_gas_used : :: prost :: alloc :: string :: String , # [doc = " The sum of the base fee and tip paid per unit of gas."] # [prost (string , tag = "8")] # [serde (skip_serializing_if = "String::is_empty")] pub effective_gas_price : :: prost :: alloc :: string :: String , # [doc = " The amount of gas used by this specific transaction alone."] # [prost (string , tag = "9")] # [serde (skip_serializing_if = "String::is_empty")] pub gas_used : :: prost :: alloc :: string :: String , # [doc = " The contract address created, if the transaction was a contract creation, otherwise null."] # [prost (string , tag = "10")] # [serde (skip_serializing_if = "String::is_empty")] pub contract_address : :: prost :: alloc :: string :: String , # [doc = " Array of log objects, which this transaction generated."] # [prost (string , repeated , tag = "11")] # [serde (skip_serializing_if = "Vec::is_empty")] pub logs : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , # [doc = " Bloom filter for light clients to quickly retrieve related logs."] # [prost (string , tag = "12")] # [serde (skip_serializing_if = "String::is_empty")] pub logs_bloom : :: prost :: alloc :: string :: String , # [doc = " Integer of the transaction type, 0x00 for legacy transactions, 0x01 for access list types, 0x02 for dynamic fees. It also returns either :"] # [prost (string , tag = "13")] # [serde (skip_serializing_if = "String::is_empty")] # [serde (rename = "type")] pub field_type : :: prost :: alloc :: string :: String , # [doc = " 32 bytes of post-transaction stateroot (pre Byzantium)"] # [prost (string , optional , tag = "14")] pub root : :: core :: option :: Option < :: prost :: alloc :: string :: String > , # [doc = " Either 1 (success) or 0 (failure)"] # [prost (string , optional , tag = "15")] pub status : :: core :: option :: Option < :: prost :: alloc :: string :: String > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCallInput { # [doc = " Transaction info"] # [prost (message , optional , tag = "1")] pub transaction_info : :: core :: option :: Option < EthTransactionInfo > , # [doc = " Block number in hexadecimal format or the string latest, earliest, pending, safe or finalized"] # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCallResult { # [doc = " The return value of the executed contract method"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub data : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSignInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub address : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub message : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSignResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub signature : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBalanceInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub address : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBalanceResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub balance : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSendTransactionInput { # [prost (message , optional , tag = "1")] pub transaction_info : :: core :: option :: Option < EthTransactionInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSendTransactionResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCoinBaseResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub address : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthMiningResult { # [prost (bool , tag = "1")] pub is_mining : bool , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthHashRateResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash_rate : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGasPriceResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub gas_price : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthBlockNumberResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionCountInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub address : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionCountResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number_transaction : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockTransactionCountByHashInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockTransactionCountByHashResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number_transaction : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockTransactionCountByNumberInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockTransactionCountByNumberResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number_transaction : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleCountByBlockHashInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleCountByBlockHashResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number_uncles : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleCountByBlockNumberInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleCountByBlockNumberResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number_uncles : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetCodeInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub address : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetCodeResult { # [doc = " The code from the given address."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSignTransactionInput { # [prost (message , optional , tag = "1")] pub transaction_info : :: core :: option :: Option < EthTransactionInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSignTransactionResult { # [doc = " The signed transaction object."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub transaction : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSendRawTransactionInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub transaction : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSendRawTransactionResult { # [doc = " The transaction hash, or the zero hash if the transaction is not yet available."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthEstimateGasInput { # [doc = " Transaction info"] # [prost (message , optional , tag = "1")] pub transaction_info : :: core :: option :: Option < EthTransactionInfo > , # [doc = " Block number in hexadecimal format or the string latest, earliest, pending, safe or finalized"] # [prost (string , optional , tag = "2")] pub block_number : :: core :: option :: Option < :: prost :: alloc :: string :: String > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthEstimateGasResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub gas_used : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockByHashInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , # [prost (bool , tag = "2")] pub full_transaction : bool , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockByHashResult { # [prost (message , optional , tag = "1")] pub block_info : :: core :: option :: Option < EthBlockInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockByNumberInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number : :: prost :: alloc :: string :: String , # [prost (bool , tag = "2")] pub full_transaction : bool , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockByNumberResult { # [prost (message , optional , tag = "1")] pub block_info : :: core :: option :: Option < EthBlockInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionByHashInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionByHashResult { # [prost (message , optional , tag = "1")] pub transaction : :: core :: option :: Option < EthTransactionInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionByBlockHashAndIndexInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_hash : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub index : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionByBlockHashAndIndexResult { # [prost (message , optional , tag = "1")] pub transaction : :: core :: option :: Option < EthTransactionInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionByBlockNumberAndIndexInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub index : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionByBlockNumberAndIndexResult { # [prost (message , optional , tag = "1")] pub transaction : :: core :: option :: Option < EthTransactionInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleByBlockHashAndIndexInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_hash : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub index : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleByBlockHashAndIndexResult { # [prost (message , optional , tag = "1")] pub block_info : :: core :: option :: Option < EthBlockInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleByBlockNumberAndIndexInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub index : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleByBlockNumberAndIndexResult { # [prost (message , optional , tag = "1")] pub block_info : :: core :: option :: Option < EthBlockInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetCompilersResult { # [prost (string , repeated , tag = "1")] # [serde (skip_serializing_if = "Vec::is_empty")] pub compilers : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCompileSolidityInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCompileSolidityResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub compiled_code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCompileLllInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCompileLllResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub compiled_code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCompileSerpentInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCompileSerpentResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub compiled_code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthProtocolVersionResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub protocol_version : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Web3Sha3Input { # [doc = " The data to convert into a SHA3 hash"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub data : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Web3Sha3Result { # [doc = " The SHA3 result of the given string."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub data : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct NetPeerCountResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number_peer : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct NetVersionResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub network_version : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Web3ClientVersionResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub client_version : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetWorkResult { # [doc = " Current block header pow-hash"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub currentblock : :: prost :: alloc :: string :: String , # [doc = " The seed hash used for the DAG."] # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub seed_hash : :: prost :: alloc :: string :: String , # [doc = " The boundary condition (\"target\"), 2^256 / difficulty."] # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub target : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSubmitWorkInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub nounce : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub pow_hash : :: prost :: alloc :: string :: String , # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub mix_digest : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSubmitWorkResult { # [prost (bool , tag = "1")] pub is_valid : bool , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSubmitHashrateInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash_rate : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub id : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSubmitHashrateResult { # [prost (bool , tag = "1")] pub is_valid : bool , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetStorageAtInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub address : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub position : :: prost :: alloc :: string :: String , # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetStorageAtResult { # [doc = " The value at this storage position."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub value : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionReceiptInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub transaction_hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionReceiptResult { # [prost (message , optional , tag = "1")] pub transaction_receipt : :: core :: option :: Option < EthTransactionReceipt > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSyncingInfo { # [doc = " The block at which the import started (will only be reset, after the sync reached his head)"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub starting_block : :: prost :: alloc :: string :: String , # [doc = " The current block, same as eth_blockNumber"] # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub current_block : :: prost :: alloc :: string :: String , # [doc = " The estimated highest block"] # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub highest_block : :: prost :: alloc :: string :: String , } # [doc = " TODO make it oneof"] # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSyncingResult { # [prost (bool , optional , tag = "1")] pub status : :: core :: option :: Option < bool > , # [prost (message , optional , tag = "2")] pub sync_info : :: core :: option :: Option < EthSyncingInfo > , } \ No newline at end of file diff --git a/src/rust/crates/ain-grpc/src/lib.rs b/src/rust/ain-grpc/src/lib.rs similarity index 100% rename from src/rust/crates/ain-grpc/src/lib.rs rename to src/rust/ain-grpc/src/lib.rs diff --git a/src/rust/crates/ain-grpc/src/rpc.rs b/src/rust/ain-grpc/src/rpc.rs similarity index 97% rename from src/rust/crates/ain-grpc/src/rpc.rs rename to src/rust/ain-grpc/src/rpc.rs index a4b5f3921c..751378f35b 100644 --- a/src/rust/crates/ain-grpc/src/rpc.rs +++ b/src/rust/ain-grpc/src/rpc.rs @@ -7,7 +7,6 @@ use crate::codegen::rpc::{ EthService, }; use ain_evm::handler::Handlers; -use ain_evm_cpp_ffi::get_chain_id; use primitive_types::{H256, U256}; use std::mem::size_of_val; use std::sync::Arc; @@ -141,7 +140,7 @@ impl EthServiceApi for EthService { } fn Eth_ChainId(_handler: Arc) -> Result { - let chain_id = get_chain_id().unwrap(); + let chain_id = ain_cpp_exports::get_chain_id().unwrap(); Ok(EthChainIdResult { id: format!("{:#x}", chain_id), @@ -149,7 +148,7 @@ impl EthServiceApi for EthService { } fn Net_Version(_handler: Arc) -> Result { - let chain_id = get_chain_id().unwrap(); + let chain_id = ain_cpp_exports::get_chain_id().unwrap(); Ok(EthChainIdResult { id: format!("{}", chain_id), @@ -207,7 +206,7 @@ impl EthServiceApi for EthService { } fn Eth_Mining(handler: Arc) -> Result { - let mining = ain_evm_cpp_ffi::is_mining().unwrap(); + let mining = ain_cpp_exports::is_mining().unwrap(); Ok(EthMiningResult { is_mining: mining }) } diff --git a/src/rust/crates/ain-grpc/src/tests.rs b/src/rust/ain-grpc/src/tests.rs similarity index 100% rename from src/rust/crates/ain-grpc/src/tests.rs rename to src/rust/ain-grpc/src/tests.rs diff --git a/src/rust/crates/ain-evm-ffi/Cargo.toml b/src/rust/ain-rs-exports/Cargo.toml similarity index 94% rename from src/rust/crates/ain-evm-ffi/Cargo.toml rename to src/rust/ain-rs-exports/Cargo.toml index b42a60e5b9..bde9ea1c13 100644 --- a/src/rust/crates/ain-evm-ffi/Cargo.toml +++ b/src/rust/ain-rs-exports/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "ain-evm-ffi" +name = "ain-rs-exports" version = "0.1.0" edition = "2021" build = "build.rs" diff --git a/src/rust/crates/ain-evm-ffi/build.rs b/src/rust/ain-rs-exports/build.rs similarity index 100% rename from src/rust/crates/ain-evm-ffi/build.rs rename to src/rust/ain-rs-exports/build.rs diff --git a/src/rust/crates/ain-evm-ffi/src/lib.rs b/src/rust/ain-rs-exports/src/lib.rs similarity index 100% rename from src/rust/crates/ain-evm-ffi/src/lib.rs rename to src/rust/ain-rs-exports/src/lib.rs diff --git a/src/rust/crates/ain-grpc/src/gen/.gitkeep b/src/rust/crates/ain-grpc/src/gen/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/rust/crates/ain-grpc/src/gen/rpc.rs b/src/rust/crates/ain-grpc/src/gen/rpc.rs deleted file mode 100644 index 3f944d50b5..0000000000 --- a/src/rust/crates/ain-grpc/src/gen/rpc.rs +++ /dev/null @@ -1,748 +0,0 @@ -/// Generated server implementations. -pub mod blockchain_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with BlockchainServer. - #[async_trait] - pub trait Blockchain: Send + Sync + 'static { - /// [ignore] - /// Returns the hash of the best (tip) block in the most-work fully-validated chain. - async fn get_best_block_hash( - &self, - request: tonic::Request<()>, - ) -> Result< - tonic::Response, - tonic::Status, - >; - /// [ignore] - async fn get_block( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - } - #[derive(Debug)] - pub struct BlockchainServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - } - struct _Inner(Arc); - impl BlockchainServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - } - impl tonic::codegen::Service> for BlockchainServer - where - T: Blockchain, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/rpc.Blockchain/GetBestBlockHash" => { - #[allow(non_camel_case_types)] - struct GetBestBlockHashSvc(pub Arc); - impl tonic::server::UnaryService<()> - for GetBestBlockHashSvc { - type Response = super::super::types::BlockHashResult; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call(&mut self, request: tonic::Request<()>) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { - (*inner).get_best_block_hash(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetBestBlockHashSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/rpc.Blockchain/GetBlock" => { - #[allow(non_camel_case_types)] - struct GetBlockSvc(pub Arc); - impl< - T: Blockchain, - > tonic::server::UnaryService - for GetBlockSvc { - type Response = super::super::types::BlockResult; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).get_block(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetBlockSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for BlockchainServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(self.0.clone()) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for BlockchainServer { - const NAME: &'static str = "rpc.Blockchain"; - } -} -/// Generated server implementations. -pub mod eth_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with EthServer. - #[async_trait] - pub trait Eth: Send + Sync + 'static { - /// / Returns eth_accounts list. - async fn eth_accounts( - &self, - request: tonic::Request<()>, - ) -> Result< - tonic::Response, - tonic::Status, - >; - /// / Call contract, returning the output data. Does not create a transaction. - async fn eth_call( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// / Returns the balance for the given address. - async fn eth_get_balance( - &self, - request: tonic::Request, - ) -> Result< - tonic::Response, - tonic::Status, - >; - async fn eth_get_block_by_hash( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// / [ignore] - /// / Returns the balance for the given address. - async fn eth_send_transaction( - &self, - request: tonic::Request, - ) -> Result< - tonic::Response, - tonic::Status, - >; - async fn eth_chain_id( - &self, - request: tonic::Request<()>, - ) -> Result< - tonic::Response, - tonic::Status, - >; - async fn net_version( - &self, - request: tonic::Request<()>, - ) -> Result< - tonic::Response, - tonic::Status, - >; - async fn eth_block_number( - &self, - request: tonic::Request<()>, - ) -> Result< - tonic::Response, - tonic::Status, - >; - async fn eth_get_block_by_number( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - async fn eth_mining( - &self, - request: tonic::Request<()>, - ) -> Result< - tonic::Response, - tonic::Status, - >; - } - #[derive(Debug)] - pub struct EthServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - } - struct _Inner(Arc); - impl EthServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - } - impl tonic::codegen::Service> for EthServer - where - T: Eth, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/rpc.eth/Eth_Accounts" => { - #[allow(non_camel_case_types)] - struct Eth_AccountsSvc(pub Arc); - impl tonic::server::UnaryService<()> for Eth_AccountsSvc { - type Response = super::super::types::EthAccountsResult; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call(&mut self, request: tonic::Request<()>) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { - (*inner).eth_accounts(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = Eth_AccountsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/rpc.eth/Eth_Call" => { - #[allow(non_camel_case_types)] - struct Eth_CallSvc(pub Arc); - impl< - T: Eth, - > tonic::server::UnaryService - for Eth_CallSvc { - type Response = super::super::types::EthCallResult; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).eth_call(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = Eth_CallSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/rpc.eth/Eth_GetBalance" => { - #[allow(non_camel_case_types)] - struct Eth_GetBalanceSvc(pub Arc); - impl< - T: Eth, - > tonic::server::UnaryService< - super::super::types::EthGetBalanceInput, - > for Eth_GetBalanceSvc { - type Response = super::super::types::EthGetBalanceResult; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::super::types::EthGetBalanceInput, - >, - ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { - (*inner).eth_get_balance(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = Eth_GetBalanceSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/rpc.eth/Eth_GetBlockByHash" => { - #[allow(non_camel_case_types)] - struct Eth_GetBlockByHashSvc(pub Arc); - impl< - T: Eth, - > tonic::server::UnaryService< - super::super::types::EthGetBlockByHashInput, - > for Eth_GetBlockByHashSvc { - type Response = super::super::types::EthBlockInfo; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::super::types::EthGetBlockByHashInput, - >, - ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { - (*inner).eth_get_block_by_hash(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = Eth_GetBlockByHashSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/rpc.eth/Eth_SendTransaction" => { - #[allow(non_camel_case_types)] - struct Eth_SendTransactionSvc(pub Arc); - impl< - T: Eth, - > tonic::server::UnaryService< - super::super::types::EthSendTransactionInput, - > for Eth_SendTransactionSvc { - type Response = super::super::types::EthSendTransactionResult; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::super::types::EthSendTransactionInput, - >, - ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { - (*inner).eth_send_transaction(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = Eth_SendTransactionSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/rpc.eth/Eth_ChainId" => { - #[allow(non_camel_case_types)] - struct Eth_ChainIdSvc(pub Arc); - impl tonic::server::UnaryService<()> for Eth_ChainIdSvc { - type Response = super::super::types::EthChainIdResult; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call(&mut self, request: tonic::Request<()>) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { - (*inner).eth_chain_id(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = Eth_ChainIdSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/rpc.eth/Net_Version" => { - #[allow(non_camel_case_types)] - struct Net_VersionSvc(pub Arc); - impl tonic::server::UnaryService<()> for Net_VersionSvc { - type Response = super::super::types::EthChainIdResult; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call(&mut self, request: tonic::Request<()>) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).net_version(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = Net_VersionSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/rpc.eth/Eth_BlockNumber" => { - #[allow(non_camel_case_types)] - struct Eth_BlockNumberSvc(pub Arc); - impl tonic::server::UnaryService<()> - for Eth_BlockNumberSvc { - type Response = super::super::types::EthBlockNumberResult; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call(&mut self, request: tonic::Request<()>) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { - (*inner).eth_block_number(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = Eth_BlockNumberSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/rpc.eth/Eth_GetBlockByNumber" => { - #[allow(non_camel_case_types)] - struct Eth_GetBlockByNumberSvc(pub Arc); - impl< - T: Eth, - > tonic::server::UnaryService< - super::super::types::EthGetBlockByNumberInput, - > for Eth_GetBlockByNumberSvc { - type Response = super::super::types::EthBlockInfo; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::super::types::EthGetBlockByNumberInput, - >, - ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { - (*inner).eth_get_block_by_number(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = Eth_GetBlockByNumberSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/rpc.eth/Eth_Mining" => { - #[allow(non_camel_case_types)] - struct Eth_MiningSvc(pub Arc); - impl tonic::server::UnaryService<()> for Eth_MiningSvc { - type Response = super::super::types::EthMiningResult; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call(&mut self, request: tonic::Request<()>) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).eth_mining(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = Eth_MiningSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for EthServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(self.0.clone()) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for EthServer { - const NAME: &'static str = "rpc.eth"; - } -} - -#[cxx::bridge] -pub mod ffi { -# [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Transaction { pub hash : String , pub raw : RawTransaction , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct RawTransaction { pub in_active_chain : bool , pub hex : String , pub txid : String , pub hash : String , pub size : u32 , pub vsize : u32 , pub weight : u32 , pub version : u32 , pub locktime : u64 , pub vin : Vec < Vin > , pub vout : Vec < Vout > , pub blockhash : String , pub confirmations : String , pub blocktime : u64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Vin { pub txid : String , pub vout : u32 , pub script_sig : ScriptSig , pub sequence : u64 , pub txinwitness : Vec < String > , pub coinbase : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct ScriptSig { pub field_asm : String , pub hex : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Vout { pub value : f64 , pub n : u64 , pub script_pub_key : PubKey , pub token_id : u64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct PubKey { pub field_asm : String , pub hex : String , pub field_type : String , pub req_sigs : i32 , pub addresses : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Block { pub hash : String , pub confirmations : i64 , pub size : u64 , pub strippedsize : u64 , pub weight : u64 , pub height : u64 , pub version : u64 , pub version_hex : String , pub merkleroot : String , pub tx : Vec < Transaction > , pub time : u64 , pub mediantime : u64 , pub nonce : u64 , pub bits : String , pub difficulty : f64 , pub chainwork : String , pub n_tx : u32 , pub previous_block_hash : String , pub next_block_hash : String , pub masternode : String , pub minter : String , pub minted_blocks : u64 , pub stake_modifier : String , pub nonutxo : Vec < NonUtxo > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct NonUtxo { pub anchor_reward : f64 , pub burnt : f64 , pub incentive_funding : f64 , pub loan : f64 , pub options : f64 , pub unknown : f64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct BlockInput { pub blockhash : String , pub verbosity : u32 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct BlockResult { pub hash : String , pub block : Block , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct BlockHashResult { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthAccountsResult { pub accounts : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthTransactionInfo { pub from : String , pub to : String , pub gas : u64 , pub price : u64 , pub value : u64 , pub data : String , pub nonce : u64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthChainIdResult { pub id : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthBlockInfo { pub block_number : String , pub hash : String , pub parent_hash : String , pub nonce : String , pub sha3_uncles : String , pub logs_bloom : String , pub transactions_root : String , pub state_root : String , pub receipt_root : String , pub miner : String , pub difficulty : String , pub total_difficulty : String , pub extra_data : String , pub size : String , pub gas_limit : String , pub gas_used : String , pub timestamps : String , pub transactions : Vec < String > , pub uncles : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthTransactionReceipt { pub transaction_hash : String , pub transaction_index : String , pub block_hash : String , pub block_number : String , pub from : String , pub to : String , pub cumulative_gas_used : String , pub effective_gas_price : String , pub gas_used : String , pub contract_address : String , pub logs : Vec < String > , pub logs_bloom : String , pub field_type : String , pub root : String , pub status : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCallInput { pub transaction_info : EthTransactionInfo , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCallResult { pub data : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignInput { pub address : String , pub message : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignResult { pub signature : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBalanceInput { pub address : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBalanceResult { pub balance : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendTransactionInput { pub transaction_info : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendTransactionResult { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCoinBaseResult { pub address : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthMiningResult { pub is_mining : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthHashRateResult { pub hash_rate : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGasPriceResult { pub gas_price : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthBlockNumberResult { pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionCountInput { pub address : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionCountResult { pub number_transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByHashInput { pub block_hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByHashResult { pub number_transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByNumberInput { pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByNumberResult { pub number_transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockHashInput { pub block_hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockHashResult { pub number_uncles : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockNumberInput { pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockNumberResult { pub number_uncles : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetCodeInput { pub address : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetCodeResult { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignTransactionInput { pub transaction_info : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignTransactionResult { pub transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendRawTransactionInput { pub transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendRawTransactionResult { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthEstimateGasInput { pub transaction_info : EthTransactionInfo , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthEstimateGasResult { pub gas_used : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByHashInput { pub hash : String , pub full_transaction : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByHashResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByNumberInput { pub number : String , pub full_transaction : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByNumberResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByHashInput { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByHashResult { pub transaction : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockHashAndIndexInput { pub block_hash : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockHashAndIndexResult { pub transaction : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockNumberAndIndexInput { pub block_number : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockNumberAndIndexResult { pub transaction : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockHashAndIndexInput { pub block_hash : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockHashAndIndexResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockNumberAndIndexInput { pub block_number : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockNumberAndIndexResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetCompilersResult { pub compilers : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSolidityInput { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSolidityResult { pub compiled_code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileLllInput { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileLllResult { pub compiled_code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSerpentInput { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSerpentResult { pub compiled_code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthProtocolVersionResult { pub protocol_version : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Web3Sha3Input { pub data : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Web3Sha3Result { pub data : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct NetPeerCountResult { pub number_peer : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct NetVersionResult { pub network_version : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Web3ClientVersionResult { pub client_version : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetWorkResult { pub currentblock : String , pub seed_hash : String , pub target : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitWorkInput { pub nounce : String , pub pow_hash : String , pub mix_digest : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitWorkResult { pub is_valid : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitHashrateInput { pub hash_rate : String , pub id : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitHashrateResult { pub is_valid : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetStorageAtInput { pub address : String , pub position : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetStorageAtResult { pub value : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionReceiptInput { pub transaction_hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionReceiptResult { pub transaction_receipt : EthTransactionReceipt , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSyncingInfo { pub starting_block : String , pub current_block : String , pub highest_block : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSyncingResult { pub status : bool , pub sync_info : EthSyncingInfo , } extern "Rust" { type Client ; fn NewClient (addr : & str) -> Result < Box < Client >> ; # [allow (clippy :: borrowed_box)] fn CallEth_Accounts (client : & Box < Client >) -> Result < EthAccountsResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_Call (client : & Box < Client > , eth_call_input : EthCallInput) -> Result < EthCallResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_GetBalance (client : & Box < Client > , eth_get_balance_input : EthGetBalanceInput) -> Result < EthGetBalanceResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByHash (client : & Box < Client > , eth_get_block_by_hash_input : EthGetBlockByHashInput) -> Result < EthBlockInfo > ; # [allow (clippy :: borrowed_box)] fn CallEth_ChainId (client : & Box < Client >) -> Result < EthChainIdResult > ; # [allow (clippy :: borrowed_box)] fn CallNet_Version (client : & Box < Client >) -> Result < EthChainIdResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_BlockNumber (client : & Box < Client >) -> Result < EthBlockNumberResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByNumber (client : & Box < Client > , eth_get_block_by_number_input : EthGetBlockByNumberInput) -> Result < EthBlockInfo > ; # [allow (clippy :: borrowed_box)] fn CallEth_Mining (client : & Box < Client >) -> Result < EthMiningResult > ; } -} -use jsonrpsee_core :: client :: ClientT ; use jsonrpsee_http_client :: { HttpClient , HttpClientBuilder } ; use std :: sync :: Arc ; use crate :: { CLIENTS } ; use ain_evm :: runtime :: RUNTIME ; use crate :: rpc :: * ; # [allow (unused_imports)] use self :: ffi :: * ; use ain_evm :: handler :: Handlers ; # [derive (Clone)] pub struct Client { inner : Arc < HttpClient > , handle : tokio :: runtime :: Handle , } # [allow (non_snake_case)] fn NewClient (addr : & str) -> Result < Box < Client > , Box < dyn std :: error :: Error >> { if CLIENTS . read () . unwrap () . get (addr) . is_none () { log :: info ! ("Initializing RPC client for {}" , addr) ; let c = Client { inner : Arc :: new (HttpClientBuilder :: default () . build (addr) ?) , handle : RUNTIME . rt_handle . clone () , } ; CLIENTS . write () . unwrap () . insert (addr . into () , c) ; } Ok (Box :: new (CLIENTS . read () . unwrap () . get (addr) . unwrap () . clone ())) } # [allow (dead_code)] fn missing_param (field : & str) -> jsonrpsee_core :: Error { jsonrpsee_core :: Error :: Call (jsonrpsee_types :: error :: CallError :: Custom (jsonrpsee_types :: ErrorObject :: borrowed (- 1 , & format ! ("Missing required parameter '{field}'") , None) . into_owned ())) } impl From < ffi :: EthSubmitHashrateResult > for super :: types :: EthSubmitHashrateResult { fn from (other : ffi :: EthSubmitHashrateResult) -> Self { super :: types :: EthSubmitHashrateResult { is_valid : other . is_valid . into () , } } } impl From < super :: types :: EthSubmitHashrateResult > for ffi :: EthSubmitHashrateResult { fn from (other : super :: types :: EthSubmitHashrateResult) -> Self { ffi :: EthSubmitHashrateResult { is_valid : other . is_valid . into () , } } } impl From < ffi :: EthGetTransactionCountResult > for super :: types :: EthGetTransactionCountResult { fn from (other : ffi :: EthGetTransactionCountResult) -> Self { super :: types :: EthGetTransactionCountResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetTransactionCountResult > for ffi :: EthGetTransactionCountResult { fn from (other : super :: types :: EthGetTransactionCountResult) -> Self { ffi :: EthGetTransactionCountResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: Web3Sha3Input > for super :: types :: Web3Sha3Input { fn from (other : ffi :: Web3Sha3Input) -> Self { super :: types :: Web3Sha3Input { data : other . data . into () , } } } impl From < super :: types :: Web3Sha3Input > for ffi :: Web3Sha3Input { fn from (other : super :: types :: Web3Sha3Input) -> Self { ffi :: Web3Sha3Input { data : other . data . into () , } } } impl From < ffi :: EthGetUncleCountByBlockHashInput > for super :: types :: EthGetUncleCountByBlockHashInput { fn from (other : ffi :: EthGetUncleCountByBlockHashInput) -> Self { super :: types :: EthGetUncleCountByBlockHashInput { block_hash : other . block_hash . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockHashInput > for ffi :: EthGetUncleCountByBlockHashInput { fn from (other : super :: types :: EthGetUncleCountByBlockHashInput) -> Self { ffi :: EthGetUncleCountByBlockHashInput { block_hash : other . block_hash . into () , } } } impl From < ffi :: EthSyncingInfo > for super :: types :: EthSyncingInfo { fn from (other : ffi :: EthSyncingInfo) -> Self { super :: types :: EthSyncingInfo { starting_block : other . starting_block . into () , current_block : other . current_block . into () , highest_block : other . highest_block . into () , } } } impl From < super :: types :: EthSyncingInfo > for ffi :: EthSyncingInfo { fn from (other : super :: types :: EthSyncingInfo) -> Self { ffi :: EthSyncingInfo { starting_block : other . starting_block . into () , current_block : other . current_block . into () , highest_block : other . highest_block . into () , } } } impl From < ffi :: EthSignTransactionInput > for super :: types :: EthSignTransactionInput { fn from (other : ffi :: EthSignTransactionInput) -> Self { super :: types :: EthSignTransactionInput { transaction_info : Some (other . transaction_info . into ()) , } } } impl From < super :: types :: EthSignTransactionInput > for ffi :: EthSignTransactionInput { fn from (other : super :: types :: EthSignTransactionInput) -> Self { ffi :: EthSignTransactionInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthEstimateGasInput > for super :: types :: EthEstimateGasInput { fn from (other : ffi :: EthEstimateGasInput) -> Self { super :: types :: EthEstimateGasInput { transaction_info : Some (other . transaction_info . into ()) , block_number : Some (other . block_number . into ()) , } } } impl From < super :: types :: EthEstimateGasInput > for ffi :: EthEstimateGasInput { fn from (other : super :: types :: EthEstimateGasInput) -> Self { ffi :: EthEstimateGasInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , block_number : other . block_number . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetTransactionReceiptInput > for super :: types :: EthGetTransactionReceiptInput { fn from (other : ffi :: EthGetTransactionReceiptInput) -> Self { super :: types :: EthGetTransactionReceiptInput { transaction_hash : other . transaction_hash . into () , } } } impl From < super :: types :: EthGetTransactionReceiptInput > for ffi :: EthGetTransactionReceiptInput { fn from (other : super :: types :: EthGetTransactionReceiptInput) -> Self { ffi :: EthGetTransactionReceiptInput { transaction_hash : other . transaction_hash . into () , } } } impl From < ffi :: EthSubmitWorkResult > for super :: types :: EthSubmitWorkResult { fn from (other : ffi :: EthSubmitWorkResult) -> Self { super :: types :: EthSubmitWorkResult { is_valid : other . is_valid . into () , } } } impl From < super :: types :: EthSubmitWorkResult > for ffi :: EthSubmitWorkResult { fn from (other : super :: types :: EthSubmitWorkResult) -> Self { ffi :: EthSubmitWorkResult { is_valid : other . is_valid . into () , } } } impl From < ffi :: EthCompileLllInput > for super :: types :: EthCompileLllInput { fn from (other : ffi :: EthCompileLllInput) -> Self { super :: types :: EthCompileLllInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileLllInput > for ffi :: EthCompileLllInput { fn from (other : super :: types :: EthCompileLllInput) -> Self { ffi :: EthCompileLllInput { code : other . code . into () , } } } impl From < ffi :: Vin > for super :: types :: Vin { fn from (other : ffi :: Vin) -> Self { super :: types :: Vin { txid : other . txid . into () , vout : other . vout . into () , script_sig : Some (other . script_sig . into ()) , sequence : other . sequence . into () , txinwitness : other . txinwitness . into_iter () . map (Into :: into) . collect () , coinbase : other . coinbase . into () , } } } impl From < super :: types :: Vin > for ffi :: Vin { fn from (other : super :: types :: Vin) -> Self { ffi :: Vin { txid : other . txid . into () , vout : other . vout . into () , script_sig : other . script_sig . map (Into :: into) . unwrap_or_default () , sequence : other . sequence . into () , txinwitness : other . txinwitness . into_iter () . map (Into :: into) . collect () , coinbase : other . coinbase . into () , } } } impl From < ffi :: EthGetCompilersResult > for super :: types :: EthGetCompilersResult { fn from (other : ffi :: EthGetCompilersResult) -> Self { super :: types :: EthGetCompilersResult { compilers : other . compilers . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthGetCompilersResult > for ffi :: EthGetCompilersResult { fn from (other : super :: types :: EthGetCompilersResult) -> Self { ffi :: EthGetCompilersResult { compilers : other . compilers . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetStorageAtResult > for super :: types :: EthGetStorageAtResult { fn from (other : ffi :: EthGetStorageAtResult) -> Self { super :: types :: EthGetStorageAtResult { value : other . value . into () , } } } impl From < super :: types :: EthGetStorageAtResult > for ffi :: EthGetStorageAtResult { fn from (other : super :: types :: EthGetStorageAtResult) -> Self { ffi :: EthGetStorageAtResult { value : other . value . into () , } } } impl From < ffi :: EthGetUncleCountByBlockNumberResult > for super :: types :: EthGetUncleCountByBlockNumberResult { fn from (other : ffi :: EthGetUncleCountByBlockNumberResult) -> Self { super :: types :: EthGetUncleCountByBlockNumberResult { number_uncles : other . number_uncles . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockNumberResult > for ffi :: EthGetUncleCountByBlockNumberResult { fn from (other : super :: types :: EthGetUncleCountByBlockNumberResult) -> Self { ffi :: EthGetUncleCountByBlockNumberResult { number_uncles : other . number_uncles . into () , } } } impl From < ffi :: EthCallInput > for super :: types :: EthCallInput { fn from (other : ffi :: EthCallInput) -> Self { super :: types :: EthCallInput { transaction_info : Some (other . transaction_info . into ()) , block_number : other . block_number . into () , } } } impl From < super :: types :: EthCallInput > for ffi :: EthCallInput { fn from (other : super :: types :: EthCallInput) -> Self { ffi :: EthCallInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , block_number : other . block_number . into () , } } } impl From < ffi :: NetVersionResult > for super :: types :: NetVersionResult { fn from (other : ffi :: NetVersionResult) -> Self { super :: types :: NetVersionResult { network_version : other . network_version . into () , } } } impl From < super :: types :: NetVersionResult > for ffi :: NetVersionResult { fn from (other : super :: types :: NetVersionResult) -> Self { ffi :: NetVersionResult { network_version : other . network_version . into () , } } } impl From < ffi :: EthGetBlockByHashResult > for super :: types :: EthGetBlockByHashResult { fn from (other : ffi :: EthGetBlockByHashResult) -> Self { super :: types :: EthGetBlockByHashResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetBlockByHashResult > for ffi :: EthGetBlockByHashResult { fn from (other : super :: types :: EthGetBlockByHashResult) -> Self { ffi :: EthGetBlockByHashResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetCodeInput > for super :: types :: EthGetCodeInput { fn from (other : ffi :: EthGetCodeInput) -> Self { super :: types :: EthGetCodeInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetCodeInput > for ffi :: EthGetCodeInput { fn from (other : super :: types :: EthGetCodeInput) -> Self { ffi :: EthGetCodeInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: PubKey > for super :: types :: PubKey { fn from (other : ffi :: PubKey) -> Self { super :: types :: PubKey { field_asm : other . field_asm . into () , hex : other . hex . into () , field_type : other . field_type . into () , req_sigs : other . req_sigs . into () , addresses : other . addresses . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: PubKey > for ffi :: PubKey { fn from (other : super :: types :: PubKey) -> Self { ffi :: PubKey { field_asm : other . field_asm . into () , hex : other . hex . into () , field_type : other . field_type . into () , req_sigs : other . req_sigs . into () , addresses : other . addresses . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetBlockTransactionCountByHashInput > for super :: types :: EthGetBlockTransactionCountByHashInput { fn from (other : ffi :: EthGetBlockTransactionCountByHashInput) -> Self { super :: types :: EthGetBlockTransactionCountByHashInput { block_hash : other . block_hash . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByHashInput > for ffi :: EthGetBlockTransactionCountByHashInput { fn from (other : super :: types :: EthGetBlockTransactionCountByHashInput) -> Self { ffi :: EthGetBlockTransactionCountByHashInput { block_hash : other . block_hash . into () , } } } impl From < ffi :: EthGetTransactionByBlockHashAndIndexResult > for super :: types :: EthGetTransactionByBlockHashAndIndexResult { fn from (other : ffi :: EthGetTransactionByBlockHashAndIndexResult) -> Self { super :: types :: EthGetTransactionByBlockHashAndIndexResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByBlockHashAndIndexResult > for ffi :: EthGetTransactionByBlockHashAndIndexResult { fn from (other : super :: types :: EthGetTransactionByBlockHashAndIndexResult) -> Self { ffi :: EthGetTransactionByBlockHashAndIndexResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: Web3ClientVersionResult > for super :: types :: Web3ClientVersionResult { fn from (other : ffi :: Web3ClientVersionResult) -> Self { super :: types :: Web3ClientVersionResult { client_version : other . client_version . into () , } } } impl From < super :: types :: Web3ClientVersionResult > for ffi :: Web3ClientVersionResult { fn from (other : super :: types :: Web3ClientVersionResult) -> Self { ffi :: Web3ClientVersionResult { client_version : other . client_version . into () , } } } impl From < ffi :: EthSendRawTransactionInput > for super :: types :: EthSendRawTransactionInput { fn from (other : ffi :: EthSendRawTransactionInput) -> Self { super :: types :: EthSendRawTransactionInput { transaction : other . transaction . into () , } } } impl From < super :: types :: EthSendRawTransactionInput > for ffi :: EthSendRawTransactionInput { fn from (other : super :: types :: EthSendRawTransactionInput) -> Self { ffi :: EthSendRawTransactionInput { transaction : other . transaction . into () , } } } impl From < ffi :: EthGetBlockTransactionCountByNumberResult > for super :: types :: EthGetBlockTransactionCountByNumberResult { fn from (other : ffi :: EthGetBlockTransactionCountByNumberResult) -> Self { super :: types :: EthGetBlockTransactionCountByNumberResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByNumberResult > for ffi :: EthGetBlockTransactionCountByNumberResult { fn from (other : super :: types :: EthGetBlockTransactionCountByNumberResult) -> Self { ffi :: EthGetBlockTransactionCountByNumberResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: EthCompileSolidityResult > for super :: types :: EthCompileSolidityResult { fn from (other : ffi :: EthCompileSolidityResult) -> Self { super :: types :: EthCompileSolidityResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileSolidityResult > for ffi :: EthCompileSolidityResult { fn from (other : super :: types :: EthCompileSolidityResult) -> Self { ffi :: EthCompileSolidityResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: EthSignInput > for super :: types :: EthSignInput { fn from (other : ffi :: EthSignInput) -> Self { super :: types :: EthSignInput { address : other . address . into () , message : other . message . into () , } } } impl From < super :: types :: EthSignInput > for ffi :: EthSignInput { fn from (other : super :: types :: EthSignInput) -> Self { ffi :: EthSignInput { address : other . address . into () , message : other . message . into () , } } } impl From < ffi :: EthSubmitWorkInput > for super :: types :: EthSubmitWorkInput { fn from (other : ffi :: EthSubmitWorkInput) -> Self { super :: types :: EthSubmitWorkInput { nounce : other . nounce . into () , pow_hash : other . pow_hash . into () , mix_digest : other . mix_digest . into () , } } } impl From < super :: types :: EthSubmitWorkInput > for ffi :: EthSubmitWorkInput { fn from (other : super :: types :: EthSubmitWorkInput) -> Self { ffi :: EthSubmitWorkInput { nounce : other . nounce . into () , pow_hash : other . pow_hash . into () , mix_digest : other . mix_digest . into () , } } } impl From < ffi :: EthBlockNumberResult > for super :: types :: EthBlockNumberResult { fn from (other : ffi :: EthBlockNumberResult) -> Self { super :: types :: EthBlockNumberResult { block_number : other . block_number . into () , } } } impl From < super :: types :: EthBlockNumberResult > for ffi :: EthBlockNumberResult { fn from (other : super :: types :: EthBlockNumberResult) -> Self { ffi :: EthBlockNumberResult { block_number : other . block_number . into () , } } } impl From < ffi :: EthCompileLllResult > for super :: types :: EthCompileLllResult { fn from (other : ffi :: EthCompileLllResult) -> Self { super :: types :: EthCompileLllResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileLllResult > for ffi :: EthCompileLllResult { fn from (other : super :: types :: EthCompileLllResult) -> Self { ffi :: EthCompileLllResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: EthHashRateResult > for super :: types :: EthHashRateResult { fn from (other : ffi :: EthHashRateResult) -> Self { super :: types :: EthHashRateResult { hash_rate : other . hash_rate . into () , } } } impl From < super :: types :: EthHashRateResult > for ffi :: EthHashRateResult { fn from (other : super :: types :: EthHashRateResult) -> Self { ffi :: EthHashRateResult { hash_rate : other . hash_rate . into () , } } } impl From < ffi :: EthGasPriceResult > for super :: types :: EthGasPriceResult { fn from (other : ffi :: EthGasPriceResult) -> Self { super :: types :: EthGasPriceResult { gas_price : other . gas_price . into () , } } } impl From < super :: types :: EthGasPriceResult > for ffi :: EthGasPriceResult { fn from (other : super :: types :: EthGasPriceResult) -> Self { ffi :: EthGasPriceResult { gas_price : other . gas_price . into () , } } } impl From < ffi :: EthGetTransactionCountInput > for super :: types :: EthGetTransactionCountInput { fn from (other : ffi :: EthGetTransactionCountInput) -> Self { super :: types :: EthGetTransactionCountInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetTransactionCountInput > for ffi :: EthGetTransactionCountInput { fn from (other : super :: types :: EthGetTransactionCountInput) -> Self { ffi :: EthGetTransactionCountInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthGetBlockByHashInput > for super :: types :: EthGetBlockByHashInput { fn from (other : ffi :: EthGetBlockByHashInput) -> Self { super :: types :: EthGetBlockByHashInput { hash : other . hash . into () , full_transaction : other . full_transaction . into () , } } } impl From < super :: types :: EthGetBlockByHashInput > for ffi :: EthGetBlockByHashInput { fn from (other : super :: types :: EthGetBlockByHashInput) -> Self { ffi :: EthGetBlockByHashInput { hash : other . hash . into () , full_transaction : other . full_transaction . into () , } } } impl From < ffi :: EthSyncingResult > for super :: types :: EthSyncingResult { fn from (other : ffi :: EthSyncingResult) -> Self { super :: types :: EthSyncingResult { status : Some (other . status . into ()) , sync_info : Some (other . sync_info . into ()) , } } } impl From < super :: types :: EthSyncingResult > for ffi :: EthSyncingResult { fn from (other : super :: types :: EthSyncingResult) -> Self { ffi :: EthSyncingResult { status : other . status . map (Into :: into) . unwrap_or_default () , sync_info : other . sync_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthChainIdResult > for super :: types :: EthChainIdResult { fn from (other : ffi :: EthChainIdResult) -> Self { super :: types :: EthChainIdResult { id : other . id . into () , } } } impl From < super :: types :: EthChainIdResult > for ffi :: EthChainIdResult { fn from (other : super :: types :: EthChainIdResult) -> Self { ffi :: EthChainIdResult { id : other . id . into () , } } } impl From < ffi :: EthTransactionReceipt > for super :: types :: EthTransactionReceipt { fn from (other : ffi :: EthTransactionReceipt) -> Self { super :: types :: EthTransactionReceipt { transaction_hash : other . transaction_hash . into () , transaction_index : other . transaction_index . into () , block_hash : other . block_hash . into () , block_number : other . block_number . into () , from : other . from . into () , to : other . to . into () , cumulative_gas_used : other . cumulative_gas_used . into () , effective_gas_price : other . effective_gas_price . into () , gas_used : other . gas_used . into () , contract_address : other . contract_address . into () , logs : other . logs . into_iter () . map (Into :: into) . collect () , logs_bloom : other . logs_bloom . into () , field_type : other . field_type . into () , root : Some (other . root . into ()) , status : Some (other . status . into ()) , } } } impl From < super :: types :: EthTransactionReceipt > for ffi :: EthTransactionReceipt { fn from (other : super :: types :: EthTransactionReceipt) -> Self { ffi :: EthTransactionReceipt { transaction_hash : other . transaction_hash . into () , transaction_index : other . transaction_index . into () , block_hash : other . block_hash . into () , block_number : other . block_number . into () , from : other . from . into () , to : other . to . into () , cumulative_gas_used : other . cumulative_gas_used . into () , effective_gas_price : other . effective_gas_price . into () , gas_used : other . gas_used . into () , contract_address : other . contract_address . into () , logs : other . logs . into_iter () . map (Into :: into) . collect () , logs_bloom : other . logs_bloom . into () , field_type : other . field_type . into () , root : other . root . map (Into :: into) . unwrap_or_default () , status : other . status . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: BlockResult > for super :: types :: BlockResult { fn from (other : ffi :: BlockResult) -> Self { super :: types :: BlockResult { hash : other . hash . into () , block : Some (other . block . into ()) , } } } impl From < super :: types :: BlockResult > for ffi :: BlockResult { fn from (other : super :: types :: BlockResult) -> Self { ffi :: BlockResult { hash : other . hash . into () , block : other . block . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: NonUtxo > for super :: types :: NonUtxo { fn from (other : ffi :: NonUtxo) -> Self { super :: types :: NonUtxo { anchor_reward : other . anchor_reward . into () , burnt : other . burnt . into () , incentive_funding : other . incentive_funding . into () , loan : other . loan . into () , options : other . options . into () , unknown : other . unknown . into () , } } } impl From < super :: types :: NonUtxo > for ffi :: NonUtxo { fn from (other : super :: types :: NonUtxo) -> Self { ffi :: NonUtxo { anchor_reward : other . anchor_reward . into () , burnt : other . burnt . into () , incentive_funding : other . incentive_funding . into () , loan : other . loan . into () , options : other . options . into () , unknown : other . unknown . into () , } } } impl From < ffi :: EthBlockInfo > for super :: types :: EthBlockInfo { fn from (other : ffi :: EthBlockInfo) -> Self { super :: types :: EthBlockInfo { block_number : other . block_number . into () , hash : other . hash . into () , parent_hash : other . parent_hash . into () , nonce : other . nonce . into () , sha3_uncles : other . sha3_uncles . into () , logs_bloom : other . logs_bloom . into () , transactions_root : other . transactions_root . into () , state_root : other . state_root . into () , receipt_root : other . receipt_root . into () , miner : other . miner . into () , difficulty : other . difficulty . into () , total_difficulty : other . total_difficulty . into () , extra_data : other . extra_data . into () , size : other . size . into () , gas_limit : other . gas_limit . into () , gas_used : other . gas_used . into () , timestamps : other . timestamps . into () , transactions : other . transactions . into_iter () . map (Into :: into) . collect () , uncles : other . uncles . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthBlockInfo > for ffi :: EthBlockInfo { fn from (other : super :: types :: EthBlockInfo) -> Self { ffi :: EthBlockInfo { block_number : other . block_number . into () , hash : other . hash . into () , parent_hash : other . parent_hash . into () , nonce : other . nonce . into () , sha3_uncles : other . sha3_uncles . into () , logs_bloom : other . logs_bloom . into () , transactions_root : other . transactions_root . into () , state_root : other . state_root . into () , receipt_root : other . receipt_root . into () , miner : other . miner . into () , difficulty : other . difficulty . into () , total_difficulty : other . total_difficulty . into () , extra_data : other . extra_data . into () , size : other . size . into () , gas_limit : other . gas_limit . into () , gas_used : other . gas_used . into () , timestamps : other . timestamps . into () , transactions : other . transactions . into_iter () . map (Into :: into) . collect () , uncles : other . uncles . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthSignResult > for super :: types :: EthSignResult { fn from (other : ffi :: EthSignResult) -> Self { super :: types :: EthSignResult { signature : other . signature . into () , } } } impl From < super :: types :: EthSignResult > for ffi :: EthSignResult { fn from (other : super :: types :: EthSignResult) -> Self { ffi :: EthSignResult { signature : other . signature . into () , } } } impl From < ffi :: EthGetBlockTransactionCountByHashResult > for super :: types :: EthGetBlockTransactionCountByHashResult { fn from (other : ffi :: EthGetBlockTransactionCountByHashResult) -> Self { super :: types :: EthGetBlockTransactionCountByHashResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByHashResult > for ffi :: EthGetBlockTransactionCountByHashResult { fn from (other : super :: types :: EthGetBlockTransactionCountByHashResult) -> Self { ffi :: EthGetBlockTransactionCountByHashResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: EthGetBalanceResult > for super :: types :: EthGetBalanceResult { fn from (other : ffi :: EthGetBalanceResult) -> Self { super :: types :: EthGetBalanceResult { balance : other . balance . into () , } } } impl From < super :: types :: EthGetBalanceResult > for ffi :: EthGetBalanceResult { fn from (other : super :: types :: EthGetBalanceResult) -> Self { ffi :: EthGetBalanceResult { balance : other . balance . into () , } } } impl From < ffi :: Block > for super :: types :: Block { fn from (other : ffi :: Block) -> Self { super :: types :: Block { hash : other . hash . into () , confirmations : other . confirmations . into () , size : other . size . into () , strippedsize : other . strippedsize . into () , weight : other . weight . into () , height : other . height . into () , version : other . version . into () , version_hex : other . version_hex . into () , merkleroot : other . merkleroot . into () , tx : other . tx . into_iter () . map (Into :: into) . collect () , time : other . time . into () , mediantime : other . mediantime . into () , nonce : other . nonce . into () , bits : other . bits . into () , difficulty : other . difficulty . into () , chainwork : other . chainwork . into () , n_tx : other . n_tx . into () , previous_block_hash : other . previous_block_hash . into () , next_block_hash : other . next_block_hash . into () , masternode : other . masternode . into () , minter : other . minter . into () , minted_blocks : other . minted_blocks . into () , stake_modifier : other . stake_modifier . into () , nonutxo : other . nonutxo . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: Block > for ffi :: Block { fn from (other : super :: types :: Block) -> Self { ffi :: Block { hash : other . hash . into () , confirmations : other . confirmations . into () , size : other . size . into () , strippedsize : other . strippedsize . into () , weight : other . weight . into () , height : other . height . into () , version : other . version . into () , version_hex : other . version_hex . into () , merkleroot : other . merkleroot . into () , tx : other . tx . into_iter () . map (Into :: into) . collect () , time : other . time . into () , mediantime : other . mediantime . into () , nonce : other . nonce . into () , bits : other . bits . into () , difficulty : other . difficulty . into () , chainwork : other . chainwork . into () , n_tx : other . n_tx . into () , previous_block_hash : other . previous_block_hash . into () , next_block_hash : other . next_block_hash . into () , masternode : other . masternode . into () , minter : other . minter . into () , minted_blocks : other . minted_blocks . into () , stake_modifier : other . stake_modifier . into () , nonutxo : other . nonutxo . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetBlockTransactionCountByNumberInput > for super :: types :: EthGetBlockTransactionCountByNumberInput { fn from (other : ffi :: EthGetBlockTransactionCountByNumberInput) -> Self { super :: types :: EthGetBlockTransactionCountByNumberInput { block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByNumberInput > for ffi :: EthGetBlockTransactionCountByNumberInput { fn from (other : super :: types :: EthGetBlockTransactionCountByNumberInput) -> Self { ffi :: EthGetBlockTransactionCountByNumberInput { block_number : other . block_number . into () , } } } impl From < ffi :: EthGetStorageAtInput > for super :: types :: EthGetStorageAtInput { fn from (other : ffi :: EthGetStorageAtInput) -> Self { super :: types :: EthGetStorageAtInput { address : other . address . into () , position : other . position . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetStorageAtInput > for ffi :: EthGetStorageAtInput { fn from (other : super :: types :: EthGetStorageAtInput) -> Self { ffi :: EthGetStorageAtInput { address : other . address . into () , position : other . position . into () , block_number : other . block_number . into () , } } } impl From < ffi :: Web3Sha3Result > for super :: types :: Web3Sha3Result { fn from (other : ffi :: Web3Sha3Result) -> Self { super :: types :: Web3Sha3Result { data : other . data . into () , } } } impl From < super :: types :: Web3Sha3Result > for ffi :: Web3Sha3Result { fn from (other : super :: types :: Web3Sha3Result) -> Self { ffi :: Web3Sha3Result { data : other . data . into () , } } } impl From < ffi :: EthGetBalanceInput > for super :: types :: EthGetBalanceInput { fn from (other : ffi :: EthGetBalanceInput) -> Self { super :: types :: EthGetBalanceInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetBalanceInput > for ffi :: EthGetBalanceInput { fn from (other : super :: types :: EthGetBalanceInput) -> Self { ffi :: EthGetBalanceInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthGetTransactionByHashResult > for super :: types :: EthGetTransactionByHashResult { fn from (other : ffi :: EthGetTransactionByHashResult) -> Self { super :: types :: EthGetTransactionByHashResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByHashResult > for ffi :: EthGetTransactionByHashResult { fn from (other : super :: types :: EthGetTransactionByHashResult) -> Self { ffi :: EthGetTransactionByHashResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetTransactionByHashInput > for super :: types :: EthGetTransactionByHashInput { fn from (other : ffi :: EthGetTransactionByHashInput) -> Self { super :: types :: EthGetTransactionByHashInput { hash : other . hash . into () , } } } impl From < super :: types :: EthGetTransactionByHashInput > for ffi :: EthGetTransactionByHashInput { fn from (other : super :: types :: EthGetTransactionByHashInput) -> Self { ffi :: EthGetTransactionByHashInput { hash : other . hash . into () , } } } impl From < ffi :: EthGetUncleCountByBlockNumberInput > for super :: types :: EthGetUncleCountByBlockNumberInput { fn from (other : ffi :: EthGetUncleCountByBlockNumberInput) -> Self { super :: types :: EthGetUncleCountByBlockNumberInput { block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockNumberInput > for ffi :: EthGetUncleCountByBlockNumberInput { fn from (other : super :: types :: EthGetUncleCountByBlockNumberInput) -> Self { ffi :: EthGetUncleCountByBlockNumberInput { block_number : other . block_number . into () , } } } impl From < ffi :: EthSubmitHashrateInput > for super :: types :: EthSubmitHashrateInput { fn from (other : ffi :: EthSubmitHashrateInput) -> Self { super :: types :: EthSubmitHashrateInput { hash_rate : other . hash_rate . into () , id : other . id . into () , } } } impl From < super :: types :: EthSubmitHashrateInput > for ffi :: EthSubmitHashrateInput { fn from (other : super :: types :: EthSubmitHashrateInput) -> Self { ffi :: EthSubmitHashrateInput { hash_rate : other . hash_rate . into () , id : other . id . into () , } } } impl From < ffi :: EthGetTransactionByBlockHashAndIndexInput > for super :: types :: EthGetTransactionByBlockHashAndIndexInput { fn from (other : ffi :: EthGetTransactionByBlockHashAndIndexInput) -> Self { super :: types :: EthGetTransactionByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetTransactionByBlockHashAndIndexInput > for ffi :: EthGetTransactionByBlockHashAndIndexInput { fn from (other : super :: types :: EthGetTransactionByBlockHashAndIndexInput) -> Self { ffi :: EthGetTransactionByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < ffi :: EthSendRawTransactionResult > for super :: types :: EthSendRawTransactionResult { fn from (other : ffi :: EthSendRawTransactionResult) -> Self { super :: types :: EthSendRawTransactionResult { hash : other . hash . into () , } } } impl From < super :: types :: EthSendRawTransactionResult > for ffi :: EthSendRawTransactionResult { fn from (other : super :: types :: EthSendRawTransactionResult) -> Self { ffi :: EthSendRawTransactionResult { hash : other . hash . into () , } } } impl From < ffi :: ScriptSig > for super :: types :: ScriptSig { fn from (other : ffi :: ScriptSig) -> Self { super :: types :: ScriptSig { field_asm : other . field_asm . into () , hex : other . hex . into () , } } } impl From < super :: types :: ScriptSig > for ffi :: ScriptSig { fn from (other : super :: types :: ScriptSig) -> Self { ffi :: ScriptSig { field_asm : other . field_asm . into () , hex : other . hex . into () , } } } impl From < ffi :: EthGetTransactionByBlockNumberAndIndexInput > for super :: types :: EthGetTransactionByBlockNumberAndIndexInput { fn from (other : ffi :: EthGetTransactionByBlockNumberAndIndexInput) -> Self { super :: types :: EthGetTransactionByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetTransactionByBlockNumberAndIndexInput > for ffi :: EthGetTransactionByBlockNumberAndIndexInput { fn from (other : super :: types :: EthGetTransactionByBlockNumberAndIndexInput) -> Self { ffi :: EthGetTransactionByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < ffi :: EthMiningResult > for super :: types :: EthMiningResult { fn from (other : ffi :: EthMiningResult) -> Self { super :: types :: EthMiningResult { is_mining : other . is_mining . into () , } } } impl From < super :: types :: EthMiningResult > for ffi :: EthMiningResult { fn from (other : super :: types :: EthMiningResult) -> Self { ffi :: EthMiningResult { is_mining : other . is_mining . into () , } } } impl From < ffi :: RawTransaction > for super :: types :: RawTransaction { fn from (other : ffi :: RawTransaction) -> Self { super :: types :: RawTransaction { in_active_chain : other . in_active_chain . into () , hex : other . hex . into () , txid : other . txid . into () , hash : other . hash . into () , size : other . size . into () , vsize : other . vsize . into () , weight : other . weight . into () , version : other . version . into () , locktime : other . locktime . into () , vin : other . vin . into_iter () . map (Into :: into) . collect () , vout : other . vout . into_iter () . map (Into :: into) . collect () , blockhash : other . blockhash . into () , confirmations : other . confirmations . into () , blocktime : other . blocktime . into () , } } } impl From < super :: types :: RawTransaction > for ffi :: RawTransaction { fn from (other : super :: types :: RawTransaction) -> Self { ffi :: RawTransaction { in_active_chain : other . in_active_chain . into () , hex : other . hex . into () , txid : other . txid . into () , hash : other . hash . into () , size : other . size . into () , vsize : other . vsize . into () , weight : other . weight . into () , version : other . version . into () , locktime : other . locktime . into () , vin : other . vin . into_iter () . map (Into :: into) . collect () , vout : other . vout . into_iter () . map (Into :: into) . collect () , blockhash : other . blockhash . into () , confirmations : other . confirmations . into () , blocktime : other . blocktime . into () , } } } impl From < ffi :: EthSendTransactionInput > for super :: types :: EthSendTransactionInput { fn from (other : ffi :: EthSendTransactionInput) -> Self { super :: types :: EthSendTransactionInput { transaction_info : Some (other . transaction_info . into ()) , } } } impl From < super :: types :: EthSendTransactionInput > for ffi :: EthSendTransactionInput { fn from (other : super :: types :: EthSendTransactionInput) -> Self { ffi :: EthSendTransactionInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthSendTransactionResult > for super :: types :: EthSendTransactionResult { fn from (other : ffi :: EthSendTransactionResult) -> Self { super :: types :: EthSendTransactionResult { hash : other . hash . into () , } } } impl From < super :: types :: EthSendTransactionResult > for ffi :: EthSendTransactionResult { fn from (other : super :: types :: EthSendTransactionResult) -> Self { ffi :: EthSendTransactionResult { hash : other . hash . into () , } } } impl From < ffi :: EthGetTransactionReceiptResult > for super :: types :: EthGetTransactionReceiptResult { fn from (other : ffi :: EthGetTransactionReceiptResult) -> Self { super :: types :: EthGetTransactionReceiptResult { transaction_receipt : Some (other . transaction_receipt . into ()) , } } } impl From < super :: types :: EthGetTransactionReceiptResult > for ffi :: EthGetTransactionReceiptResult { fn from (other : super :: types :: EthGetTransactionReceiptResult) -> Self { ffi :: EthGetTransactionReceiptResult { transaction_receipt : other . transaction_receipt . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetUncleByBlockHashAndIndexInput > for super :: types :: EthGetUncleByBlockHashAndIndexInput { fn from (other : ffi :: EthGetUncleByBlockHashAndIndexInput) -> Self { super :: types :: EthGetUncleByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetUncleByBlockHashAndIndexInput > for ffi :: EthGetUncleByBlockHashAndIndexInput { fn from (other : super :: types :: EthGetUncleByBlockHashAndIndexInput) -> Self { ffi :: EthGetUncleByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < ffi :: Transaction > for super :: types :: Transaction { fn from (other : ffi :: Transaction) -> Self { super :: types :: Transaction { hash : other . hash . into () , raw : Some (other . raw . into ()) , } } } impl From < super :: types :: Transaction > for ffi :: Transaction { fn from (other : super :: types :: Transaction) -> Self { ffi :: Transaction { hash : other . hash . into () , raw : other . raw . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthCompileSerpentInput > for super :: types :: EthCompileSerpentInput { fn from (other : ffi :: EthCompileSerpentInput) -> Self { super :: types :: EthCompileSerpentInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileSerpentInput > for ffi :: EthCompileSerpentInput { fn from (other : super :: types :: EthCompileSerpentInput) -> Self { ffi :: EthCompileSerpentInput { code : other . code . into () , } } } impl From < ffi :: EthCompileSerpentResult > for super :: types :: EthCompileSerpentResult { fn from (other : ffi :: EthCompileSerpentResult) -> Self { super :: types :: EthCompileSerpentResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileSerpentResult > for ffi :: EthCompileSerpentResult { fn from (other : super :: types :: EthCompileSerpentResult) -> Self { ffi :: EthCompileSerpentResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: BlockInput > for super :: types :: BlockInput { fn from (other : ffi :: BlockInput) -> Self { super :: types :: BlockInput { blockhash : other . blockhash . into () , verbosity : other . verbosity . into () , } } } impl From < super :: types :: BlockInput > for ffi :: BlockInput { fn from (other : super :: types :: BlockInput) -> Self { ffi :: BlockInput { blockhash : other . blockhash . into () , verbosity : other . verbosity . into () , } } } impl From < ffi :: EthGetUncleCountByBlockHashResult > for super :: types :: EthGetUncleCountByBlockHashResult { fn from (other : ffi :: EthGetUncleCountByBlockHashResult) -> Self { super :: types :: EthGetUncleCountByBlockHashResult { number_uncles : other . number_uncles . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockHashResult > for ffi :: EthGetUncleCountByBlockHashResult { fn from (other : super :: types :: EthGetUncleCountByBlockHashResult) -> Self { ffi :: EthGetUncleCountByBlockHashResult { number_uncles : other . number_uncles . into () , } } } impl From < ffi :: BlockHashResult > for super :: types :: BlockHashResult { fn from (other : ffi :: BlockHashResult) -> Self { super :: types :: BlockHashResult { hash : other . hash . into () , } } } impl From < super :: types :: BlockHashResult > for ffi :: BlockHashResult { fn from (other : super :: types :: BlockHashResult) -> Self { ffi :: BlockHashResult { hash : other . hash . into () , } } } impl From < ffi :: EthCompileSolidityInput > for super :: types :: EthCompileSolidityInput { fn from (other : ffi :: EthCompileSolidityInput) -> Self { super :: types :: EthCompileSolidityInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileSolidityInput > for ffi :: EthCompileSolidityInput { fn from (other : super :: types :: EthCompileSolidityInput) -> Self { ffi :: EthCompileSolidityInput { code : other . code . into () , } } } impl From < ffi :: EthGetUncleByBlockHashAndIndexResult > for super :: types :: EthGetUncleByBlockHashAndIndexResult { fn from (other : ffi :: EthGetUncleByBlockHashAndIndexResult) -> Self { super :: types :: EthGetUncleByBlockHashAndIndexResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetUncleByBlockHashAndIndexResult > for ffi :: EthGetUncleByBlockHashAndIndexResult { fn from (other : super :: types :: EthGetUncleByBlockHashAndIndexResult) -> Self { ffi :: EthGetUncleByBlockHashAndIndexResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthProtocolVersionResult > for super :: types :: EthProtocolVersionResult { fn from (other : ffi :: EthProtocolVersionResult) -> Self { super :: types :: EthProtocolVersionResult { protocol_version : other . protocol_version . into () , } } } impl From < super :: types :: EthProtocolVersionResult > for ffi :: EthProtocolVersionResult { fn from (other : super :: types :: EthProtocolVersionResult) -> Self { ffi :: EthProtocolVersionResult { protocol_version : other . protocol_version . into () , } } } impl From < ffi :: EthEstimateGasResult > for super :: types :: EthEstimateGasResult { fn from (other : ffi :: EthEstimateGasResult) -> Self { super :: types :: EthEstimateGasResult { gas_used : other . gas_used . into () , } } } impl From < super :: types :: EthEstimateGasResult > for ffi :: EthEstimateGasResult { fn from (other : super :: types :: EthEstimateGasResult) -> Self { ffi :: EthEstimateGasResult { gas_used : other . gas_used . into () , } } } impl From < ffi :: EthAccountsResult > for super :: types :: EthAccountsResult { fn from (other : ffi :: EthAccountsResult) -> Self { super :: types :: EthAccountsResult { accounts : other . accounts . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthAccountsResult > for ffi :: EthAccountsResult { fn from (other : super :: types :: EthAccountsResult) -> Self { ffi :: EthAccountsResult { accounts : other . accounts . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetTransactionByBlockNumberAndIndexResult > for super :: types :: EthGetTransactionByBlockNumberAndIndexResult { fn from (other : ffi :: EthGetTransactionByBlockNumberAndIndexResult) -> Self { super :: types :: EthGetTransactionByBlockNumberAndIndexResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByBlockNumberAndIndexResult > for ffi :: EthGetTransactionByBlockNumberAndIndexResult { fn from (other : super :: types :: EthGetTransactionByBlockNumberAndIndexResult) -> Self { ffi :: EthGetTransactionByBlockNumberAndIndexResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetUncleByBlockNumberAndIndexInput > for super :: types :: EthGetUncleByBlockNumberAndIndexInput { fn from (other : ffi :: EthGetUncleByBlockNumberAndIndexInput) -> Self { super :: types :: EthGetUncleByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetUncleByBlockNumberAndIndexInput > for ffi :: EthGetUncleByBlockNumberAndIndexInput { fn from (other : super :: types :: EthGetUncleByBlockNumberAndIndexInput) -> Self { ffi :: EthGetUncleByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < ffi :: Vout > for super :: types :: Vout { fn from (other : ffi :: Vout) -> Self { super :: types :: Vout { value : other . value . into () , n : other . n . into () , script_pub_key : Some (other . script_pub_key . into ()) , token_id : other . token_id . into () , } } } impl From < super :: types :: Vout > for ffi :: Vout { fn from (other : super :: types :: Vout) -> Self { ffi :: Vout { value : other . value . into () , n : other . n . into () , script_pub_key : other . script_pub_key . map (Into :: into) . unwrap_or_default () , token_id : other . token_id . into () , } } } impl From < ffi :: EthCoinBaseResult > for super :: types :: EthCoinBaseResult { fn from (other : ffi :: EthCoinBaseResult) -> Self { super :: types :: EthCoinBaseResult { address : other . address . into () , } } } impl From < super :: types :: EthCoinBaseResult > for ffi :: EthCoinBaseResult { fn from (other : super :: types :: EthCoinBaseResult) -> Self { ffi :: EthCoinBaseResult { address : other . address . into () , } } } impl From < ffi :: EthGetCodeResult > for super :: types :: EthGetCodeResult { fn from (other : ffi :: EthGetCodeResult) -> Self { super :: types :: EthGetCodeResult { code : other . code . into () , } } } impl From < super :: types :: EthGetCodeResult > for ffi :: EthGetCodeResult { fn from (other : super :: types :: EthGetCodeResult) -> Self { ffi :: EthGetCodeResult { code : other . code . into () , } } } impl From < ffi :: EthSignTransactionResult > for super :: types :: EthSignTransactionResult { fn from (other : ffi :: EthSignTransactionResult) -> Self { super :: types :: EthSignTransactionResult { transaction : other . transaction . into () , } } } impl From < super :: types :: EthSignTransactionResult > for ffi :: EthSignTransactionResult { fn from (other : super :: types :: EthSignTransactionResult) -> Self { ffi :: EthSignTransactionResult { transaction : other . transaction . into () , } } } impl From < ffi :: EthGetBlockByNumberResult > for super :: types :: EthGetBlockByNumberResult { fn from (other : ffi :: EthGetBlockByNumberResult) -> Self { super :: types :: EthGetBlockByNumberResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetBlockByNumberResult > for ffi :: EthGetBlockByNumberResult { fn from (other : super :: types :: EthGetBlockByNumberResult) -> Self { ffi :: EthGetBlockByNumberResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthTransactionInfo > for super :: types :: EthTransactionInfo { fn from (other : ffi :: EthTransactionInfo) -> Self { super :: types :: EthTransactionInfo { from : Some (other . from . into ()) , to : Some (other . to . into ()) , gas : Some (other . gas . into ()) , price : Some (other . price . into ()) , value : Some (other . value . into ()) , data : Some (other . data . into ()) , nonce : Some (other . nonce . into ()) , } } } impl From < super :: types :: EthTransactionInfo > for ffi :: EthTransactionInfo { fn from (other : super :: types :: EthTransactionInfo) -> Self { ffi :: EthTransactionInfo { from : other . from . map (Into :: into) . unwrap_or_default () , to : other . to . map (Into :: into) . unwrap_or_default () , gas : other . gas . map (Into :: into) . unwrap_or_default () , price : other . price . map (Into :: into) . unwrap_or_default () , value : other . value . map (Into :: into) . unwrap_or_default () , data : other . data . map (Into :: into) . unwrap_or_default () , nonce : other . nonce . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: NetPeerCountResult > for super :: types :: NetPeerCountResult { fn from (other : ffi :: NetPeerCountResult) -> Self { super :: types :: NetPeerCountResult { number_peer : other . number_peer . into () , } } } impl From < super :: types :: NetPeerCountResult > for ffi :: NetPeerCountResult { fn from (other : super :: types :: NetPeerCountResult) -> Self { ffi :: NetPeerCountResult { number_peer : other . number_peer . into () , } } } impl From < ffi :: EthGetWorkResult > for super :: types :: EthGetWorkResult { fn from (other : ffi :: EthGetWorkResult) -> Self { super :: types :: EthGetWorkResult { currentblock : other . currentblock . into () , seed_hash : other . seed_hash . into () , target : other . target . into () , } } } impl From < super :: types :: EthGetWorkResult > for ffi :: EthGetWorkResult { fn from (other : super :: types :: EthGetWorkResult) -> Self { ffi :: EthGetWorkResult { currentblock : other . currentblock . into () , seed_hash : other . seed_hash . into () , target : other . target . into () , } } } impl From < ffi :: EthGetBlockByNumberInput > for super :: types :: EthGetBlockByNumberInput { fn from (other : ffi :: EthGetBlockByNumberInput) -> Self { super :: types :: EthGetBlockByNumberInput { number : other . number . into () , full_transaction : other . full_transaction . into () , } } } impl From < super :: types :: EthGetBlockByNumberInput > for ffi :: EthGetBlockByNumberInput { fn from (other : super :: types :: EthGetBlockByNumberInput) -> Self { ffi :: EthGetBlockByNumberInput { number : other . number . into () , full_transaction : other . full_transaction . into () , } } } impl From < ffi :: EthGetUncleByBlockNumberAndIndexResult > for super :: types :: EthGetUncleByBlockNumberAndIndexResult { fn from (other : ffi :: EthGetUncleByBlockNumberAndIndexResult) -> Self { super :: types :: EthGetUncleByBlockNumberAndIndexResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetUncleByBlockNumberAndIndexResult > for ffi :: EthGetUncleByBlockNumberAndIndexResult { fn from (other : super :: types :: EthGetUncleByBlockNumberAndIndexResult) -> Self { ffi :: EthGetUncleByBlockNumberAndIndexResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthCallResult > for super :: types :: EthCallResult { fn from (other : ffi :: EthCallResult) -> Self { super :: types :: EthCallResult { data : other . data . into () , } } } impl From < super :: types :: EthCallResult > for ffi :: EthCallResult { fn from (other : super :: types :: EthCallResult) -> Self { ffi :: EthCallResult { data : other . data . into () , } } } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Accounts (client : & Box < Client >) -> Result < ffi :: EthAccountsResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthAccountsResult , _ > = c . request ("eth_accounts" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Call (client : & Box < Client > , eth_call_input : EthCallInput) -> Result < ffi :: EthCallResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_call_input = super :: types :: EthCallInput :: from (eth_call_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_call_input . transaction_info , & eth_call_input . block_number] ; let resp : Result < super :: types :: EthCallResult , _ > = c . request ("eth_call" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBalance (client : & Box < Client > , eth_get_balance_input : EthGetBalanceInput) -> Result < ffi :: EthGetBalanceResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_balance_input = super :: types :: EthGetBalanceInput :: from (eth_get_balance_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_balance_input . address , & eth_get_balance_input . block_number] ; let resp : Result < super :: types :: EthGetBalanceResult , _ > = c . request ("eth_getbalance" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByHash (client : & Box < Client > , eth_get_block_by_hash_input : EthGetBlockByHashInput) -> Result < ffi :: EthBlockInfo , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_block_by_hash_input = super :: types :: EthGetBlockByHashInput :: from (eth_get_block_by_hash_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_block_by_hash_input . hash , & eth_get_block_by_hash_input . full_transaction] ; let resp : Result < super :: types :: EthBlockInfo , _ > = c . request ("eth_getblockbyhash" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_ChainId (client : & Box < Client >) -> Result < ffi :: EthChainIdResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthChainIdResult , _ > = c . request ("eth_chainid" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallNet_Version (client : & Box < Client >) -> Result < ffi :: EthChainIdResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthChainIdResult , _ > = c . request ("net_version" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_BlockNumber (client : & Box < Client >) -> Result < ffi :: EthBlockNumberResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthBlockNumberResult , _ > = c . request ("eth_blocknumber" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByNumber (client : & Box < Client > , eth_get_block_by_number_input : EthGetBlockByNumberInput) -> Result < ffi :: EthBlockInfo , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_block_by_number_input = super :: types :: EthGetBlockByNumberInput :: from (eth_get_block_by_number_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_block_by_number_input . number , & eth_get_block_by_number_input . full_transaction] ; let resp : Result < super :: types :: EthBlockInfo , _ > = c . request ("eth_getblockbynumber" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Mining (client : & Box < Client >) -> Result < ffi :: EthMiningResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthMiningResult , _ > = c . request ("eth_mining" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) }# [derive (Clone)] pub struct BlockchainService { adapter : Arc < Handlers > } impl BlockchainService { # [inline] # [allow (dead_code)] pub fn new (adapter : Arc < Handlers >) -> BlockchainService { BlockchainService { adapter } } # [inline] # [allow (dead_code)] pub fn service (& self) -> blockchain_server :: BlockchainServer < BlockchainService > { blockchain_server :: BlockchainServer :: new (self . clone ()) } # [inline] # [allow (unused_mut , dead_code)] pub fn module (& self) -> Result < jsonrpsee_http_server :: RpcModule < () > , jsonrpsee_core :: Error > { let mut module = jsonrpsee_http_server :: RpcModule :: new (()) ; Ok (module) } } # [tonic :: async_trait] impl blockchain_server :: Blockchain for BlockchainService { # [allow (unused_variables)] async fn get_best_block_hash (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: BlockHashResult > , tonic :: Status > { unimplemented ! () ; } # [allow (unused_variables)] async fn get_block (& self , request : tonic :: Request < super :: types :: BlockInput >) -> Result < tonic :: Response < super :: types :: BlockResult > , tonic :: Status > { unimplemented ! () ; } }# [derive (Clone)] pub struct EthService { adapter : Arc < Handlers > } impl EthService { # [inline] # [allow (dead_code)] pub fn new (adapter : Arc < Handlers >) -> EthService { EthService { adapter } } # [inline] # [allow (dead_code)] pub fn service (& self) -> eth_server :: EthServer < EthService > { eth_server :: EthServer :: new (self . clone ()) } # [inline] # [allow (unused_mut , dead_code)] pub fn module (& self) -> Result < jsonrpsee_http_server :: RpcModule < () > , jsonrpsee_core :: Error > { let mut module = jsonrpsee_http_server :: RpcModule :: new (()) ; let adapter = self . adapter . clone () ; module . register_method ("eth_accounts" , move | _params , _ | { Self :: Eth_Accounts (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_call" , move | _params , _ | { let mut eth_call_input = super :: types :: EthCallInput :: default () ; if _params . is_object () { eth_call_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_call_input . transaction_info = seq . next () . map_err (| _ | missing_param ("transaction_info")) ? ; eth_call_input . block_number = seq . next () . map_err (| _ | missing_param ("block_number")) ? ; } let mut input = eth_call_input . into () ; Self :: Eth_Call (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getbalance" , move | _params , _ | { let mut eth_get_balance_input = super :: types :: EthGetBalanceInput :: default () ; if _params . is_object () { eth_get_balance_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_balance_input . address = seq . next () . map_err (| _ | missing_param ("address")) ? ; eth_get_balance_input . block_number = seq . next () . map_err (| _ | missing_param ("block_number")) ? ; } let mut input = eth_get_balance_input . into () ; Self :: Eth_GetBalance (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getblockbyhash" , move | _params , _ | { let mut eth_get_block_by_hash_input = super :: types :: EthGetBlockByHashInput :: default () ; if _params . is_object () { eth_get_block_by_hash_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_block_by_hash_input . hash = seq . next () . map_err (| _ | missing_param ("hash")) ? ; eth_get_block_by_hash_input . full_transaction = seq . next () . map_err (| _ | missing_param ("full_transaction")) ? ; } let mut input = eth_get_block_by_hash_input . into () ; Self :: Eth_GetBlockByHash (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_chainid" , move | _params , _ | { Self :: Eth_ChainId (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("net_version" , move | _params , _ | { Self :: Net_Version (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_blocknumber" , move | _params , _ | { Self :: Eth_BlockNumber (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getblockbynumber" , move | _params , _ | { let mut eth_get_block_by_number_input = super :: types :: EthGetBlockByNumberInput :: default () ; if _params . is_object () { eth_get_block_by_number_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_block_by_number_input . number = seq . next () . map_err (| _ | missing_param ("number")) ? ; eth_get_block_by_number_input . full_transaction = seq . next () . map_err (| _ | missing_param ("full_transaction")) ? ; } let mut input = eth_get_block_by_number_input . into () ; Self :: Eth_GetBlockByNumber (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_mining" , move | _params , _ | { Self :: Eth_Mining (adapter . clone () ,) }) ? ; Ok (module) } } # [tonic :: async_trait] impl eth_server :: Eth for EthService { async fn eth_accounts (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthAccountsResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_Accounts (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_call (& self , request : tonic :: Request < super :: types :: EthCallInput >) -> Result < tonic :: Response < super :: types :: EthCallResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_Call (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_balance (& self , request : tonic :: Request < super :: types :: EthGetBalanceInput >) -> Result < tonic :: Response < super :: types :: EthGetBalanceResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBalance (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_block_by_hash (& self , request : tonic :: Request < super :: types :: EthGetBlockByHashInput >) -> Result < tonic :: Response < super :: types :: EthBlockInfo > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBlockByHash (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } # [allow (unused_variables)] async fn eth_send_transaction (& self , request : tonic :: Request < super :: types :: EthSendTransactionInput >) -> Result < tonic :: Response < super :: types :: EthSendTransactionResult > , tonic :: Status > { unimplemented ! () ; } async fn eth_chain_id (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthChainIdResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_ChainId (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn net_version (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthChainIdResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Net_Version (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_block_number (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthBlockNumberResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_BlockNumber (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_block_by_number (& self , request : tonic :: Request < super :: types :: EthGetBlockByNumberInput >) -> Result < tonic :: Response < super :: types :: EthBlockInfo > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBlockByNumber (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_mining (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthMiningResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_Mining (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } } \ No newline at end of file diff --git a/src/rust/crates/ain-grpc/src/gen/types.rs b/src/rust/crates/ain-grpc/src/gen/types.rs deleted file mode 100644 index b5aefd45ec..0000000000 --- a/src/rust/crates/ain-grpc/src/gen/types.rs +++ /dev/null @@ -1,1167 +0,0 @@ -fn ignore_integer( - i: &T, -) -> bool { - T::from(-1).unwrap() == *i -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message)] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct Transaction { - #[doc = " Transaction hash"] - #[prost(string, tag = "1")] - pub hash: ::prost::alloc::string::String, - #[doc = " Raw transaction data"] - #[prost(message, optional, tag = "2")] - pub raw: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct RawTransaction { - #[doc = " Whether specified block is in the active chain or not (only present with explicit \"blockhash\" argument)"] - #[prost(bool, tag = "1")] - pub in_active_chain: bool, - #[doc = " The serialized, hex-encoded data for 'txid'"] - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hex: ::prost::alloc::string::String, - #[doc = " The transaction id (same as provided)"] - #[prost(string, tag = "3")] - #[serde(skip_serializing_if = "String::is_empty")] - pub txid: ::prost::alloc::string::String, - #[doc = " The transaction hash (differs from txid for witness transactions)"] - #[prost(string, tag = "4")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash: ::prost::alloc::string::String, - #[doc = " The serialized transaction size"] - #[prost(uint32, tag = "5")] - pub size: u32, - #[doc = " The virtual transaction size (differs from size for witness transactions)"] - #[prost(uint32, tag = "6")] - pub vsize: u32, - #[doc = " The transaction's weight (between vsize*4-3 and vsize*4)"] - #[prost(uint32, tag = "7")] - pub weight: u32, - #[doc = " The transaction version"] - #[prost(uint32, tag = "8")] - pub version: u32, - #[doc = " The lock time"] - #[prost(uint64, tag = "9")] - pub locktime: u64, - #[doc = " List of inputs"] - #[prost(message, repeated, tag = "10")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub vin: ::prost::alloc::vec::Vec, - #[doc = " List of outputs"] - #[prost(message, repeated, tag = "11")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub vout: ::prost::alloc::vec::Vec, - #[doc = " The block hash"] - #[prost(string, tag = "12")] - #[serde(skip_serializing_if = "String::is_empty")] - pub blockhash: ::prost::alloc::string::String, - #[doc = " The confirmations"] - #[prost(string, tag = "13")] - #[serde(skip_serializing_if = "String::is_empty")] - pub confirmations: ::prost::alloc::string::String, - #[doc = " The block time in seconds since UNIX epoch"] - #[prost(uint64, tag = "14")] - pub blocktime: u64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct Vin { - #[doc = " The transaction id"] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub txid: ::prost::alloc::string::String, - #[doc = " The output index"] - #[prost(uint32, tag = "2")] - pub vout: u32, - #[doc = " The script signature"] - #[prost(message, optional, tag = "3")] - pub script_sig: ::core::option::Option, - #[doc = " The script sequence number"] - #[prost(uint64, tag = "4")] - pub sequence: u64, - #[doc = " Hex-encoded witness data"] - #[prost(string, repeated, tag = "5")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub txinwitness: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[doc = " DeFiChain fields"] - #[prost(string, tag = "51")] - #[serde(skip_serializing_if = "String::is_empty")] - pub coinbase: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct ScriptSig { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - #[serde(rename = "asm")] - pub field_asm: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hex: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct Vout { - #[prost(double, tag = "1")] - pub value: f64, - #[prost(uint64, tag = "2")] - pub n: u64, - #[prost(message, optional, tag = "3")] - pub script_pub_key: ::core::option::Option, - #[prost(uint64, tag = "4")] - pub token_id: u64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct PubKey { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - #[serde(rename = "asm")] - pub field_asm: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hex: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - #[serde(skip_serializing_if = "String::is_empty")] - #[serde(rename = "type")] - pub field_type: ::prost::alloc::string::String, - #[prost(int32, tag = "4")] - #[serde(skip_serializing_if = "ignore_integer")] - pub req_sigs: i32, - #[prost(string, repeated, tag = "5")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct Block { - #[doc = " Block hash (same as input, if any)"] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash: ::prost::alloc::string::String, - #[doc = " The number of confirmations, or -1 if the block is not on the main chain"] - #[prost(int64, tag = "2")] - pub confirmations: i64, - #[doc = " Block size"] - #[prost(uint64, tag = "3")] - pub size: u64, - #[doc = " Block size without witness data"] - #[prost(uint64, tag = "4")] - pub strippedsize: u64, - #[doc = " The block weight as defined in BIP 141"] - #[prost(uint64, tag = "5")] - pub weight: u64, - #[doc = " The block height or index"] - #[prost(uint64, tag = "6")] - pub height: u64, - #[doc = " The block version"] - #[prost(uint64, tag = "7")] - pub version: u64, - #[doc = " The block version in hex"] - #[prost(string, tag = "8")] - #[serde(skip_serializing_if = "String::is_empty")] - pub version_hex: ::prost::alloc::string::String, - #[doc = " The merkle root"] - #[prost(string, tag = "9")] - #[serde(skip_serializing_if = "String::is_empty")] - pub merkleroot: ::prost::alloc::string::String, - #[doc = " List of transaction IDs"] - #[prost(message, repeated, tag = "10")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub tx: ::prost::alloc::vec::Vec, - #[doc = " The block time in seconds since UNIX epoch"] - #[prost(uint64, tag = "11")] - pub time: u64, - #[doc = " The median block time in seconds since UNIX epoch"] - #[prost(uint64, tag = "12")] - pub mediantime: u64, - #[doc = " The nonce used to generate the block (property exists only when PoW is used)"] - #[prost(uint64, tag = "13")] - pub nonce: u64, - #[doc = " The bits which represent the target difficulty"] - #[prost(string, tag = "14")] - #[serde(skip_serializing_if = "String::is_empty")] - pub bits: ::prost::alloc::string::String, - #[doc = " The difficulty of the block"] - #[prost(double, tag = "15")] - pub difficulty: f64, - #[doc = " Expected number of hashes required to produce the chain up to this block (in hex)"] - #[prost(string, tag = "16")] - #[serde(skip_serializing_if = "String::is_empty")] - pub chainwork: ::prost::alloc::string::String, - #[doc = " Number of transactions in the block"] - #[prost(uint32, tag = "17")] - pub n_tx: u32, - #[doc = " The hash of the previous block"] - #[prost(string, tag = "18")] - #[serde(skip_serializing_if = "String::is_empty")] - #[serde(rename = "previousblockhash")] - pub previous_block_hash: ::prost::alloc::string::String, - #[doc = " The hash of the next block"] - #[prost(string, tag = "19")] - #[serde(skip_serializing_if = "String::is_empty")] - #[serde(rename = "nextblockhash")] - pub next_block_hash: ::prost::alloc::string::String, - #[doc = " DeFiChain fields"] - #[prost(string, tag = "101")] - #[serde(skip_serializing_if = "String::is_empty")] - pub masternode: ::prost::alloc::string::String, - #[prost(string, tag = "102")] - #[serde(skip_serializing_if = "String::is_empty")] - pub minter: ::prost::alloc::string::String, - #[prost(uint64, tag = "103")] - pub minted_blocks: u64, - #[prost(string, tag = "104")] - #[serde(skip_serializing_if = "String::is_empty")] - pub stake_modifier: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "105")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub nonutxo: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Serialize, Deserialize)] -#[serde(rename_all = "PascalCase")] -pub struct NonUtxo { - #[prost(double, tag = "1")] - pub anchor_reward: f64, - #[prost(double, tag = "2")] - pub burnt: f64, - #[prost(double, tag = "3")] - pub incentive_funding: f64, - #[prost(double, tag = "4")] - pub loan: f64, - #[prost(double, tag = "5")] - pub options: f64, - #[prost(double, tag = "6")] - pub unknown: f64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct BlockInput { - #[doc = " Block hash"] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub blockhash: ::prost::alloc::string::String, - #[doc = " 0 for hex-encoded data, 1 for a json object, and 2 for json object with transaction data [default: 1]"] - #[prost(uint32, tag = "2")] - pub verbosity: u32, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message)] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct BlockResult { - #[doc = " Hex-encoded data for block hash (for verbosity 0)"] - #[prost(string, tag = "1")] - pub hash: ::prost::alloc::string::String, - #[doc = " Block data (for verbosity 1 and 2)"] - #[prost(message, optional, tag = "2")] - pub block: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct BlockHashResult { - #[doc = " Hex-encoded data for block hash"] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthAccountsResult { - #[doc = " Accounts"] - #[prost(string, repeated, tag = "1")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub accounts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthTransactionInfo { - #[doc = " The address from which the transaction is sent"] - #[prost(string, optional, tag = "1")] - pub from: ::core::option::Option<::prost::alloc::string::String>, - #[doc = " The address to which the transaction is addressed"] - #[prost(string, optional, tag = "2")] - pub to: ::core::option::Option<::prost::alloc::string::String>, - #[doc = " The integer of gas provided for the transaction execution"] - #[prost(uint64, optional, tag = "3")] - pub gas: ::core::option::Option, - #[doc = " The integer of gas price used for each paid gas encoded as hexadecimal"] - #[prost(uint64, optional, tag = "4")] - pub price: ::core::option::Option, - #[doc = " The integer of value sent with this transaction encoded as hexadecimal"] - #[prost(uint64, optional, tag = "5")] - pub value: ::core::option::Option, - #[doc = " The hash of the method signature and encoded parameters."] - #[prost(string, optional, tag = "6")] - pub data: ::core::option::Option<::prost::alloc::string::String>, - #[doc = " The integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce."] - #[prost(uint64, optional, tag = "7")] - pub nonce: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthChainIdResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub id: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthBlockInfo { - #[doc = " The block number. null when its pending block."] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, - #[doc = " Hash of the block. null when its pending block."] - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash: ::prost::alloc::string::String, - #[doc = " Hash of the parent block."] - #[prost(string, tag = "3")] - #[serde(skip_serializing_if = "String::is_empty")] - pub parent_hash: ::prost::alloc::string::String, - #[doc = " Hash of the generated proof-of-work. null when its pending block."] - #[prost(string, tag = "4")] - #[serde(skip_serializing_if = "String::is_empty")] - pub nonce: ::prost::alloc::string::String, - #[doc = " SHA3 of the uncles data in the block."] - #[prost(string, tag = "5")] - #[serde(skip_serializing_if = "String::is_empty")] - pub sha3_uncles: ::prost::alloc::string::String, - #[doc = " The bloom filter for the logs of the block. null when its pending block."] - #[prost(string, tag = "6")] - #[serde(skip_serializing_if = "String::is_empty")] - pub logs_bloom: ::prost::alloc::string::String, - #[doc = " The root of the transaction trie of the block."] - #[prost(string, tag = "7")] - #[serde(skip_serializing_if = "String::is_empty")] - pub transactions_root: ::prost::alloc::string::String, - #[doc = " The root of the final state trie of the block."] - #[prost(string, tag = "8")] - #[serde(skip_serializing_if = "String::is_empty")] - pub state_root: ::prost::alloc::string::String, - #[doc = " The root of the receipts trie of the block."] - #[prost(string, tag = "9")] - #[serde(skip_serializing_if = "String::is_empty")] - pub receipt_root: ::prost::alloc::string::String, - #[doc = " The address of the beneficiary to whom the mining rewards were given."] - #[prost(string, tag = "10")] - #[serde(skip_serializing_if = "String::is_empty")] - pub miner: ::prost::alloc::string::String, - #[doc = " Integer of the difficulty for this block."] - #[prost(string, tag = "11")] - #[serde(skip_serializing_if = "String::is_empty")] - pub difficulty: ::prost::alloc::string::String, - #[doc = " Integer of the total difficulty of the chain until this block."] - #[prost(string, tag = "12")] - #[serde(skip_serializing_if = "String::is_empty")] - pub total_difficulty: ::prost::alloc::string::String, - #[doc = " The \"extra data\" field of this block."] - #[prost(string, tag = "13")] - #[serde(skip_serializing_if = "String::is_empty")] - pub extra_data: ::prost::alloc::string::String, - #[doc = " Integer the size of this block in bytes."] - #[prost(string, tag = "14")] - #[serde(skip_serializing_if = "String::is_empty")] - pub size: ::prost::alloc::string::String, - #[doc = " The maximum gas allowed in this block."] - #[prost(string, tag = "15")] - #[serde(skip_serializing_if = "String::is_empty")] - pub gas_limit: ::prost::alloc::string::String, - #[doc = " The total used gas by all transactions in this block."] - #[prost(string, tag = "16")] - #[serde(skip_serializing_if = "String::is_empty")] - pub gas_used: ::prost::alloc::string::String, - #[doc = " The unix timestamp for when the block was collated."] - #[prost(string, tag = "17")] - #[serde(skip_serializing_if = "String::is_empty")] - pub timestamps: ::prost::alloc::string::String, - #[doc = " Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter."] - #[prost(string, repeated, tag = "18")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub transactions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[doc = " Array of uncle hashes."] - #[prost(string, repeated, tag = "19")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub uncles: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthTransactionReceipt { - #[doc = " Hash of the transaction."] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub transaction_hash: ::prost::alloc::string::String, - #[doc = " Integer of the transactions index position in the block."] - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub transaction_index: ::prost::alloc::string::String, - #[doc = " Hash of the block where this transaction was in."] - #[prost(string, tag = "3")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_hash: ::prost::alloc::string::String, - #[doc = " Block number where this transaction was in."] - #[prost(string, tag = "4")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, - #[doc = " Address of the sender."] - #[prost(string, tag = "5")] - #[serde(skip_serializing_if = "String::is_empty")] - pub from: ::prost::alloc::string::String, - #[doc = " Address of the receiver. null when its a contract creation transaction."] - #[prost(string, tag = "6")] - #[serde(skip_serializing_if = "String::is_empty")] - pub to: ::prost::alloc::string::String, - #[doc = " The total amount of gas used when this transaction was executed in the block."] - #[prost(string, tag = "7")] - #[serde(skip_serializing_if = "String::is_empty")] - pub cumulative_gas_used: ::prost::alloc::string::String, - #[doc = " The sum of the base fee and tip paid per unit of gas."] - #[prost(string, tag = "8")] - #[serde(skip_serializing_if = "String::is_empty")] - pub effective_gas_price: ::prost::alloc::string::String, - #[doc = " The amount of gas used by this specific transaction alone."] - #[prost(string, tag = "9")] - #[serde(skip_serializing_if = "String::is_empty")] - pub gas_used: ::prost::alloc::string::String, - #[doc = " The contract address created, if the transaction was a contract creation, otherwise null."] - #[prost(string, tag = "10")] - #[serde(skip_serializing_if = "String::is_empty")] - pub contract_address: ::prost::alloc::string::String, - #[doc = " Array of log objects, which this transaction generated."] - #[prost(string, repeated, tag = "11")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub logs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[doc = " Bloom filter for light clients to quickly retrieve related logs."] - #[prost(string, tag = "12")] - #[serde(skip_serializing_if = "String::is_empty")] - pub logs_bloom: ::prost::alloc::string::String, - #[doc = " Integer of the transaction type, 0x00 for legacy transactions, 0x01 for access list types, 0x02 for dynamic fees. It also returns either :"] - #[prost(string, tag = "13")] - #[serde(skip_serializing_if = "String::is_empty")] - #[serde(rename = "type")] - pub field_type: ::prost::alloc::string::String, - #[doc = " 32 bytes of post-transaction stateroot (pre Byzantium)"] - #[prost(string, optional, tag = "14")] - pub root: ::core::option::Option<::prost::alloc::string::String>, - #[doc = " Either 1 (success) or 0 (failure)"] - #[prost(string, optional, tag = "15")] - pub status: ::core::option::Option<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthCallInput { - #[doc = " Transaction info"] - #[prost(message, optional, tag = "1")] - pub transaction_info: ::core::option::Option, - #[doc = " Block number in hexadecimal format or the string latest, earliest, pending, safe or finalized"] - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthCallResult { - #[doc = " The return value of the executed contract method"] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub data: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSignInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub message: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSignResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub signature: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBalanceInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBalanceResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub balance: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSendTransactionInput { - #[prost(message, optional, tag = "1")] - pub transaction_info: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSendTransactionResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthCoinBaseResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub address: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthMiningResult { - #[prost(bool, tag = "1")] - pub is_mining: bool, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthHashRateResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash_rate: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGasPriceResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub gas_price: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthBlockNumberResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionCountInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionCountResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub number_transaction: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBlockTransactionCountByHashInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_hash: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBlockTransactionCountByHashResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub number_transaction: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBlockTransactionCountByNumberInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBlockTransactionCountByNumberResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub number_transaction: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetUncleCountByBlockHashInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_hash: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetUncleCountByBlockHashResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub number_uncles: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetUncleCountByBlockNumberInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetUncleCountByBlockNumberResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub number_uncles: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetCodeInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetCodeResult { - #[doc = " The code from the given address."] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub code: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSignTransactionInput { - #[prost(message, optional, tag = "1")] - pub transaction_info: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSignTransactionResult { - #[doc = " The signed transaction object."] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub transaction: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSendRawTransactionInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub transaction: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSendRawTransactionResult { - #[doc = " The transaction hash, or the zero hash if the transaction is not yet available."] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthEstimateGasInput { - #[doc = " Transaction info"] - #[prost(message, optional, tag = "1")] - pub transaction_info: ::core::option::Option, - #[doc = " Block number in hexadecimal format or the string latest, earliest, pending, safe or finalized"] - #[prost(string, optional, tag = "2")] - pub block_number: ::core::option::Option<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthEstimateGasResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub gas_used: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBlockByHashInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash: ::prost::alloc::string::String, - #[prost(bool, tag = "2")] - pub full_transaction: bool, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBlockByHashResult { - #[prost(message, optional, tag = "1")] - pub block_info: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBlockByNumberInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub number: ::prost::alloc::string::String, - #[prost(bool, tag = "2")] - pub full_transaction: bool, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBlockByNumberResult { - #[prost(message, optional, tag = "1")] - pub block_info: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionByHashInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionByHashResult { - #[prost(message, optional, tag = "1")] - pub transaction: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionByBlockHashAndIndexInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_hash: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub index: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionByBlockHashAndIndexResult { - #[prost(message, optional, tag = "1")] - pub transaction: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionByBlockNumberAndIndexInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub index: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionByBlockNumberAndIndexResult { - #[prost(message, optional, tag = "1")] - pub transaction: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetUncleByBlockHashAndIndexInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_hash: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub index: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetUncleByBlockHashAndIndexResult { - #[prost(message, optional, tag = "1")] - pub block_info: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetUncleByBlockNumberAndIndexInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub index: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetUncleByBlockNumberAndIndexResult { - #[prost(message, optional, tag = "1")] - pub block_info: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetCompilersResult { - #[prost(string, repeated, tag = "1")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub compilers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthCompileSolidityInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub code: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthCompileSolidityResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub compiled_code: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthCompileLllInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub code: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthCompileLllResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub compiled_code: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthCompileSerpentInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub code: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthCompileSerpentResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub compiled_code: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthProtocolVersionResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub protocol_version: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct Web3Sha3Input { - #[doc = " The data to convert into a SHA3 hash"] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub data: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct Web3Sha3Result { - #[doc = " The SHA3 result of the given string."] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub data: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct NetPeerCountResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub number_peer: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct NetVersionResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub network_version: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct Web3ClientVersionResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub client_version: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetWorkResult { - #[doc = " Current block header pow-hash"] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub currentblock: ::prost::alloc::string::String, - #[doc = " The seed hash used for the DAG."] - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub seed_hash: ::prost::alloc::string::String, - #[doc = " The boundary condition (\"target\"), 2^256 / difficulty."] - #[prost(string, tag = "3")] - #[serde(skip_serializing_if = "String::is_empty")] - pub target: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSubmitWorkInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub nounce: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub pow_hash: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - #[serde(skip_serializing_if = "String::is_empty")] - pub mix_digest: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSubmitWorkResult { - #[prost(bool, tag = "1")] - pub is_valid: bool, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSubmitHashrateInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash_rate: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub id: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSubmitHashrateResult { - #[prost(bool, tag = "1")] - pub is_valid: bool, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetStorageAtInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub position: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetStorageAtResult { - #[doc = " The value at this storage position."] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub value: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionReceiptInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub transaction_hash: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionReceiptResult { - #[prost(message, optional, tag = "1")] - pub transaction_receipt: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSyncingInfo { - #[doc = " The block at which the import started (will only be reset, after the sync reached his head)"] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub starting_block: ::prost::alloc::string::String, - #[doc = " The current block, same as eth_blockNumber"] - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub current_block: ::prost::alloc::string::String, - #[doc = " The estimated highest block"] - #[prost(string, tag = "3")] - #[serde(skip_serializing_if = "String::is_empty")] - pub highest_block: ::prost::alloc::string::String, -} -#[doc = " TODO make it oneof"] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSyncingResult { - #[prost(bool, optional, tag = "1")] - pub status: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub sync_info: ::core::option::Option, -} diff --git a/src/rust/protobuf/google/protobuf/any.proto b/src/rust/proto/google/protobuf/any.proto similarity index 100% rename from src/rust/protobuf/google/protobuf/any.proto rename to src/rust/proto/google/protobuf/any.proto diff --git a/src/rust/protobuf/google/protobuf/api.proto b/src/rust/proto/google/protobuf/api.proto similarity index 100% rename from src/rust/protobuf/google/protobuf/api.proto rename to src/rust/proto/google/protobuf/api.proto diff --git a/src/rust/protobuf/google/protobuf/compiler/plugin.proto b/src/rust/proto/google/protobuf/compiler/plugin.proto similarity index 100% rename from src/rust/protobuf/google/protobuf/compiler/plugin.proto rename to src/rust/proto/google/protobuf/compiler/plugin.proto diff --git a/src/rust/protobuf/google/protobuf/descriptor.proto b/src/rust/proto/google/protobuf/descriptor.proto similarity index 100% rename from src/rust/protobuf/google/protobuf/descriptor.proto rename to src/rust/proto/google/protobuf/descriptor.proto diff --git a/src/rust/protobuf/google/protobuf/duration.proto b/src/rust/proto/google/protobuf/duration.proto similarity index 100% rename from src/rust/protobuf/google/protobuf/duration.proto rename to src/rust/proto/google/protobuf/duration.proto diff --git a/src/rust/protobuf/google/protobuf/empty.proto b/src/rust/proto/google/protobuf/empty.proto similarity index 100% rename from src/rust/protobuf/google/protobuf/empty.proto rename to src/rust/proto/google/protobuf/empty.proto diff --git a/src/rust/protobuf/google/protobuf/field_mask.proto b/src/rust/proto/google/protobuf/field_mask.proto similarity index 100% rename from src/rust/protobuf/google/protobuf/field_mask.proto rename to src/rust/proto/google/protobuf/field_mask.proto diff --git a/src/rust/protobuf/google/protobuf/source_context.proto b/src/rust/proto/google/protobuf/source_context.proto similarity index 100% rename from src/rust/protobuf/google/protobuf/source_context.proto rename to src/rust/proto/google/protobuf/source_context.proto diff --git a/src/rust/protobuf/google/protobuf/struct.proto b/src/rust/proto/google/protobuf/struct.proto similarity index 100% rename from src/rust/protobuf/google/protobuf/struct.proto rename to src/rust/proto/google/protobuf/struct.proto diff --git a/src/rust/protobuf/google/protobuf/timestamp.proto b/src/rust/proto/google/protobuf/timestamp.proto similarity index 100% rename from src/rust/protobuf/google/protobuf/timestamp.proto rename to src/rust/proto/google/protobuf/timestamp.proto diff --git a/src/rust/protobuf/google/protobuf/type.proto b/src/rust/proto/google/protobuf/type.proto similarity index 100% rename from src/rust/protobuf/google/protobuf/type.proto rename to src/rust/proto/google/protobuf/type.proto diff --git a/src/rust/protobuf/google/protobuf/wrappers.proto b/src/rust/proto/google/protobuf/wrappers.proto similarity index 100% rename from src/rust/protobuf/google/protobuf/wrappers.proto rename to src/rust/proto/google/protobuf/wrappers.proto diff --git a/src/rust/protobuf/rpc/blockchain.proto b/src/rust/proto/rpc/blockchain.proto similarity index 100% rename from src/rust/protobuf/rpc/blockchain.proto rename to src/rust/proto/rpc/blockchain.proto diff --git a/src/rust/protobuf/rpc/eth.proto b/src/rust/proto/rpc/eth.proto similarity index 100% rename from src/rust/protobuf/rpc/eth.proto rename to src/rust/proto/rpc/eth.proto diff --git a/src/rust/protobuf/types/block.proto b/src/rust/proto/types/block.proto similarity index 100% rename from src/rust/protobuf/types/block.proto rename to src/rust/proto/types/block.proto diff --git a/src/rust/protobuf/types/eth.proto b/src/rust/proto/types/eth.proto similarity index 100% rename from src/rust/protobuf/types/eth.proto rename to src/rust/proto/types/eth.proto diff --git a/src/rust/protobuf/types/tx.proto b/src/rust/proto/types/tx.proto similarity index 100% rename from src/rust/protobuf/types/tx.proto rename to src/rust/proto/types/tx.proto From cd8f9f0888d3c727ff11584df91e547804748567 Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Thu, 13 Apr 2023 15:38:06 +0800 Subject: [PATCH 2/6] cargo fix --- src/rust/ain-evm/src/block.rs | 2 +- src/rust/ain-evm/src/evm.rs | 2 +- src/rust/ain-grpc/build.rs | 7 +- src/rust/ain-grpc/src/gen/rpc.rs | 2 +- src/rust/ain-grpc/src/gen/types.rs | 1168 +++++++++++++++++++++++++++- src/rust/ain-grpc/src/rpc.rs | 3 +- src/rust/ain-grpc/src/tests.rs | 2 +- src/rust/ain-rs-exports/build.rs | 4 +- 8 files changed, 1177 insertions(+), 13 deletions(-) diff --git a/src/rust/ain-evm/src/block.rs b/src/rust/ain-evm/src/block.rs index 566b53d5a1..c21356855a 100644 --- a/src/rust/ain-evm/src/block.rs +++ b/src/rust/ain-evm/src/block.rs @@ -1,6 +1,6 @@ use crate::traits::{PersistentState, PersistentStateError}; use ethereum::BlockAny; -use primitive_types::{H256, U256}; +use primitive_types::H256; use std::collections::HashMap; use std::error::Error; use std::fs::File; diff --git a/src/rust/ain-evm/src/evm.rs b/src/rust/ain-evm/src/evm.rs index 7426c05051..81e0a67505 100644 --- a/src/rust/ain-evm/src/evm.rs +++ b/src/rust/ain-evm/src/evm.rs @@ -2,7 +2,7 @@ use crate::traits::{PersistentState, PersistentStateError}; use crate::tx_queue::TransactionQueueMap; use crate::{executor::AinExecutor, traits::Executor, transaction::SignedTx}; use anyhow::anyhow; -use ethereum::{AccessList, Block, PartialHeader, TransactionV2}; +use ethereum::{AccessList, TransactionV2}; use evm::backend::MemoryAccount; use evm::{ backend::{MemoryBackend, MemoryVicinity}, diff --git a/src/rust/ain-grpc/build.rs b/src/rust/ain-grpc/build.rs index d1a4abc08c..435f9d9d0e 100644 --- a/src/rust/ain-grpc/build.rs +++ b/src/rust/ain-grpc/build.rs @@ -1,4 +1,4 @@ -use heck::{ToLowerCamelCase, ToPascalCase, ToSnekCase}; +use heck::{ToPascalCase, ToSnekCase}; use proc_macro2::{Span, TokenStream}; use prost_build::{Config, Service, ServiceGenerator}; use quote::{quote, ToTokens}; @@ -761,10 +761,7 @@ fn get_path_bracketed_ty_simple(ty: &Type) -> Type { fn main() { let manifest_path = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()); - let proto_path = manifest_path - .parent() - .unwrap() - .join("proto"); + let proto_path = manifest_path.parent().unwrap().join("proto"); let src_path = manifest_path.join("src"); let gen_path = src_path.join("gen"); std::fs::create_dir_all(&gen_path).unwrap(); diff --git a/src/rust/ain-grpc/src/gen/rpc.rs b/src/rust/ain-grpc/src/gen/rpc.rs index 0577cba589..c023541ff3 100644 --- a/src/rust/ain-grpc/src/gen/rpc.rs +++ b/src/rust/ain-grpc/src/gen/rpc.rs @@ -745,4 +745,4 @@ pub mod eth_server { pub mod ffi { # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Transaction { pub hash : String , pub raw : RawTransaction , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct RawTransaction { pub in_active_chain : bool , pub hex : String , pub txid : String , pub hash : String , pub size : u32 , pub vsize : u32 , pub weight : u32 , pub version : u32 , pub locktime : u64 , pub vin : Vec < Vin > , pub vout : Vec < Vout > , pub blockhash : String , pub confirmations : String , pub blocktime : u64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Vin { pub txid : String , pub vout : u32 , pub script_sig : ScriptSig , pub sequence : u64 , pub txinwitness : Vec < String > , pub coinbase : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct ScriptSig { pub field_asm : String , pub hex : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Vout { pub value : f64 , pub n : u64 , pub script_pub_key : PubKey , pub token_id : u64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct PubKey { pub field_asm : String , pub hex : String , pub field_type : String , pub req_sigs : i32 , pub addresses : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Block { pub hash : String , pub confirmations : i64 , pub size : u64 , pub strippedsize : u64 , pub weight : u64 , pub height : u64 , pub version : u64 , pub version_hex : String , pub merkleroot : String , pub tx : Vec < Transaction > , pub time : u64 , pub mediantime : u64 , pub nonce : u64 , pub bits : String , pub difficulty : f64 , pub chainwork : String , pub n_tx : u32 , pub previous_block_hash : String , pub next_block_hash : String , pub masternode : String , pub minter : String , pub minted_blocks : u64 , pub stake_modifier : String , pub nonutxo : Vec < NonUtxo > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct NonUtxo { pub anchor_reward : f64 , pub burnt : f64 , pub incentive_funding : f64 , pub loan : f64 , pub options : f64 , pub unknown : f64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct BlockInput { pub blockhash : String , pub verbosity : u32 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct BlockResult { pub hash : String , pub block : Block , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct BlockHashResult { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthAccountsResult { pub accounts : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthTransactionInfo { pub from : String , pub to : String , pub gas : u64 , pub price : u64 , pub value : u64 , pub data : String , pub nonce : u64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthChainIdResult { pub id : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthBlockInfo { pub block_number : String , pub hash : String , pub parent_hash : String , pub nonce : String , pub sha3_uncles : String , pub logs_bloom : String , pub transactions_root : String , pub state_root : String , pub receipt_root : String , pub miner : String , pub difficulty : String , pub total_difficulty : String , pub extra_data : String , pub size : String , pub gas_limit : String , pub gas_used : String , pub timestamps : String , pub transactions : Vec < String > , pub uncles : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthTransactionReceipt { pub transaction_hash : String , pub transaction_index : String , pub block_hash : String , pub block_number : String , pub from : String , pub to : String , pub cumulative_gas_used : String , pub effective_gas_price : String , pub gas_used : String , pub contract_address : String , pub logs : Vec < String > , pub logs_bloom : String , pub field_type : String , pub root : String , pub status : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCallInput { pub transaction_info : EthTransactionInfo , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCallResult { pub data : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignInput { pub address : String , pub message : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignResult { pub signature : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBalanceInput { pub address : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBalanceResult { pub balance : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendTransactionInput { pub transaction_info : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendTransactionResult { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCoinBaseResult { pub address : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthMiningResult { pub is_mining : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthHashRateResult { pub hash_rate : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGasPriceResult { pub gas_price : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthBlockNumberResult { pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionCountInput { pub address : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionCountResult { pub number_transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByHashInput { pub block_hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByHashResult { pub number_transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByNumberInput { pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByNumberResult { pub number_transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockHashInput { pub block_hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockHashResult { pub number_uncles : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockNumberInput { pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockNumberResult { pub number_uncles : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetCodeInput { pub address : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetCodeResult { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignTransactionInput { pub transaction_info : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignTransactionResult { pub transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendRawTransactionInput { pub transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendRawTransactionResult { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthEstimateGasInput { pub transaction_info : EthTransactionInfo , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthEstimateGasResult { pub gas_used : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByHashInput { pub hash : String , pub full_transaction : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByHashResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByNumberInput { pub number : String , pub full_transaction : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByNumberResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByHashInput { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByHashResult { pub transaction : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockHashAndIndexInput { pub block_hash : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockHashAndIndexResult { pub transaction : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockNumberAndIndexInput { pub block_number : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockNumberAndIndexResult { pub transaction : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockHashAndIndexInput { pub block_hash : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockHashAndIndexResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockNumberAndIndexInput { pub block_number : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockNumberAndIndexResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetCompilersResult { pub compilers : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSolidityInput { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSolidityResult { pub compiled_code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileLllInput { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileLllResult { pub compiled_code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSerpentInput { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSerpentResult { pub compiled_code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthProtocolVersionResult { pub protocol_version : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Web3Sha3Input { pub data : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Web3Sha3Result { pub data : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct NetPeerCountResult { pub number_peer : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct NetVersionResult { pub network_version : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Web3ClientVersionResult { pub client_version : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetWorkResult { pub currentblock : String , pub seed_hash : String , pub target : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitWorkInput { pub nounce : String , pub pow_hash : String , pub mix_digest : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitWorkResult { pub is_valid : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitHashrateInput { pub hash_rate : String , pub id : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitHashrateResult { pub is_valid : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetStorageAtInput { pub address : String , pub position : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetStorageAtResult { pub value : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionReceiptInput { pub transaction_hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionReceiptResult { pub transaction_receipt : EthTransactionReceipt , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSyncingInfo { pub starting_block : String , pub current_block : String , pub highest_block : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSyncingResult { pub status : bool , pub sync_info : EthSyncingInfo , } extern "Rust" { type Client ; fn NewClient (addr : & str) -> Result < Box < Client >> ; # [allow (clippy :: borrowed_box)] fn CallEth_Accounts (client : & Box < Client >) -> Result < EthAccountsResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_Call (client : & Box < Client > , eth_call_input : EthCallInput) -> Result < EthCallResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_GetBalance (client : & Box < Client > , eth_get_balance_input : EthGetBalanceInput) -> Result < EthGetBalanceResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByHash (client : & Box < Client > , eth_get_block_by_hash_input : EthGetBlockByHashInput) -> Result < EthBlockInfo > ; # [allow (clippy :: borrowed_box)] fn CallEth_ChainId (client : & Box < Client >) -> Result < EthChainIdResult > ; # [allow (clippy :: borrowed_box)] fn CallNet_Version (client : & Box < Client >) -> Result < EthChainIdResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_BlockNumber (client : & Box < Client >) -> Result < EthBlockNumberResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByNumber (client : & Box < Client > , eth_get_block_by_number_input : EthGetBlockByNumberInput) -> Result < EthBlockInfo > ; # [allow (clippy :: borrowed_box)] fn CallEth_Mining (client : & Box < Client >) -> Result < EthMiningResult > ; } } -use jsonrpsee_core :: client :: ClientT ; use jsonrpsee_http_client :: { HttpClient , HttpClientBuilder } ; use std :: sync :: Arc ; use crate :: { CLIENTS } ; use ain_evm :: runtime :: RUNTIME ; use crate :: rpc :: * ; # [allow (unused_imports)] use self :: ffi :: * ; use ain_evm :: handler :: Handlers ; # [derive (Clone)] pub struct Client { inner : Arc < HttpClient > , handle : tokio :: runtime :: Handle , } # [allow (non_snake_case)] fn NewClient (addr : & str) -> Result < Box < Client > , Box < dyn std :: error :: Error >> { if CLIENTS . read () . unwrap () . get (addr) . is_none () { log :: info ! ("Initializing RPC client for {}" , addr) ; let c = Client { inner : Arc :: new (HttpClientBuilder :: default () . build (addr) ?) , handle : RUNTIME . rt_handle . clone () , } ; CLIENTS . write () . unwrap () . insert (addr . into () , c) ; } Ok (Box :: new (CLIENTS . read () . unwrap () . get (addr) . unwrap () . clone ())) } # [allow (dead_code)] fn missing_param (field : & str) -> jsonrpsee_core :: Error { jsonrpsee_core :: Error :: Call (jsonrpsee_types :: error :: CallError :: Custom (jsonrpsee_types :: ErrorObject :: borrowed (- 1 , & format ! ("Missing required parameter '{field}'") , None) . into_owned ())) } impl From < ffi :: EthGetBalanceResult > for super :: types :: EthGetBalanceResult { fn from (other : ffi :: EthGetBalanceResult) -> Self { super :: types :: EthGetBalanceResult { balance : other . balance . into () , } } } impl From < super :: types :: EthGetBalanceResult > for ffi :: EthGetBalanceResult { fn from (other : super :: types :: EthGetBalanceResult) -> Self { ffi :: EthGetBalanceResult { balance : other . balance . into () , } } } impl From < ffi :: EthGetWorkResult > for super :: types :: EthGetWorkResult { fn from (other : ffi :: EthGetWorkResult) -> Self { super :: types :: EthGetWorkResult { currentblock : other . currentblock . into () , seed_hash : other . seed_hash . into () , target : other . target . into () , } } } impl From < super :: types :: EthGetWorkResult > for ffi :: EthGetWorkResult { fn from (other : super :: types :: EthGetWorkResult) -> Self { ffi :: EthGetWorkResult { currentblock : other . currentblock . into () , seed_hash : other . seed_hash . into () , target : other . target . into () , } } } impl From < ffi :: EthGetUncleCountByBlockNumberResult > for super :: types :: EthGetUncleCountByBlockNumberResult { fn from (other : ffi :: EthGetUncleCountByBlockNumberResult) -> Self { super :: types :: EthGetUncleCountByBlockNumberResult { number_uncles : other . number_uncles . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockNumberResult > for ffi :: EthGetUncleCountByBlockNumberResult { fn from (other : super :: types :: EthGetUncleCountByBlockNumberResult) -> Self { ffi :: EthGetUncleCountByBlockNumberResult { number_uncles : other . number_uncles . into () , } } } impl From < ffi :: BlockResult > for super :: types :: BlockResult { fn from (other : ffi :: BlockResult) -> Self { super :: types :: BlockResult { hash : other . hash . into () , block : Some (other . block . into ()) , } } } impl From < super :: types :: BlockResult > for ffi :: BlockResult { fn from (other : super :: types :: BlockResult) -> Self { ffi :: BlockResult { hash : other . hash . into () , block : other . block . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthEstimateGasInput > for super :: types :: EthEstimateGasInput { fn from (other : ffi :: EthEstimateGasInput) -> Self { super :: types :: EthEstimateGasInput { transaction_info : Some (other . transaction_info . into ()) , block_number : Some (other . block_number . into ()) , } } } impl From < super :: types :: EthEstimateGasInput > for ffi :: EthEstimateGasInput { fn from (other : super :: types :: EthEstimateGasInput) -> Self { ffi :: EthEstimateGasInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , block_number : other . block_number . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: BlockHashResult > for super :: types :: BlockHashResult { fn from (other : ffi :: BlockHashResult) -> Self { super :: types :: BlockHashResult { hash : other . hash . into () , } } } impl From < super :: types :: BlockHashResult > for ffi :: BlockHashResult { fn from (other : super :: types :: BlockHashResult) -> Self { ffi :: BlockHashResult { hash : other . hash . into () , } } } impl From < ffi :: EthGetUncleByBlockNumberAndIndexInput > for super :: types :: EthGetUncleByBlockNumberAndIndexInput { fn from (other : ffi :: EthGetUncleByBlockNumberAndIndexInput) -> Self { super :: types :: EthGetUncleByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetUncleByBlockNumberAndIndexInput > for ffi :: EthGetUncleByBlockNumberAndIndexInput { fn from (other : super :: types :: EthGetUncleByBlockNumberAndIndexInput) -> Self { ffi :: EthGetUncleByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < ffi :: EthSubmitWorkInput > for super :: types :: EthSubmitWorkInput { fn from (other : ffi :: EthSubmitWorkInput) -> Self { super :: types :: EthSubmitWorkInput { nounce : other . nounce . into () , pow_hash : other . pow_hash . into () , mix_digest : other . mix_digest . into () , } } } impl From < super :: types :: EthSubmitWorkInput > for ffi :: EthSubmitWorkInput { fn from (other : super :: types :: EthSubmitWorkInput) -> Self { ffi :: EthSubmitWorkInput { nounce : other . nounce . into () , pow_hash : other . pow_hash . into () , mix_digest : other . mix_digest . into () , } } } impl From < ffi :: EthCallResult > for super :: types :: EthCallResult { fn from (other : ffi :: EthCallResult) -> Self { super :: types :: EthCallResult { data : other . data . into () , } } } impl From < super :: types :: EthCallResult > for ffi :: EthCallResult { fn from (other : super :: types :: EthCallResult) -> Self { ffi :: EthCallResult { data : other . data . into () , } } } impl From < ffi :: EthSyncingResult > for super :: types :: EthSyncingResult { fn from (other : ffi :: EthSyncingResult) -> Self { super :: types :: EthSyncingResult { status : Some (other . status . into ()) , sync_info : Some (other . sync_info . into ()) , } } } impl From < super :: types :: EthSyncingResult > for ffi :: EthSyncingResult { fn from (other : super :: types :: EthSyncingResult) -> Self { ffi :: EthSyncingResult { status : other . status . map (Into :: into) . unwrap_or_default () , sync_info : other . sync_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetUncleCountByBlockHashResult > for super :: types :: EthGetUncleCountByBlockHashResult { fn from (other : ffi :: EthGetUncleCountByBlockHashResult) -> Self { super :: types :: EthGetUncleCountByBlockHashResult { number_uncles : other . number_uncles . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockHashResult > for ffi :: EthGetUncleCountByBlockHashResult { fn from (other : super :: types :: EthGetUncleCountByBlockHashResult) -> Self { ffi :: EthGetUncleCountByBlockHashResult { number_uncles : other . number_uncles . into () , } } } impl From < ffi :: EthGetBlockTransactionCountByHashInput > for super :: types :: EthGetBlockTransactionCountByHashInput { fn from (other : ffi :: EthGetBlockTransactionCountByHashInput) -> Self { super :: types :: EthGetBlockTransactionCountByHashInput { block_hash : other . block_hash . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByHashInput > for ffi :: EthGetBlockTransactionCountByHashInput { fn from (other : super :: types :: EthGetBlockTransactionCountByHashInput) -> Self { ffi :: EthGetBlockTransactionCountByHashInput { block_hash : other . block_hash . into () , } } } impl From < ffi :: BlockInput > for super :: types :: BlockInput { fn from (other : ffi :: BlockInput) -> Self { super :: types :: BlockInput { blockhash : other . blockhash . into () , verbosity : other . verbosity . into () , } } } impl From < super :: types :: BlockInput > for ffi :: BlockInput { fn from (other : super :: types :: BlockInput) -> Self { ffi :: BlockInput { blockhash : other . blockhash . into () , verbosity : other . verbosity . into () , } } } impl From < ffi :: EthSubmitWorkResult > for super :: types :: EthSubmitWorkResult { fn from (other : ffi :: EthSubmitWorkResult) -> Self { super :: types :: EthSubmitWorkResult { is_valid : other . is_valid . into () , } } } impl From < super :: types :: EthSubmitWorkResult > for ffi :: EthSubmitWorkResult { fn from (other : super :: types :: EthSubmitWorkResult) -> Self { ffi :: EthSubmitWorkResult { is_valid : other . is_valid . into () , } } } impl From < ffi :: EthGetTransactionReceiptResult > for super :: types :: EthGetTransactionReceiptResult { fn from (other : ffi :: EthGetTransactionReceiptResult) -> Self { super :: types :: EthGetTransactionReceiptResult { transaction_receipt : Some (other . transaction_receipt . into ()) , } } } impl From < super :: types :: EthGetTransactionReceiptResult > for ffi :: EthGetTransactionReceiptResult { fn from (other : super :: types :: EthGetTransactionReceiptResult) -> Self { ffi :: EthGetTransactionReceiptResult { transaction_receipt : other . transaction_receipt . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetTransactionCountResult > for super :: types :: EthGetTransactionCountResult { fn from (other : ffi :: EthGetTransactionCountResult) -> Self { super :: types :: EthGetTransactionCountResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetTransactionCountResult > for ffi :: EthGetTransactionCountResult { fn from (other : super :: types :: EthGetTransactionCountResult) -> Self { ffi :: EthGetTransactionCountResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: NetVersionResult > for super :: types :: NetVersionResult { fn from (other : ffi :: NetVersionResult) -> Self { super :: types :: NetVersionResult { network_version : other . network_version . into () , } } } impl From < super :: types :: NetVersionResult > for ffi :: NetVersionResult { fn from (other : super :: types :: NetVersionResult) -> Self { ffi :: NetVersionResult { network_version : other . network_version . into () , } } } impl From < ffi :: Block > for super :: types :: Block { fn from (other : ffi :: Block) -> Self { super :: types :: Block { hash : other . hash . into () , confirmations : other . confirmations . into () , size : other . size . into () , strippedsize : other . strippedsize . into () , weight : other . weight . into () , height : other . height . into () , version : other . version . into () , version_hex : other . version_hex . into () , merkleroot : other . merkleroot . into () , tx : other . tx . into_iter () . map (Into :: into) . collect () , time : other . time . into () , mediantime : other . mediantime . into () , nonce : other . nonce . into () , bits : other . bits . into () , difficulty : other . difficulty . into () , chainwork : other . chainwork . into () , n_tx : other . n_tx . into () , previous_block_hash : other . previous_block_hash . into () , next_block_hash : other . next_block_hash . into () , masternode : other . masternode . into () , minter : other . minter . into () , minted_blocks : other . minted_blocks . into () , stake_modifier : other . stake_modifier . into () , nonutxo : other . nonutxo . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: Block > for ffi :: Block { fn from (other : super :: types :: Block) -> Self { ffi :: Block { hash : other . hash . into () , confirmations : other . confirmations . into () , size : other . size . into () , strippedsize : other . strippedsize . into () , weight : other . weight . into () , height : other . height . into () , version : other . version . into () , version_hex : other . version_hex . into () , merkleroot : other . merkleroot . into () , tx : other . tx . into_iter () . map (Into :: into) . collect () , time : other . time . into () , mediantime : other . mediantime . into () , nonce : other . nonce . into () , bits : other . bits . into () , difficulty : other . difficulty . into () , chainwork : other . chainwork . into () , n_tx : other . n_tx . into () , previous_block_hash : other . previous_block_hash . into () , next_block_hash : other . next_block_hash . into () , masternode : other . masternode . into () , minter : other . minter . into () , minted_blocks : other . minted_blocks . into () , stake_modifier : other . stake_modifier . into () , nonutxo : other . nonutxo . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: Transaction > for super :: types :: Transaction { fn from (other : ffi :: Transaction) -> Self { super :: types :: Transaction { hash : other . hash . into () , raw : Some (other . raw . into ()) , } } } impl From < super :: types :: Transaction > for ffi :: Transaction { fn from (other : super :: types :: Transaction) -> Self { ffi :: Transaction { hash : other . hash . into () , raw : other . raw . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetTransactionByHashInput > for super :: types :: EthGetTransactionByHashInput { fn from (other : ffi :: EthGetTransactionByHashInput) -> Self { super :: types :: EthGetTransactionByHashInput { hash : other . hash . into () , } } } impl From < super :: types :: EthGetTransactionByHashInput > for ffi :: EthGetTransactionByHashInput { fn from (other : super :: types :: EthGetTransactionByHashInput) -> Self { ffi :: EthGetTransactionByHashInput { hash : other . hash . into () , } } } impl From < ffi :: EthGetBlockByNumberInput > for super :: types :: EthGetBlockByNumberInput { fn from (other : ffi :: EthGetBlockByNumberInput) -> Self { super :: types :: EthGetBlockByNumberInput { number : other . number . into () , full_transaction : other . full_transaction . into () , } } } impl From < super :: types :: EthGetBlockByNumberInput > for ffi :: EthGetBlockByNumberInput { fn from (other : super :: types :: EthGetBlockByNumberInput) -> Self { ffi :: EthGetBlockByNumberInput { number : other . number . into () , full_transaction : other . full_transaction . into () , } } } impl From < ffi :: Vin > for super :: types :: Vin { fn from (other : ffi :: Vin) -> Self { super :: types :: Vin { txid : other . txid . into () , vout : other . vout . into () , script_sig : Some (other . script_sig . into ()) , sequence : other . sequence . into () , txinwitness : other . txinwitness . into_iter () . map (Into :: into) . collect () , coinbase : other . coinbase . into () , } } } impl From < super :: types :: Vin > for ffi :: Vin { fn from (other : super :: types :: Vin) -> Self { ffi :: Vin { txid : other . txid . into () , vout : other . vout . into () , script_sig : other . script_sig . map (Into :: into) . unwrap_or_default () , sequence : other . sequence . into () , txinwitness : other . txinwitness . into_iter () . map (Into :: into) . collect () , coinbase : other . coinbase . into () , } } } impl From < ffi :: EthChainIdResult > for super :: types :: EthChainIdResult { fn from (other : ffi :: EthChainIdResult) -> Self { super :: types :: EthChainIdResult { id : other . id . into () , } } } impl From < super :: types :: EthChainIdResult > for ffi :: EthChainIdResult { fn from (other : super :: types :: EthChainIdResult) -> Self { ffi :: EthChainIdResult { id : other . id . into () , } } } impl From < ffi :: EthCompileSerpentResult > for super :: types :: EthCompileSerpentResult { fn from (other : ffi :: EthCompileSerpentResult) -> Self { super :: types :: EthCompileSerpentResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileSerpentResult > for ffi :: EthCompileSerpentResult { fn from (other : super :: types :: EthCompileSerpentResult) -> Self { ffi :: EthCompileSerpentResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: Vout > for super :: types :: Vout { fn from (other : ffi :: Vout) -> Self { super :: types :: Vout { value : other . value . into () , n : other . n . into () , script_pub_key : Some (other . script_pub_key . into ()) , token_id : other . token_id . into () , } } } impl From < super :: types :: Vout > for ffi :: Vout { fn from (other : super :: types :: Vout) -> Self { ffi :: Vout { value : other . value . into () , n : other . n . into () , script_pub_key : other . script_pub_key . map (Into :: into) . unwrap_or_default () , token_id : other . token_id . into () , } } } impl From < ffi :: EthBlockNumberResult > for super :: types :: EthBlockNumberResult { fn from (other : ffi :: EthBlockNumberResult) -> Self { super :: types :: EthBlockNumberResult { block_number : other . block_number . into () , } } } impl From < super :: types :: EthBlockNumberResult > for ffi :: EthBlockNumberResult { fn from (other : super :: types :: EthBlockNumberResult) -> Self { ffi :: EthBlockNumberResult { block_number : other . block_number . into () , } } } impl From < ffi :: EthGetBlockTransactionCountByHashResult > for super :: types :: EthGetBlockTransactionCountByHashResult { fn from (other : ffi :: EthGetBlockTransactionCountByHashResult) -> Self { super :: types :: EthGetBlockTransactionCountByHashResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByHashResult > for ffi :: EthGetBlockTransactionCountByHashResult { fn from (other : super :: types :: EthGetBlockTransactionCountByHashResult) -> Self { ffi :: EthGetBlockTransactionCountByHashResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: PubKey > for super :: types :: PubKey { fn from (other : ffi :: PubKey) -> Self { super :: types :: PubKey { field_asm : other . field_asm . into () , hex : other . hex . into () , field_type : other . field_type . into () , req_sigs : other . req_sigs . into () , addresses : other . addresses . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: PubKey > for ffi :: PubKey { fn from (other : super :: types :: PubKey) -> Self { ffi :: PubKey { field_asm : other . field_asm . into () , hex : other . hex . into () , field_type : other . field_type . into () , req_sigs : other . req_sigs . into () , addresses : other . addresses . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetBlockTransactionCountByNumberInput > for super :: types :: EthGetBlockTransactionCountByNumberInput { fn from (other : ffi :: EthGetBlockTransactionCountByNumberInput) -> Self { super :: types :: EthGetBlockTransactionCountByNumberInput { block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByNumberInput > for ffi :: EthGetBlockTransactionCountByNumberInput { fn from (other : super :: types :: EthGetBlockTransactionCountByNumberInput) -> Self { ffi :: EthGetBlockTransactionCountByNumberInput { block_number : other . block_number . into () , } } } impl From < ffi :: EthSendRawTransactionResult > for super :: types :: EthSendRawTransactionResult { fn from (other : ffi :: EthSendRawTransactionResult) -> Self { super :: types :: EthSendRawTransactionResult { hash : other . hash . into () , } } } impl From < super :: types :: EthSendRawTransactionResult > for ffi :: EthSendRawTransactionResult { fn from (other : super :: types :: EthSendRawTransactionResult) -> Self { ffi :: EthSendRawTransactionResult { hash : other . hash . into () , } } } impl From < ffi :: EthGetBlockByHashResult > for super :: types :: EthGetBlockByHashResult { fn from (other : ffi :: EthGetBlockByHashResult) -> Self { super :: types :: EthGetBlockByHashResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetBlockByHashResult > for ffi :: EthGetBlockByHashResult { fn from (other : super :: types :: EthGetBlockByHashResult) -> Self { ffi :: EthGetBlockByHashResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetTransactionByBlockHashAndIndexResult > for super :: types :: EthGetTransactionByBlockHashAndIndexResult { fn from (other : ffi :: EthGetTransactionByBlockHashAndIndexResult) -> Self { super :: types :: EthGetTransactionByBlockHashAndIndexResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByBlockHashAndIndexResult > for ffi :: EthGetTransactionByBlockHashAndIndexResult { fn from (other : super :: types :: EthGetTransactionByBlockHashAndIndexResult) -> Self { ffi :: EthGetTransactionByBlockHashAndIndexResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetTransactionByBlockNumberAndIndexResult > for super :: types :: EthGetTransactionByBlockNumberAndIndexResult { fn from (other : ffi :: EthGetTransactionByBlockNumberAndIndexResult) -> Self { super :: types :: EthGetTransactionByBlockNumberAndIndexResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByBlockNumberAndIndexResult > for ffi :: EthGetTransactionByBlockNumberAndIndexResult { fn from (other : super :: types :: EthGetTransactionByBlockNumberAndIndexResult) -> Self { ffi :: EthGetTransactionByBlockNumberAndIndexResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetUncleByBlockHashAndIndexInput > for super :: types :: EthGetUncleByBlockHashAndIndexInput { fn from (other : ffi :: EthGetUncleByBlockHashAndIndexInput) -> Self { super :: types :: EthGetUncleByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetUncleByBlockHashAndIndexInput > for ffi :: EthGetUncleByBlockHashAndIndexInput { fn from (other : super :: types :: EthGetUncleByBlockHashAndIndexInput) -> Self { ffi :: EthGetUncleByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < ffi :: EthCompileLllResult > for super :: types :: EthCompileLllResult { fn from (other : ffi :: EthCompileLllResult) -> Self { super :: types :: EthCompileLllResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileLllResult > for ffi :: EthCompileLllResult { fn from (other : super :: types :: EthCompileLllResult) -> Self { ffi :: EthCompileLllResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: Web3Sha3Result > for super :: types :: Web3Sha3Result { fn from (other : ffi :: Web3Sha3Result) -> Self { super :: types :: Web3Sha3Result { data : other . data . into () , } } } impl From < super :: types :: Web3Sha3Result > for ffi :: Web3Sha3Result { fn from (other : super :: types :: Web3Sha3Result) -> Self { ffi :: Web3Sha3Result { data : other . data . into () , } } } impl From < ffi :: EthGetTransactionReceiptInput > for super :: types :: EthGetTransactionReceiptInput { fn from (other : ffi :: EthGetTransactionReceiptInput) -> Self { super :: types :: EthGetTransactionReceiptInput { transaction_hash : other . transaction_hash . into () , } } } impl From < super :: types :: EthGetTransactionReceiptInput > for ffi :: EthGetTransactionReceiptInput { fn from (other : super :: types :: EthGetTransactionReceiptInput) -> Self { ffi :: EthGetTransactionReceiptInput { transaction_hash : other . transaction_hash . into () , } } } impl From < ffi :: EthTransactionInfo > for super :: types :: EthTransactionInfo { fn from (other : ffi :: EthTransactionInfo) -> Self { super :: types :: EthTransactionInfo { from : Some (other . from . into ()) , to : Some (other . to . into ()) , gas : Some (other . gas . into ()) , price : Some (other . price . into ()) , value : Some (other . value . into ()) , data : Some (other . data . into ()) , nonce : Some (other . nonce . into ()) , } } } impl From < super :: types :: EthTransactionInfo > for ffi :: EthTransactionInfo { fn from (other : super :: types :: EthTransactionInfo) -> Self { ffi :: EthTransactionInfo { from : other . from . map (Into :: into) . unwrap_or_default () , to : other . to . map (Into :: into) . unwrap_or_default () , gas : other . gas . map (Into :: into) . unwrap_or_default () , price : other . price . map (Into :: into) . unwrap_or_default () , value : other . value . map (Into :: into) . unwrap_or_default () , data : other . data . map (Into :: into) . unwrap_or_default () , nonce : other . nonce . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthSignTransactionResult > for super :: types :: EthSignTransactionResult { fn from (other : ffi :: EthSignTransactionResult) -> Self { super :: types :: EthSignTransactionResult { transaction : other . transaction . into () , } } } impl From < super :: types :: EthSignTransactionResult > for ffi :: EthSignTransactionResult { fn from (other : super :: types :: EthSignTransactionResult) -> Self { ffi :: EthSignTransactionResult { transaction : other . transaction . into () , } } } impl From < ffi :: EthProtocolVersionResult > for super :: types :: EthProtocolVersionResult { fn from (other : ffi :: EthProtocolVersionResult) -> Self { super :: types :: EthProtocolVersionResult { protocol_version : other . protocol_version . into () , } } } impl From < super :: types :: EthProtocolVersionResult > for ffi :: EthProtocolVersionResult { fn from (other : super :: types :: EthProtocolVersionResult) -> Self { ffi :: EthProtocolVersionResult { protocol_version : other . protocol_version . into () , } } } impl From < ffi :: NonUtxo > for super :: types :: NonUtxo { fn from (other : ffi :: NonUtxo) -> Self { super :: types :: NonUtxo { anchor_reward : other . anchor_reward . into () , burnt : other . burnt . into () , incentive_funding : other . incentive_funding . into () , loan : other . loan . into () , options : other . options . into () , unknown : other . unknown . into () , } } } impl From < super :: types :: NonUtxo > for ffi :: NonUtxo { fn from (other : super :: types :: NonUtxo) -> Self { ffi :: NonUtxo { anchor_reward : other . anchor_reward . into () , burnt : other . burnt . into () , incentive_funding : other . incentive_funding . into () , loan : other . loan . into () , options : other . options . into () , unknown : other . unknown . into () , } } } impl From < ffi :: EthEstimateGasResult > for super :: types :: EthEstimateGasResult { fn from (other : ffi :: EthEstimateGasResult) -> Self { super :: types :: EthEstimateGasResult { gas_used : other . gas_used . into () , } } } impl From < super :: types :: EthEstimateGasResult > for ffi :: EthEstimateGasResult { fn from (other : super :: types :: EthEstimateGasResult) -> Self { ffi :: EthEstimateGasResult { gas_used : other . gas_used . into () , } } } impl From < ffi :: EthGetBalanceInput > for super :: types :: EthGetBalanceInput { fn from (other : ffi :: EthGetBalanceInput) -> Self { super :: types :: EthGetBalanceInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetBalanceInput > for ffi :: EthGetBalanceInput { fn from (other : super :: types :: EthGetBalanceInput) -> Self { ffi :: EthGetBalanceInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthSignInput > for super :: types :: EthSignInput { fn from (other : ffi :: EthSignInput) -> Self { super :: types :: EthSignInput { address : other . address . into () , message : other . message . into () , } } } impl From < super :: types :: EthSignInput > for ffi :: EthSignInput { fn from (other : super :: types :: EthSignInput) -> Self { ffi :: EthSignInput { address : other . address . into () , message : other . message . into () , } } } impl From < ffi :: EthGetTransactionByHashResult > for super :: types :: EthGetTransactionByHashResult { fn from (other : ffi :: EthGetTransactionByHashResult) -> Self { super :: types :: EthGetTransactionByHashResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByHashResult > for ffi :: EthGetTransactionByHashResult { fn from (other : super :: types :: EthGetTransactionByHashResult) -> Self { ffi :: EthGetTransactionByHashResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetBlockByNumberResult > for super :: types :: EthGetBlockByNumberResult { fn from (other : ffi :: EthGetBlockByNumberResult) -> Self { super :: types :: EthGetBlockByNumberResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetBlockByNumberResult > for ffi :: EthGetBlockByNumberResult { fn from (other : super :: types :: EthGetBlockByNumberResult) -> Self { ffi :: EthGetBlockByNumberResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: Web3ClientVersionResult > for super :: types :: Web3ClientVersionResult { fn from (other : ffi :: Web3ClientVersionResult) -> Self { super :: types :: Web3ClientVersionResult { client_version : other . client_version . into () , } } } impl From < super :: types :: Web3ClientVersionResult > for ffi :: Web3ClientVersionResult { fn from (other : super :: types :: Web3ClientVersionResult) -> Self { ffi :: Web3ClientVersionResult { client_version : other . client_version . into () , } } } impl From < ffi :: EthSignTransactionInput > for super :: types :: EthSignTransactionInput { fn from (other : ffi :: EthSignTransactionInput) -> Self { super :: types :: EthSignTransactionInput { transaction_info : Some (other . transaction_info . into ()) , } } } impl From < super :: types :: EthSignTransactionInput > for ffi :: EthSignTransactionInput { fn from (other : super :: types :: EthSignTransactionInput) -> Self { ffi :: EthSignTransactionInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetUncleCountByBlockNumberInput > for super :: types :: EthGetUncleCountByBlockNumberInput { fn from (other : ffi :: EthGetUncleCountByBlockNumberInput) -> Self { super :: types :: EthGetUncleCountByBlockNumberInput { block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockNumberInput > for ffi :: EthGetUncleCountByBlockNumberInput { fn from (other : super :: types :: EthGetUncleCountByBlockNumberInput) -> Self { ffi :: EthGetUncleCountByBlockNumberInput { block_number : other . block_number . into () , } } } impl From < ffi :: EthCompileLllInput > for super :: types :: EthCompileLllInput { fn from (other : ffi :: EthCompileLllInput) -> Self { super :: types :: EthCompileLllInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileLllInput > for ffi :: EthCompileLllInput { fn from (other : super :: types :: EthCompileLllInput) -> Self { ffi :: EthCompileLllInput { code : other . code . into () , } } } impl From < ffi :: EthGetUncleByBlockHashAndIndexResult > for super :: types :: EthGetUncleByBlockHashAndIndexResult { fn from (other : ffi :: EthGetUncleByBlockHashAndIndexResult) -> Self { super :: types :: EthGetUncleByBlockHashAndIndexResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetUncleByBlockHashAndIndexResult > for ffi :: EthGetUncleByBlockHashAndIndexResult { fn from (other : super :: types :: EthGetUncleByBlockHashAndIndexResult) -> Self { ffi :: EthGetUncleByBlockHashAndIndexResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthSyncingInfo > for super :: types :: EthSyncingInfo { fn from (other : ffi :: EthSyncingInfo) -> Self { super :: types :: EthSyncingInfo { starting_block : other . starting_block . into () , current_block : other . current_block . into () , highest_block : other . highest_block . into () , } } } impl From < super :: types :: EthSyncingInfo > for ffi :: EthSyncingInfo { fn from (other : super :: types :: EthSyncingInfo) -> Self { ffi :: EthSyncingInfo { starting_block : other . starting_block . into () , current_block : other . current_block . into () , highest_block : other . highest_block . into () , } } } impl From < ffi :: EthSendTransactionResult > for super :: types :: EthSendTransactionResult { fn from (other : ffi :: EthSendTransactionResult) -> Self { super :: types :: EthSendTransactionResult { hash : other . hash . into () , } } } impl From < super :: types :: EthSendTransactionResult > for ffi :: EthSendTransactionResult { fn from (other : super :: types :: EthSendTransactionResult) -> Self { ffi :: EthSendTransactionResult { hash : other . hash . into () , } } } impl From < ffi :: EthGetBlockTransactionCountByNumberResult > for super :: types :: EthGetBlockTransactionCountByNumberResult { fn from (other : ffi :: EthGetBlockTransactionCountByNumberResult) -> Self { super :: types :: EthGetBlockTransactionCountByNumberResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByNumberResult > for ffi :: EthGetBlockTransactionCountByNumberResult { fn from (other : super :: types :: EthGetBlockTransactionCountByNumberResult) -> Self { ffi :: EthGetBlockTransactionCountByNumberResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: EthBlockInfo > for super :: types :: EthBlockInfo { fn from (other : ffi :: EthBlockInfo) -> Self { super :: types :: EthBlockInfo { block_number : other . block_number . into () , hash : other . hash . into () , parent_hash : other . parent_hash . into () , nonce : other . nonce . into () , sha3_uncles : other . sha3_uncles . into () , logs_bloom : other . logs_bloom . into () , transactions_root : other . transactions_root . into () , state_root : other . state_root . into () , receipt_root : other . receipt_root . into () , miner : other . miner . into () , difficulty : other . difficulty . into () , total_difficulty : other . total_difficulty . into () , extra_data : other . extra_data . into () , size : other . size . into () , gas_limit : other . gas_limit . into () , gas_used : other . gas_used . into () , timestamps : other . timestamps . into () , transactions : other . transactions . into_iter () . map (Into :: into) . collect () , uncles : other . uncles . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthBlockInfo > for ffi :: EthBlockInfo { fn from (other : super :: types :: EthBlockInfo) -> Self { ffi :: EthBlockInfo { block_number : other . block_number . into () , hash : other . hash . into () , parent_hash : other . parent_hash . into () , nonce : other . nonce . into () , sha3_uncles : other . sha3_uncles . into () , logs_bloom : other . logs_bloom . into () , transactions_root : other . transactions_root . into () , state_root : other . state_root . into () , receipt_root : other . receipt_root . into () , miner : other . miner . into () , difficulty : other . difficulty . into () , total_difficulty : other . total_difficulty . into () , extra_data : other . extra_data . into () , size : other . size . into () , gas_limit : other . gas_limit . into () , gas_used : other . gas_used . into () , timestamps : other . timestamps . into () , transactions : other . transactions . into_iter () . map (Into :: into) . collect () , uncles : other . uncles . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthTransactionReceipt > for super :: types :: EthTransactionReceipt { fn from (other : ffi :: EthTransactionReceipt) -> Self { super :: types :: EthTransactionReceipt { transaction_hash : other . transaction_hash . into () , transaction_index : other . transaction_index . into () , block_hash : other . block_hash . into () , block_number : other . block_number . into () , from : other . from . into () , to : other . to . into () , cumulative_gas_used : other . cumulative_gas_used . into () , effective_gas_price : other . effective_gas_price . into () , gas_used : other . gas_used . into () , contract_address : other . contract_address . into () , logs : other . logs . into_iter () . map (Into :: into) . collect () , logs_bloom : other . logs_bloom . into () , field_type : other . field_type . into () , root : Some (other . root . into ()) , status : Some (other . status . into ()) , } } } impl From < super :: types :: EthTransactionReceipt > for ffi :: EthTransactionReceipt { fn from (other : super :: types :: EthTransactionReceipt) -> Self { ffi :: EthTransactionReceipt { transaction_hash : other . transaction_hash . into () , transaction_index : other . transaction_index . into () , block_hash : other . block_hash . into () , block_number : other . block_number . into () , from : other . from . into () , to : other . to . into () , cumulative_gas_used : other . cumulative_gas_used . into () , effective_gas_price : other . effective_gas_price . into () , gas_used : other . gas_used . into () , contract_address : other . contract_address . into () , logs : other . logs . into_iter () . map (Into :: into) . collect () , logs_bloom : other . logs_bloom . into () , field_type : other . field_type . into () , root : other . root . map (Into :: into) . unwrap_or_default () , status : other . status . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: RawTransaction > for super :: types :: RawTransaction { fn from (other : ffi :: RawTransaction) -> Self { super :: types :: RawTransaction { in_active_chain : other . in_active_chain . into () , hex : other . hex . into () , txid : other . txid . into () , hash : other . hash . into () , size : other . size . into () , vsize : other . vsize . into () , weight : other . weight . into () , version : other . version . into () , locktime : other . locktime . into () , vin : other . vin . into_iter () . map (Into :: into) . collect () , vout : other . vout . into_iter () . map (Into :: into) . collect () , blockhash : other . blockhash . into () , confirmations : other . confirmations . into () , blocktime : other . blocktime . into () , } } } impl From < super :: types :: RawTransaction > for ffi :: RawTransaction { fn from (other : super :: types :: RawTransaction) -> Self { ffi :: RawTransaction { in_active_chain : other . in_active_chain . into () , hex : other . hex . into () , txid : other . txid . into () , hash : other . hash . into () , size : other . size . into () , vsize : other . vsize . into () , weight : other . weight . into () , version : other . version . into () , locktime : other . locktime . into () , vin : other . vin . into_iter () . map (Into :: into) . collect () , vout : other . vout . into_iter () . map (Into :: into) . collect () , blockhash : other . blockhash . into () , confirmations : other . confirmations . into () , blocktime : other . blocktime . into () , } } } impl From < ffi :: EthSignResult > for super :: types :: EthSignResult { fn from (other : ffi :: EthSignResult) -> Self { super :: types :: EthSignResult { signature : other . signature . into () , } } } impl From < super :: types :: EthSignResult > for ffi :: EthSignResult { fn from (other : super :: types :: EthSignResult) -> Self { ffi :: EthSignResult { signature : other . signature . into () , } } } impl From < ffi :: EthGetTransactionByBlockNumberAndIndexInput > for super :: types :: EthGetTransactionByBlockNumberAndIndexInput { fn from (other : ffi :: EthGetTransactionByBlockNumberAndIndexInput) -> Self { super :: types :: EthGetTransactionByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetTransactionByBlockNumberAndIndexInput > for ffi :: EthGetTransactionByBlockNumberAndIndexInput { fn from (other : super :: types :: EthGetTransactionByBlockNumberAndIndexInput) -> Self { ffi :: EthGetTransactionByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < ffi :: EthGetStorageAtResult > for super :: types :: EthGetStorageAtResult { fn from (other : ffi :: EthGetStorageAtResult) -> Self { super :: types :: EthGetStorageAtResult { value : other . value . into () , } } } impl From < super :: types :: EthGetStorageAtResult > for ffi :: EthGetStorageAtResult { fn from (other : super :: types :: EthGetStorageAtResult) -> Self { ffi :: EthGetStorageAtResult { value : other . value . into () , } } } impl From < ffi :: EthCallInput > for super :: types :: EthCallInput { fn from (other : ffi :: EthCallInput) -> Self { super :: types :: EthCallInput { transaction_info : Some (other . transaction_info . into ()) , block_number : other . block_number . into () , } } } impl From < super :: types :: EthCallInput > for ffi :: EthCallInput { fn from (other : super :: types :: EthCallInput) -> Self { ffi :: EthCallInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , block_number : other . block_number . into () , } } } impl From < ffi :: EthCoinBaseResult > for super :: types :: EthCoinBaseResult { fn from (other : ffi :: EthCoinBaseResult) -> Self { super :: types :: EthCoinBaseResult { address : other . address . into () , } } } impl From < super :: types :: EthCoinBaseResult > for ffi :: EthCoinBaseResult { fn from (other : super :: types :: EthCoinBaseResult) -> Self { ffi :: EthCoinBaseResult { address : other . address . into () , } } } impl From < ffi :: EthSendTransactionInput > for super :: types :: EthSendTransactionInput { fn from (other : ffi :: EthSendTransactionInput) -> Self { super :: types :: EthSendTransactionInput { transaction_info : Some (other . transaction_info . into ()) , } } } impl From < super :: types :: EthSendTransactionInput > for ffi :: EthSendTransactionInput { fn from (other : super :: types :: EthSendTransactionInput) -> Self { ffi :: EthSendTransactionInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetCodeInput > for super :: types :: EthGetCodeInput { fn from (other : ffi :: EthGetCodeInput) -> Self { super :: types :: EthGetCodeInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetCodeInput > for ffi :: EthGetCodeInput { fn from (other : super :: types :: EthGetCodeInput) -> Self { ffi :: EthGetCodeInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthCompileSolidityInput > for super :: types :: EthCompileSolidityInput { fn from (other : ffi :: EthCompileSolidityInput) -> Self { super :: types :: EthCompileSolidityInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileSolidityInput > for ffi :: EthCompileSolidityInput { fn from (other : super :: types :: EthCompileSolidityInput) -> Self { ffi :: EthCompileSolidityInput { code : other . code . into () , } } } impl From < ffi :: ScriptSig > for super :: types :: ScriptSig { fn from (other : ffi :: ScriptSig) -> Self { super :: types :: ScriptSig { field_asm : other . field_asm . into () , hex : other . hex . into () , } } } impl From < super :: types :: ScriptSig > for ffi :: ScriptSig { fn from (other : super :: types :: ScriptSig) -> Self { ffi :: ScriptSig { field_asm : other . field_asm . into () , hex : other . hex . into () , } } } impl From < ffi :: EthGetCodeResult > for super :: types :: EthGetCodeResult { fn from (other : ffi :: EthGetCodeResult) -> Self { super :: types :: EthGetCodeResult { code : other . code . into () , } } } impl From < super :: types :: EthGetCodeResult > for ffi :: EthGetCodeResult { fn from (other : super :: types :: EthGetCodeResult) -> Self { ffi :: EthGetCodeResult { code : other . code . into () , } } } impl From < ffi :: EthSubmitHashrateResult > for super :: types :: EthSubmitHashrateResult { fn from (other : ffi :: EthSubmitHashrateResult) -> Self { super :: types :: EthSubmitHashrateResult { is_valid : other . is_valid . into () , } } } impl From < super :: types :: EthSubmitHashrateResult > for ffi :: EthSubmitHashrateResult { fn from (other : super :: types :: EthSubmitHashrateResult) -> Self { ffi :: EthSubmitHashrateResult { is_valid : other . is_valid . into () , } } } impl From < ffi :: EthGetUncleByBlockNumberAndIndexResult > for super :: types :: EthGetUncleByBlockNumberAndIndexResult { fn from (other : ffi :: EthGetUncleByBlockNumberAndIndexResult) -> Self { super :: types :: EthGetUncleByBlockNumberAndIndexResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetUncleByBlockNumberAndIndexResult > for ffi :: EthGetUncleByBlockNumberAndIndexResult { fn from (other : super :: types :: EthGetUncleByBlockNumberAndIndexResult) -> Self { ffi :: EthGetUncleByBlockNumberAndIndexResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthHashRateResult > for super :: types :: EthHashRateResult { fn from (other : ffi :: EthHashRateResult) -> Self { super :: types :: EthHashRateResult { hash_rate : other . hash_rate . into () , } } } impl From < super :: types :: EthHashRateResult > for ffi :: EthHashRateResult { fn from (other : super :: types :: EthHashRateResult) -> Self { ffi :: EthHashRateResult { hash_rate : other . hash_rate . into () , } } } impl From < ffi :: EthGetTransactionCountInput > for super :: types :: EthGetTransactionCountInput { fn from (other : ffi :: EthGetTransactionCountInput) -> Self { super :: types :: EthGetTransactionCountInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetTransactionCountInput > for ffi :: EthGetTransactionCountInput { fn from (other : super :: types :: EthGetTransactionCountInput) -> Self { ffi :: EthGetTransactionCountInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthCompileSolidityResult > for super :: types :: EthCompileSolidityResult { fn from (other : ffi :: EthCompileSolidityResult) -> Self { super :: types :: EthCompileSolidityResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileSolidityResult > for ffi :: EthCompileSolidityResult { fn from (other : super :: types :: EthCompileSolidityResult) -> Self { ffi :: EthCompileSolidityResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: NetPeerCountResult > for super :: types :: NetPeerCountResult { fn from (other : ffi :: NetPeerCountResult) -> Self { super :: types :: NetPeerCountResult { number_peer : other . number_peer . into () , } } } impl From < super :: types :: NetPeerCountResult > for ffi :: NetPeerCountResult { fn from (other : super :: types :: NetPeerCountResult) -> Self { ffi :: NetPeerCountResult { number_peer : other . number_peer . into () , } } } impl From < ffi :: EthAccountsResult > for super :: types :: EthAccountsResult { fn from (other : ffi :: EthAccountsResult) -> Self { super :: types :: EthAccountsResult { accounts : other . accounts . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthAccountsResult > for ffi :: EthAccountsResult { fn from (other : super :: types :: EthAccountsResult) -> Self { ffi :: EthAccountsResult { accounts : other . accounts . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetStorageAtInput > for super :: types :: EthGetStorageAtInput { fn from (other : ffi :: EthGetStorageAtInput) -> Self { super :: types :: EthGetStorageAtInput { address : other . address . into () , position : other . position . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetStorageAtInput > for ffi :: EthGetStorageAtInput { fn from (other : super :: types :: EthGetStorageAtInput) -> Self { ffi :: EthGetStorageAtInput { address : other . address . into () , position : other . position . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthSubmitHashrateInput > for super :: types :: EthSubmitHashrateInput { fn from (other : ffi :: EthSubmitHashrateInput) -> Self { super :: types :: EthSubmitHashrateInput { hash_rate : other . hash_rate . into () , id : other . id . into () , } } } impl From < super :: types :: EthSubmitHashrateInput > for ffi :: EthSubmitHashrateInput { fn from (other : super :: types :: EthSubmitHashrateInput) -> Self { ffi :: EthSubmitHashrateInput { hash_rate : other . hash_rate . into () , id : other . id . into () , } } } impl From < ffi :: EthGasPriceResult > for super :: types :: EthGasPriceResult { fn from (other : ffi :: EthGasPriceResult) -> Self { super :: types :: EthGasPriceResult { gas_price : other . gas_price . into () , } } } impl From < super :: types :: EthGasPriceResult > for ffi :: EthGasPriceResult { fn from (other : super :: types :: EthGasPriceResult) -> Self { ffi :: EthGasPriceResult { gas_price : other . gas_price . into () , } } } impl From < ffi :: Web3Sha3Input > for super :: types :: Web3Sha3Input { fn from (other : ffi :: Web3Sha3Input) -> Self { super :: types :: Web3Sha3Input { data : other . data . into () , } } } impl From < super :: types :: Web3Sha3Input > for ffi :: Web3Sha3Input { fn from (other : super :: types :: Web3Sha3Input) -> Self { ffi :: Web3Sha3Input { data : other . data . into () , } } } impl From < ffi :: EthMiningResult > for super :: types :: EthMiningResult { fn from (other : ffi :: EthMiningResult) -> Self { super :: types :: EthMiningResult { is_mining : other . is_mining . into () , } } } impl From < super :: types :: EthMiningResult > for ffi :: EthMiningResult { fn from (other : super :: types :: EthMiningResult) -> Self { ffi :: EthMiningResult { is_mining : other . is_mining . into () , } } } impl From < ffi :: EthGetBlockByHashInput > for super :: types :: EthGetBlockByHashInput { fn from (other : ffi :: EthGetBlockByHashInput) -> Self { super :: types :: EthGetBlockByHashInput { hash : other . hash . into () , full_transaction : other . full_transaction . into () , } } } impl From < super :: types :: EthGetBlockByHashInput > for ffi :: EthGetBlockByHashInput { fn from (other : super :: types :: EthGetBlockByHashInput) -> Self { ffi :: EthGetBlockByHashInput { hash : other . hash . into () , full_transaction : other . full_transaction . into () , } } } impl From < ffi :: EthCompileSerpentInput > for super :: types :: EthCompileSerpentInput { fn from (other : ffi :: EthCompileSerpentInput) -> Self { super :: types :: EthCompileSerpentInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileSerpentInput > for ffi :: EthCompileSerpentInput { fn from (other : super :: types :: EthCompileSerpentInput) -> Self { ffi :: EthCompileSerpentInput { code : other . code . into () , } } } impl From < ffi :: EthGetCompilersResult > for super :: types :: EthGetCompilersResult { fn from (other : ffi :: EthGetCompilersResult) -> Self { super :: types :: EthGetCompilersResult { compilers : other . compilers . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthGetCompilersResult > for ffi :: EthGetCompilersResult { fn from (other : super :: types :: EthGetCompilersResult) -> Self { ffi :: EthGetCompilersResult { compilers : other . compilers . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthSendRawTransactionInput > for super :: types :: EthSendRawTransactionInput { fn from (other : ffi :: EthSendRawTransactionInput) -> Self { super :: types :: EthSendRawTransactionInput { transaction : other . transaction . into () , } } } impl From < super :: types :: EthSendRawTransactionInput > for ffi :: EthSendRawTransactionInput { fn from (other : super :: types :: EthSendRawTransactionInput) -> Self { ffi :: EthSendRawTransactionInput { transaction : other . transaction . into () , } } } impl From < ffi :: EthGetTransactionByBlockHashAndIndexInput > for super :: types :: EthGetTransactionByBlockHashAndIndexInput { fn from (other : ffi :: EthGetTransactionByBlockHashAndIndexInput) -> Self { super :: types :: EthGetTransactionByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetTransactionByBlockHashAndIndexInput > for ffi :: EthGetTransactionByBlockHashAndIndexInput { fn from (other : super :: types :: EthGetTransactionByBlockHashAndIndexInput) -> Self { ffi :: EthGetTransactionByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < ffi :: EthGetUncleCountByBlockHashInput > for super :: types :: EthGetUncleCountByBlockHashInput { fn from (other : ffi :: EthGetUncleCountByBlockHashInput) -> Self { super :: types :: EthGetUncleCountByBlockHashInput { block_hash : other . block_hash . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockHashInput > for ffi :: EthGetUncleCountByBlockHashInput { fn from (other : super :: types :: EthGetUncleCountByBlockHashInput) -> Self { ffi :: EthGetUncleCountByBlockHashInput { block_hash : other . block_hash . into () , } } } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Accounts (client : & Box < Client >) -> Result < ffi :: EthAccountsResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthAccountsResult , _ > = c . request ("eth_accounts" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Call (client : & Box < Client > , eth_call_input : EthCallInput) -> Result < ffi :: EthCallResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_call_input = super :: types :: EthCallInput :: from (eth_call_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_call_input . transaction_info , & eth_call_input . block_number] ; let resp : Result < super :: types :: EthCallResult , _ > = c . request ("eth_call" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBalance (client : & Box < Client > , eth_get_balance_input : EthGetBalanceInput) -> Result < ffi :: EthGetBalanceResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_balance_input = super :: types :: EthGetBalanceInput :: from (eth_get_balance_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_balance_input . address , & eth_get_balance_input . block_number] ; let resp : Result < super :: types :: EthGetBalanceResult , _ > = c . request ("eth_getbalance" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByHash (client : & Box < Client > , eth_get_block_by_hash_input : EthGetBlockByHashInput) -> Result < ffi :: EthBlockInfo , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_block_by_hash_input = super :: types :: EthGetBlockByHashInput :: from (eth_get_block_by_hash_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_block_by_hash_input . hash , & eth_get_block_by_hash_input . full_transaction] ; let resp : Result < super :: types :: EthBlockInfo , _ > = c . request ("eth_getblockbyhash" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_ChainId (client : & Box < Client >) -> Result < ffi :: EthChainIdResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthChainIdResult , _ > = c . request ("eth_chainid" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallNet_Version (client : & Box < Client >) -> Result < ffi :: EthChainIdResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthChainIdResult , _ > = c . request ("net_version" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_BlockNumber (client : & Box < Client >) -> Result < ffi :: EthBlockNumberResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthBlockNumberResult , _ > = c . request ("eth_blocknumber" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByNumber (client : & Box < Client > , eth_get_block_by_number_input : EthGetBlockByNumberInput) -> Result < ffi :: EthBlockInfo , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_block_by_number_input = super :: types :: EthGetBlockByNumberInput :: from (eth_get_block_by_number_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_block_by_number_input . number , & eth_get_block_by_number_input . full_transaction] ; let resp : Result < super :: types :: EthBlockInfo , _ > = c . request ("eth_getblockbynumber" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Mining (client : & Box < Client >) -> Result < ffi :: EthMiningResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthMiningResult , _ > = c . request ("eth_mining" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) }# [derive (Clone)] pub struct EthService { adapter : Arc < Handlers > } impl EthService { # [inline] # [allow (dead_code)] pub fn new (adapter : Arc < Handlers >) -> EthService { EthService { adapter } } # [inline] # [allow (dead_code)] pub fn service (& self) -> eth_server :: EthServer < EthService > { eth_server :: EthServer :: new (self . clone ()) } # [inline] # [allow (unused_mut , dead_code)] pub fn module (& self) -> Result < jsonrpsee_http_server :: RpcModule < () > , jsonrpsee_core :: Error > { let mut module = jsonrpsee_http_server :: RpcModule :: new (()) ; let adapter = self . adapter . clone () ; module . register_method ("eth_accounts" , move | _params , _ | { Self :: Eth_Accounts (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_call" , move | _params , _ | { let mut eth_call_input = super :: types :: EthCallInput :: default () ; if _params . is_object () { eth_call_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_call_input . transaction_info = seq . next () . map_err (| _ | missing_param ("transaction_info")) ? ; eth_call_input . block_number = seq . next () . map_err (| _ | missing_param ("block_number")) ? ; } let mut input = eth_call_input . into () ; Self :: Eth_Call (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getbalance" , move | _params , _ | { let mut eth_get_balance_input = super :: types :: EthGetBalanceInput :: default () ; if _params . is_object () { eth_get_balance_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_balance_input . address = seq . next () . map_err (| _ | missing_param ("address")) ? ; eth_get_balance_input . block_number = seq . next () . map_err (| _ | missing_param ("block_number")) ? ; } let mut input = eth_get_balance_input . into () ; Self :: Eth_GetBalance (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getblockbyhash" , move | _params , _ | { let mut eth_get_block_by_hash_input = super :: types :: EthGetBlockByHashInput :: default () ; if _params . is_object () { eth_get_block_by_hash_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_block_by_hash_input . hash = seq . next () . map_err (| _ | missing_param ("hash")) ? ; eth_get_block_by_hash_input . full_transaction = seq . next () . map_err (| _ | missing_param ("full_transaction")) ? ; } let mut input = eth_get_block_by_hash_input . into () ; Self :: Eth_GetBlockByHash (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_chainid" , move | _params , _ | { Self :: Eth_ChainId (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("net_version" , move | _params , _ | { Self :: Net_Version (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_blocknumber" , move | _params , _ | { Self :: Eth_BlockNumber (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getblockbynumber" , move | _params , _ | { let mut eth_get_block_by_number_input = super :: types :: EthGetBlockByNumberInput :: default () ; if _params . is_object () { eth_get_block_by_number_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_block_by_number_input . number = seq . next () . map_err (| _ | missing_param ("number")) ? ; eth_get_block_by_number_input . full_transaction = seq . next () . map_err (| _ | missing_param ("full_transaction")) ? ; } let mut input = eth_get_block_by_number_input . into () ; Self :: Eth_GetBlockByNumber (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_mining" , move | _params , _ | { Self :: Eth_Mining (adapter . clone () ,) }) ? ; Ok (module) } } # [tonic :: async_trait] impl eth_server :: Eth for EthService { async fn eth_accounts (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthAccountsResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_Accounts (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_call (& self , request : tonic :: Request < super :: types :: EthCallInput >) -> Result < tonic :: Response < super :: types :: EthCallResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_Call (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_balance (& self , request : tonic :: Request < super :: types :: EthGetBalanceInput >) -> Result < tonic :: Response < super :: types :: EthGetBalanceResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBalance (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_block_by_hash (& self , request : tonic :: Request < super :: types :: EthGetBlockByHashInput >) -> Result < tonic :: Response < super :: types :: EthBlockInfo > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBlockByHash (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } # [allow (unused_variables)] async fn eth_send_transaction (& self , request : tonic :: Request < super :: types :: EthSendTransactionInput >) -> Result < tonic :: Response < super :: types :: EthSendTransactionResult > , tonic :: Status > { unimplemented ! () ; } async fn eth_chain_id (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthChainIdResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_ChainId (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn net_version (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthChainIdResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Net_Version (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_block_number (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthBlockNumberResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_BlockNumber (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_block_by_number (& self , request : tonic :: Request < super :: types :: EthGetBlockByNumberInput >) -> Result < tonic :: Response < super :: types :: EthBlockInfo > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBlockByNumber (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_mining (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthMiningResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_Mining (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } }# [derive (Clone)] pub struct BlockchainService { adapter : Arc < Handlers > } impl BlockchainService { # [inline] # [allow (dead_code)] pub fn new (adapter : Arc < Handlers >) -> BlockchainService { BlockchainService { adapter } } # [inline] # [allow (dead_code)] pub fn service (& self) -> blockchain_server :: BlockchainServer < BlockchainService > { blockchain_server :: BlockchainServer :: new (self . clone ()) } # [inline] # [allow (unused_mut , dead_code)] pub fn module (& self) -> Result < jsonrpsee_http_server :: RpcModule < () > , jsonrpsee_core :: Error > { let mut module = jsonrpsee_http_server :: RpcModule :: new (()) ; Ok (module) } } # [tonic :: async_trait] impl blockchain_server :: Blockchain for BlockchainService { # [allow (unused_variables)] async fn get_best_block_hash (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: BlockHashResult > , tonic :: Status > { unimplemented ! () ; } # [allow (unused_variables)] async fn get_block (& self , request : tonic :: Request < super :: types :: BlockInput >) -> Result < tonic :: Response < super :: types :: BlockResult > , tonic :: Status > { unimplemented ! () ; } } \ No newline at end of file +use jsonrpsee_core :: client :: ClientT ; use jsonrpsee_http_client :: { HttpClient , HttpClientBuilder } ; use std :: sync :: Arc ; use crate :: { CLIENTS } ; use ain_evm :: runtime :: RUNTIME ; use crate :: rpc :: * ; # [allow (unused_imports)] use self :: ffi :: * ; use ain_evm :: handler :: Handlers ; # [derive (Clone)] pub struct Client { inner : Arc < HttpClient > , handle : tokio :: runtime :: Handle , } # [allow (non_snake_case)] fn NewClient (addr : & str) -> Result < Box < Client > , Box < dyn std :: error :: Error >> { if CLIENTS . read () . unwrap () . get (addr) . is_none () { log :: info ! ("Initializing RPC client for {}" , addr) ; let c = Client { inner : Arc :: new (HttpClientBuilder :: default () . build (addr) ?) , handle : RUNTIME . rt_handle . clone () , } ; CLIENTS . write () . unwrap () . insert (addr . into () , c) ; } Ok (Box :: new (CLIENTS . read () . unwrap () . get (addr) . unwrap () . clone ())) } # [allow (dead_code)] fn missing_param (field : & str) -> jsonrpsee_core :: Error { jsonrpsee_core :: Error :: Call (jsonrpsee_types :: error :: CallError :: Custom (jsonrpsee_types :: ErrorObject :: borrowed (- 1 , & format ! ("Missing required parameter '{field}'") , None) . into_owned ())) } impl From < ffi :: EthGetBlockByHashResult > for super :: types :: EthGetBlockByHashResult { fn from (other : ffi :: EthGetBlockByHashResult) -> Self { super :: types :: EthGetBlockByHashResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetBlockByHashResult > for ffi :: EthGetBlockByHashResult { fn from (other : super :: types :: EthGetBlockByHashResult) -> Self { ffi :: EthGetBlockByHashResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthCompileLllInput > for super :: types :: EthCompileLllInput { fn from (other : ffi :: EthCompileLllInput) -> Self { super :: types :: EthCompileLllInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileLllInput > for ffi :: EthCompileLllInput { fn from (other : super :: types :: EthCompileLllInput) -> Self { ffi :: EthCompileLllInput { code : other . code . into () , } } } impl From < ffi :: EthBlockInfo > for super :: types :: EthBlockInfo { fn from (other : ffi :: EthBlockInfo) -> Self { super :: types :: EthBlockInfo { block_number : other . block_number . into () , hash : other . hash . into () , parent_hash : other . parent_hash . into () , nonce : other . nonce . into () , sha3_uncles : other . sha3_uncles . into () , logs_bloom : other . logs_bloom . into () , transactions_root : other . transactions_root . into () , state_root : other . state_root . into () , receipt_root : other . receipt_root . into () , miner : other . miner . into () , difficulty : other . difficulty . into () , total_difficulty : other . total_difficulty . into () , extra_data : other . extra_data . into () , size : other . size . into () , gas_limit : other . gas_limit . into () , gas_used : other . gas_used . into () , timestamps : other . timestamps . into () , transactions : other . transactions . into_iter () . map (Into :: into) . collect () , uncles : other . uncles . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthBlockInfo > for ffi :: EthBlockInfo { fn from (other : super :: types :: EthBlockInfo) -> Self { ffi :: EthBlockInfo { block_number : other . block_number . into () , hash : other . hash . into () , parent_hash : other . parent_hash . into () , nonce : other . nonce . into () , sha3_uncles : other . sha3_uncles . into () , logs_bloom : other . logs_bloom . into () , transactions_root : other . transactions_root . into () , state_root : other . state_root . into () , receipt_root : other . receipt_root . into () , miner : other . miner . into () , difficulty : other . difficulty . into () , total_difficulty : other . total_difficulty . into () , extra_data : other . extra_data . into () , size : other . size . into () , gas_limit : other . gas_limit . into () , gas_used : other . gas_used . into () , timestamps : other . timestamps . into () , transactions : other . transactions . into_iter () . map (Into :: into) . collect () , uncles : other . uncles . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthChainIdResult > for super :: types :: EthChainIdResult { fn from (other : ffi :: EthChainIdResult) -> Self { super :: types :: EthChainIdResult { id : other . id . into () , } } } impl From < super :: types :: EthChainIdResult > for ffi :: EthChainIdResult { fn from (other : super :: types :: EthChainIdResult) -> Self { ffi :: EthChainIdResult { id : other . id . into () , } } } impl From < ffi :: Transaction > for super :: types :: Transaction { fn from (other : ffi :: Transaction) -> Self { super :: types :: Transaction { hash : other . hash . into () , raw : Some (other . raw . into ()) , } } } impl From < super :: types :: Transaction > for ffi :: Transaction { fn from (other : super :: types :: Transaction) -> Self { ffi :: Transaction { hash : other . hash . into () , raw : other . raw . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthSignTransactionResult > for super :: types :: EthSignTransactionResult { fn from (other : ffi :: EthSignTransactionResult) -> Self { super :: types :: EthSignTransactionResult { transaction : other . transaction . into () , } } } impl From < super :: types :: EthSignTransactionResult > for ffi :: EthSignTransactionResult { fn from (other : super :: types :: EthSignTransactionResult) -> Self { ffi :: EthSignTransactionResult { transaction : other . transaction . into () , } } } impl From < ffi :: EthGetBlockByNumberResult > for super :: types :: EthGetBlockByNumberResult { fn from (other : ffi :: EthGetBlockByNumberResult) -> Self { super :: types :: EthGetBlockByNumberResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetBlockByNumberResult > for ffi :: EthGetBlockByNumberResult { fn from (other : super :: types :: EthGetBlockByNumberResult) -> Self { ffi :: EthGetBlockByNumberResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetUncleByBlockNumberAndIndexResult > for super :: types :: EthGetUncleByBlockNumberAndIndexResult { fn from (other : ffi :: EthGetUncleByBlockNumberAndIndexResult) -> Self { super :: types :: EthGetUncleByBlockNumberAndIndexResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetUncleByBlockNumberAndIndexResult > for ffi :: EthGetUncleByBlockNumberAndIndexResult { fn from (other : super :: types :: EthGetUncleByBlockNumberAndIndexResult) -> Self { ffi :: EthGetUncleByBlockNumberAndIndexResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: NonUtxo > for super :: types :: NonUtxo { fn from (other : ffi :: NonUtxo) -> Self { super :: types :: NonUtxo { anchor_reward : other . anchor_reward . into () , burnt : other . burnt . into () , incentive_funding : other . incentive_funding . into () , loan : other . loan . into () , options : other . options . into () , unknown : other . unknown . into () , } } } impl From < super :: types :: NonUtxo > for ffi :: NonUtxo { fn from (other : super :: types :: NonUtxo) -> Self { ffi :: NonUtxo { anchor_reward : other . anchor_reward . into () , burnt : other . burnt . into () , incentive_funding : other . incentive_funding . into () , loan : other . loan . into () , options : other . options . into () , unknown : other . unknown . into () , } } } impl From < ffi :: EthAccountsResult > for super :: types :: EthAccountsResult { fn from (other : ffi :: EthAccountsResult) -> Self { super :: types :: EthAccountsResult { accounts : other . accounts . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthAccountsResult > for ffi :: EthAccountsResult { fn from (other : super :: types :: EthAccountsResult) -> Self { ffi :: EthAccountsResult { accounts : other . accounts . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetUncleCountByBlockHashResult > for super :: types :: EthGetUncleCountByBlockHashResult { fn from (other : ffi :: EthGetUncleCountByBlockHashResult) -> Self { super :: types :: EthGetUncleCountByBlockHashResult { number_uncles : other . number_uncles . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockHashResult > for ffi :: EthGetUncleCountByBlockHashResult { fn from (other : super :: types :: EthGetUncleCountByBlockHashResult) -> Self { ffi :: EthGetUncleCountByBlockHashResult { number_uncles : other . number_uncles . into () , } } } impl From < ffi :: BlockInput > for super :: types :: BlockInput { fn from (other : ffi :: BlockInput) -> Self { super :: types :: BlockInput { blockhash : other . blockhash . into () , verbosity : other . verbosity . into () , } } } impl From < super :: types :: BlockInput > for ffi :: BlockInput { fn from (other : super :: types :: BlockInput) -> Self { ffi :: BlockInput { blockhash : other . blockhash . into () , verbosity : other . verbosity . into () , } } } impl From < ffi :: EthGetTransactionCountInput > for super :: types :: EthGetTransactionCountInput { fn from (other : ffi :: EthGetTransactionCountInput) -> Self { super :: types :: EthGetTransactionCountInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetTransactionCountInput > for ffi :: EthGetTransactionCountInput { fn from (other : super :: types :: EthGetTransactionCountInput) -> Self { ffi :: EthGetTransactionCountInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthGetUncleCountByBlockNumberResult > for super :: types :: EthGetUncleCountByBlockNumberResult { fn from (other : ffi :: EthGetUncleCountByBlockNumberResult) -> Self { super :: types :: EthGetUncleCountByBlockNumberResult { number_uncles : other . number_uncles . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockNumberResult > for ffi :: EthGetUncleCountByBlockNumberResult { fn from (other : super :: types :: EthGetUncleCountByBlockNumberResult) -> Self { ffi :: EthGetUncleCountByBlockNumberResult { number_uncles : other . number_uncles . into () , } } } impl From < ffi :: EthSignTransactionInput > for super :: types :: EthSignTransactionInput { fn from (other : ffi :: EthSignTransactionInput) -> Self { super :: types :: EthSignTransactionInput { transaction_info : Some (other . transaction_info . into ()) , } } } impl From < super :: types :: EthSignTransactionInput > for ffi :: EthSignTransactionInput { fn from (other : super :: types :: EthSignTransactionInput) -> Self { ffi :: EthSignTransactionInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetBlockByNumberInput > for super :: types :: EthGetBlockByNumberInput { fn from (other : ffi :: EthGetBlockByNumberInput) -> Self { super :: types :: EthGetBlockByNumberInput { number : other . number . into () , full_transaction : other . full_transaction . into () , } } } impl From < super :: types :: EthGetBlockByNumberInput > for ffi :: EthGetBlockByNumberInput { fn from (other : super :: types :: EthGetBlockByNumberInput) -> Self { ffi :: EthGetBlockByNumberInput { number : other . number . into () , full_transaction : other . full_transaction . into () , } } } impl From < ffi :: EthCompileLllResult > for super :: types :: EthCompileLllResult { fn from (other : ffi :: EthCompileLllResult) -> Self { super :: types :: EthCompileLllResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileLllResult > for ffi :: EthCompileLllResult { fn from (other : super :: types :: EthCompileLllResult) -> Self { ffi :: EthCompileLllResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: EthCompileSerpentResult > for super :: types :: EthCompileSerpentResult { fn from (other : ffi :: EthCompileSerpentResult) -> Self { super :: types :: EthCompileSerpentResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileSerpentResult > for ffi :: EthCompileSerpentResult { fn from (other : super :: types :: EthCompileSerpentResult) -> Self { ffi :: EthCompileSerpentResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: EthCallResult > for super :: types :: EthCallResult { fn from (other : ffi :: EthCallResult) -> Self { super :: types :: EthCallResult { data : other . data . into () , } } } impl From < super :: types :: EthCallResult > for ffi :: EthCallResult { fn from (other : super :: types :: EthCallResult) -> Self { ffi :: EthCallResult { data : other . data . into () , } } } impl From < ffi :: EthTransactionReceipt > for super :: types :: EthTransactionReceipt { fn from (other : ffi :: EthTransactionReceipt) -> Self { super :: types :: EthTransactionReceipt { transaction_hash : other . transaction_hash . into () , transaction_index : other . transaction_index . into () , block_hash : other . block_hash . into () , block_number : other . block_number . into () , from : other . from . into () , to : other . to . into () , cumulative_gas_used : other . cumulative_gas_used . into () , effective_gas_price : other . effective_gas_price . into () , gas_used : other . gas_used . into () , contract_address : other . contract_address . into () , logs : other . logs . into_iter () . map (Into :: into) . collect () , logs_bloom : other . logs_bloom . into () , field_type : other . field_type . into () , root : Some (other . root . into ()) , status : Some (other . status . into ()) , } } } impl From < super :: types :: EthTransactionReceipt > for ffi :: EthTransactionReceipt { fn from (other : super :: types :: EthTransactionReceipt) -> Self { ffi :: EthTransactionReceipt { transaction_hash : other . transaction_hash . into () , transaction_index : other . transaction_index . into () , block_hash : other . block_hash . into () , block_number : other . block_number . into () , from : other . from . into () , to : other . to . into () , cumulative_gas_used : other . cumulative_gas_used . into () , effective_gas_price : other . effective_gas_price . into () , gas_used : other . gas_used . into () , contract_address : other . contract_address . into () , logs : other . logs . into_iter () . map (Into :: into) . collect () , logs_bloom : other . logs_bloom . into () , field_type : other . field_type . into () , root : other . root . map (Into :: into) . unwrap_or_default () , status : other . status . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthSendTransactionInput > for super :: types :: EthSendTransactionInput { fn from (other : ffi :: EthSendTransactionInput) -> Self { super :: types :: EthSendTransactionInput { transaction_info : Some (other . transaction_info . into ()) , } } } impl From < super :: types :: EthSendTransactionInput > for ffi :: EthSendTransactionInput { fn from (other : super :: types :: EthSendTransactionInput) -> Self { ffi :: EthSendTransactionInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthEstimateGasInput > for super :: types :: EthEstimateGasInput { fn from (other : ffi :: EthEstimateGasInput) -> Self { super :: types :: EthEstimateGasInput { transaction_info : Some (other . transaction_info . into ()) , block_number : Some (other . block_number . into ()) , } } } impl From < super :: types :: EthEstimateGasInput > for ffi :: EthEstimateGasInput { fn from (other : super :: types :: EthEstimateGasInput) -> Self { ffi :: EthEstimateGasInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , block_number : other . block_number . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetWorkResult > for super :: types :: EthGetWorkResult { fn from (other : ffi :: EthGetWorkResult) -> Self { super :: types :: EthGetWorkResult { currentblock : other . currentblock . into () , seed_hash : other . seed_hash . into () , target : other . target . into () , } } } impl From < super :: types :: EthGetWorkResult > for ffi :: EthGetWorkResult { fn from (other : super :: types :: EthGetWorkResult) -> Self { ffi :: EthGetWorkResult { currentblock : other . currentblock . into () , seed_hash : other . seed_hash . into () , target : other . target . into () , } } } impl From < ffi :: EthGasPriceResult > for super :: types :: EthGasPriceResult { fn from (other : ffi :: EthGasPriceResult) -> Self { super :: types :: EthGasPriceResult { gas_price : other . gas_price . into () , } } } impl From < super :: types :: EthGasPriceResult > for ffi :: EthGasPriceResult { fn from (other : super :: types :: EthGasPriceResult) -> Self { ffi :: EthGasPriceResult { gas_price : other . gas_price . into () , } } } impl From < ffi :: EthSignResult > for super :: types :: EthSignResult { fn from (other : ffi :: EthSignResult) -> Self { super :: types :: EthSignResult { signature : other . signature . into () , } } } impl From < super :: types :: EthSignResult > for ffi :: EthSignResult { fn from (other : super :: types :: EthSignResult) -> Self { ffi :: EthSignResult { signature : other . signature . into () , } } } impl From < ffi :: EthBlockNumberResult > for super :: types :: EthBlockNumberResult { fn from (other : ffi :: EthBlockNumberResult) -> Self { super :: types :: EthBlockNumberResult { block_number : other . block_number . into () , } } } impl From < super :: types :: EthBlockNumberResult > for ffi :: EthBlockNumberResult { fn from (other : super :: types :: EthBlockNumberResult) -> Self { ffi :: EthBlockNumberResult { block_number : other . block_number . into () , } } } impl From < ffi :: EthGetUncleByBlockNumberAndIndexInput > for super :: types :: EthGetUncleByBlockNumberAndIndexInput { fn from (other : ffi :: EthGetUncleByBlockNumberAndIndexInput) -> Self { super :: types :: EthGetUncleByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetUncleByBlockNumberAndIndexInput > for ffi :: EthGetUncleByBlockNumberAndIndexInput { fn from (other : super :: types :: EthGetUncleByBlockNumberAndIndexInput) -> Self { ffi :: EthGetUncleByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < ffi :: EthGetTransactionByBlockNumberAndIndexInput > for super :: types :: EthGetTransactionByBlockNumberAndIndexInput { fn from (other : ffi :: EthGetTransactionByBlockNumberAndIndexInput) -> Self { super :: types :: EthGetTransactionByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetTransactionByBlockNumberAndIndexInput > for ffi :: EthGetTransactionByBlockNumberAndIndexInput { fn from (other : super :: types :: EthGetTransactionByBlockNumberAndIndexInput) -> Self { ffi :: EthGetTransactionByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < ffi :: EthSubmitWorkResult > for super :: types :: EthSubmitWorkResult { fn from (other : ffi :: EthSubmitWorkResult) -> Self { super :: types :: EthSubmitWorkResult { is_valid : other . is_valid . into () , } } } impl From < super :: types :: EthSubmitWorkResult > for ffi :: EthSubmitWorkResult { fn from (other : super :: types :: EthSubmitWorkResult) -> Self { ffi :: EthSubmitWorkResult { is_valid : other . is_valid . into () , } } } impl From < ffi :: EthTransactionInfo > for super :: types :: EthTransactionInfo { fn from (other : ffi :: EthTransactionInfo) -> Self { super :: types :: EthTransactionInfo { from : Some (other . from . into ()) , to : Some (other . to . into ()) , gas : Some (other . gas . into ()) , price : Some (other . price . into ()) , value : Some (other . value . into ()) , data : Some (other . data . into ()) , nonce : Some (other . nonce . into ()) , } } } impl From < super :: types :: EthTransactionInfo > for ffi :: EthTransactionInfo { fn from (other : super :: types :: EthTransactionInfo) -> Self { ffi :: EthTransactionInfo { from : other . from . map (Into :: into) . unwrap_or_default () , to : other . to . map (Into :: into) . unwrap_or_default () , gas : other . gas . map (Into :: into) . unwrap_or_default () , price : other . price . map (Into :: into) . unwrap_or_default () , value : other . value . map (Into :: into) . unwrap_or_default () , data : other . data . map (Into :: into) . unwrap_or_default () , nonce : other . nonce . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetStorageAtResult > for super :: types :: EthGetStorageAtResult { fn from (other : ffi :: EthGetStorageAtResult) -> Self { super :: types :: EthGetStorageAtResult { value : other . value . into () , } } } impl From < super :: types :: EthGetStorageAtResult > for ffi :: EthGetStorageAtResult { fn from (other : super :: types :: EthGetStorageAtResult) -> Self { ffi :: EthGetStorageAtResult { value : other . value . into () , } } } impl From < ffi :: EthCoinBaseResult > for super :: types :: EthCoinBaseResult { fn from (other : ffi :: EthCoinBaseResult) -> Self { super :: types :: EthCoinBaseResult { address : other . address . into () , } } } impl From < super :: types :: EthCoinBaseResult > for ffi :: EthCoinBaseResult { fn from (other : super :: types :: EthCoinBaseResult) -> Self { ffi :: EthCoinBaseResult { address : other . address . into () , } } } impl From < ffi :: EthCompileSolidityResult > for super :: types :: EthCompileSolidityResult { fn from (other : ffi :: EthCompileSolidityResult) -> Self { super :: types :: EthCompileSolidityResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileSolidityResult > for ffi :: EthCompileSolidityResult { fn from (other : super :: types :: EthCompileSolidityResult) -> Self { ffi :: EthCompileSolidityResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: EthGetStorageAtInput > for super :: types :: EthGetStorageAtInput { fn from (other : ffi :: EthGetStorageAtInput) -> Self { super :: types :: EthGetStorageAtInput { address : other . address . into () , position : other . position . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetStorageAtInput > for ffi :: EthGetStorageAtInput { fn from (other : super :: types :: EthGetStorageAtInput) -> Self { ffi :: EthGetStorageAtInput { address : other . address . into () , position : other . position . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthMiningResult > for super :: types :: EthMiningResult { fn from (other : ffi :: EthMiningResult) -> Self { super :: types :: EthMiningResult { is_mining : other . is_mining . into () , } } } impl From < super :: types :: EthMiningResult > for ffi :: EthMiningResult { fn from (other : super :: types :: EthMiningResult) -> Self { ffi :: EthMiningResult { is_mining : other . is_mining . into () , } } } impl From < ffi :: EthGetBalanceInput > for super :: types :: EthGetBalanceInput { fn from (other : ffi :: EthGetBalanceInput) -> Self { super :: types :: EthGetBalanceInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetBalanceInput > for ffi :: EthGetBalanceInput { fn from (other : super :: types :: EthGetBalanceInput) -> Self { ffi :: EthGetBalanceInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthGetBalanceResult > for super :: types :: EthGetBalanceResult { fn from (other : ffi :: EthGetBalanceResult) -> Self { super :: types :: EthGetBalanceResult { balance : other . balance . into () , } } } impl From < super :: types :: EthGetBalanceResult > for ffi :: EthGetBalanceResult { fn from (other : super :: types :: EthGetBalanceResult) -> Self { ffi :: EthGetBalanceResult { balance : other . balance . into () , } } } impl From < ffi :: EthGetBlockTransactionCountByHashResult > for super :: types :: EthGetBlockTransactionCountByHashResult { fn from (other : ffi :: EthGetBlockTransactionCountByHashResult) -> Self { super :: types :: EthGetBlockTransactionCountByHashResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByHashResult > for ffi :: EthGetBlockTransactionCountByHashResult { fn from (other : super :: types :: EthGetBlockTransactionCountByHashResult) -> Self { ffi :: EthGetBlockTransactionCountByHashResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: Vout > for super :: types :: Vout { fn from (other : ffi :: Vout) -> Self { super :: types :: Vout { value : other . value . into () , n : other . n . into () , script_pub_key : Some (other . script_pub_key . into ()) , token_id : other . token_id . into () , } } } impl From < super :: types :: Vout > for ffi :: Vout { fn from (other : super :: types :: Vout) -> Self { ffi :: Vout { value : other . value . into () , n : other . n . into () , script_pub_key : other . script_pub_key . map (Into :: into) . unwrap_or_default () , token_id : other . token_id . into () , } } } impl From < ffi :: EthSendTransactionResult > for super :: types :: EthSendTransactionResult { fn from (other : ffi :: EthSendTransactionResult) -> Self { super :: types :: EthSendTransactionResult { hash : other . hash . into () , } } } impl From < super :: types :: EthSendTransactionResult > for ffi :: EthSendTransactionResult { fn from (other : super :: types :: EthSendTransactionResult) -> Self { ffi :: EthSendTransactionResult { hash : other . hash . into () , } } } impl From < ffi :: EthGetTransactionByBlockHashAndIndexInput > for super :: types :: EthGetTransactionByBlockHashAndIndexInput { fn from (other : ffi :: EthGetTransactionByBlockHashAndIndexInput) -> Self { super :: types :: EthGetTransactionByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetTransactionByBlockHashAndIndexInput > for ffi :: EthGetTransactionByBlockHashAndIndexInput { fn from (other : super :: types :: EthGetTransactionByBlockHashAndIndexInput) -> Self { ffi :: EthGetTransactionByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < ffi :: EthProtocolVersionResult > for super :: types :: EthProtocolVersionResult { fn from (other : ffi :: EthProtocolVersionResult) -> Self { super :: types :: EthProtocolVersionResult { protocol_version : other . protocol_version . into () , } } } impl From < super :: types :: EthProtocolVersionResult > for ffi :: EthProtocolVersionResult { fn from (other : super :: types :: EthProtocolVersionResult) -> Self { ffi :: EthProtocolVersionResult { protocol_version : other . protocol_version . into () , } } } impl From < ffi :: ScriptSig > for super :: types :: ScriptSig { fn from (other : ffi :: ScriptSig) -> Self { super :: types :: ScriptSig { field_asm : other . field_asm . into () , hex : other . hex . into () , } } } impl From < super :: types :: ScriptSig > for ffi :: ScriptSig { fn from (other : super :: types :: ScriptSig) -> Self { ffi :: ScriptSig { field_asm : other . field_asm . into () , hex : other . hex . into () , } } } impl From < ffi :: EthSyncingInfo > for super :: types :: EthSyncingInfo { fn from (other : ffi :: EthSyncingInfo) -> Self { super :: types :: EthSyncingInfo { starting_block : other . starting_block . into () , current_block : other . current_block . into () , highest_block : other . highest_block . into () , } } } impl From < super :: types :: EthSyncingInfo > for ffi :: EthSyncingInfo { fn from (other : super :: types :: EthSyncingInfo) -> Self { ffi :: EthSyncingInfo { starting_block : other . starting_block . into () , current_block : other . current_block . into () , highest_block : other . highest_block . into () , } } } impl From < ffi :: EthSyncingResult > for super :: types :: EthSyncingResult { fn from (other : ffi :: EthSyncingResult) -> Self { super :: types :: EthSyncingResult { status : Some (other . status . into ()) , sync_info : Some (other . sync_info . into ()) , } } } impl From < super :: types :: EthSyncingResult > for ffi :: EthSyncingResult { fn from (other : super :: types :: EthSyncingResult) -> Self { ffi :: EthSyncingResult { status : other . status . map (Into :: into) . unwrap_or_default () , sync_info : other . sync_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthEstimateGasResult > for super :: types :: EthEstimateGasResult { fn from (other : ffi :: EthEstimateGasResult) -> Self { super :: types :: EthEstimateGasResult { gas_used : other . gas_used . into () , } } } impl From < super :: types :: EthEstimateGasResult > for ffi :: EthEstimateGasResult { fn from (other : super :: types :: EthEstimateGasResult) -> Self { ffi :: EthEstimateGasResult { gas_used : other . gas_used . into () , } } } impl From < ffi :: EthGetUncleCountByBlockNumberInput > for super :: types :: EthGetUncleCountByBlockNumberInput { fn from (other : ffi :: EthGetUncleCountByBlockNumberInput) -> Self { super :: types :: EthGetUncleCountByBlockNumberInput { block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockNumberInput > for ffi :: EthGetUncleCountByBlockNumberInput { fn from (other : super :: types :: EthGetUncleCountByBlockNumberInput) -> Self { ffi :: EthGetUncleCountByBlockNumberInput { block_number : other . block_number . into () , } } } impl From < ffi :: EthGetTransactionByHashResult > for super :: types :: EthGetTransactionByHashResult { fn from (other : ffi :: EthGetTransactionByHashResult) -> Self { super :: types :: EthGetTransactionByHashResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByHashResult > for ffi :: EthGetTransactionByHashResult { fn from (other : super :: types :: EthGetTransactionByHashResult) -> Self { ffi :: EthGetTransactionByHashResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetBlockTransactionCountByNumberInput > for super :: types :: EthGetBlockTransactionCountByNumberInput { fn from (other : ffi :: EthGetBlockTransactionCountByNumberInput) -> Self { super :: types :: EthGetBlockTransactionCountByNumberInput { block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByNumberInput > for ffi :: EthGetBlockTransactionCountByNumberInput { fn from (other : super :: types :: EthGetBlockTransactionCountByNumberInput) -> Self { ffi :: EthGetBlockTransactionCountByNumberInput { block_number : other . block_number . into () , } } } impl From < ffi :: EthSubmitHashrateResult > for super :: types :: EthSubmitHashrateResult { fn from (other : ffi :: EthSubmitHashrateResult) -> Self { super :: types :: EthSubmitHashrateResult { is_valid : other . is_valid . into () , } } } impl From < super :: types :: EthSubmitHashrateResult > for ffi :: EthSubmitHashrateResult { fn from (other : super :: types :: EthSubmitHashrateResult) -> Self { ffi :: EthSubmitHashrateResult { is_valid : other . is_valid . into () , } } } impl From < ffi :: EthGetTransactionReceiptResult > for super :: types :: EthGetTransactionReceiptResult { fn from (other : ffi :: EthGetTransactionReceiptResult) -> Self { super :: types :: EthGetTransactionReceiptResult { transaction_receipt : Some (other . transaction_receipt . into ()) , } } } impl From < super :: types :: EthGetTransactionReceiptResult > for ffi :: EthGetTransactionReceiptResult { fn from (other : super :: types :: EthGetTransactionReceiptResult) -> Self { ffi :: EthGetTransactionReceiptResult { transaction_receipt : other . transaction_receipt . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetBlockTransactionCountByHashInput > for super :: types :: EthGetBlockTransactionCountByHashInput { fn from (other : ffi :: EthGetBlockTransactionCountByHashInput) -> Self { super :: types :: EthGetBlockTransactionCountByHashInput { block_hash : other . block_hash . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByHashInput > for ffi :: EthGetBlockTransactionCountByHashInput { fn from (other : super :: types :: EthGetBlockTransactionCountByHashInput) -> Self { ffi :: EthGetBlockTransactionCountByHashInput { block_hash : other . block_hash . into () , } } } impl From < ffi :: RawTransaction > for super :: types :: RawTransaction { fn from (other : ffi :: RawTransaction) -> Self { super :: types :: RawTransaction { in_active_chain : other . in_active_chain . into () , hex : other . hex . into () , txid : other . txid . into () , hash : other . hash . into () , size : other . size . into () , vsize : other . vsize . into () , weight : other . weight . into () , version : other . version . into () , locktime : other . locktime . into () , vin : other . vin . into_iter () . map (Into :: into) . collect () , vout : other . vout . into_iter () . map (Into :: into) . collect () , blockhash : other . blockhash . into () , confirmations : other . confirmations . into () , blocktime : other . blocktime . into () , } } } impl From < super :: types :: RawTransaction > for ffi :: RawTransaction { fn from (other : super :: types :: RawTransaction) -> Self { ffi :: RawTransaction { in_active_chain : other . in_active_chain . into () , hex : other . hex . into () , txid : other . txid . into () , hash : other . hash . into () , size : other . size . into () , vsize : other . vsize . into () , weight : other . weight . into () , version : other . version . into () , locktime : other . locktime . into () , vin : other . vin . into_iter () . map (Into :: into) . collect () , vout : other . vout . into_iter () . map (Into :: into) . collect () , blockhash : other . blockhash . into () , confirmations : other . confirmations . into () , blocktime : other . blocktime . into () , } } } impl From < ffi :: EthGetUncleCountByBlockHashInput > for super :: types :: EthGetUncleCountByBlockHashInput { fn from (other : ffi :: EthGetUncleCountByBlockHashInput) -> Self { super :: types :: EthGetUncleCountByBlockHashInput { block_hash : other . block_hash . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockHashInput > for ffi :: EthGetUncleCountByBlockHashInput { fn from (other : super :: types :: EthGetUncleCountByBlockHashInput) -> Self { ffi :: EthGetUncleCountByBlockHashInput { block_hash : other . block_hash . into () , } } } impl From < ffi :: EthCompileSolidityInput > for super :: types :: EthCompileSolidityInput { fn from (other : ffi :: EthCompileSolidityInput) -> Self { super :: types :: EthCompileSolidityInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileSolidityInput > for ffi :: EthCompileSolidityInput { fn from (other : super :: types :: EthCompileSolidityInput) -> Self { ffi :: EthCompileSolidityInput { code : other . code . into () , } } } impl From < ffi :: NetPeerCountResult > for super :: types :: NetPeerCountResult { fn from (other : ffi :: NetPeerCountResult) -> Self { super :: types :: NetPeerCountResult { number_peer : other . number_peer . into () , } } } impl From < super :: types :: NetPeerCountResult > for ffi :: NetPeerCountResult { fn from (other : super :: types :: NetPeerCountResult) -> Self { ffi :: NetPeerCountResult { number_peer : other . number_peer . into () , } } } impl From < ffi :: EthGetUncleByBlockHashAndIndexResult > for super :: types :: EthGetUncleByBlockHashAndIndexResult { fn from (other : ffi :: EthGetUncleByBlockHashAndIndexResult) -> Self { super :: types :: EthGetUncleByBlockHashAndIndexResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetUncleByBlockHashAndIndexResult > for ffi :: EthGetUncleByBlockHashAndIndexResult { fn from (other : super :: types :: EthGetUncleByBlockHashAndIndexResult) -> Self { ffi :: EthGetUncleByBlockHashAndIndexResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: Web3Sha3Result > for super :: types :: Web3Sha3Result { fn from (other : ffi :: Web3Sha3Result) -> Self { super :: types :: Web3Sha3Result { data : other . data . into () , } } } impl From < super :: types :: Web3Sha3Result > for ffi :: Web3Sha3Result { fn from (other : super :: types :: Web3Sha3Result) -> Self { ffi :: Web3Sha3Result { data : other . data . into () , } } } impl From < ffi :: EthGetCodeResult > for super :: types :: EthGetCodeResult { fn from (other : ffi :: EthGetCodeResult) -> Self { super :: types :: EthGetCodeResult { code : other . code . into () , } } } impl From < super :: types :: EthGetCodeResult > for ffi :: EthGetCodeResult { fn from (other : super :: types :: EthGetCodeResult) -> Self { ffi :: EthGetCodeResult { code : other . code . into () , } } } impl From < ffi :: BlockResult > for super :: types :: BlockResult { fn from (other : ffi :: BlockResult) -> Self { super :: types :: BlockResult { hash : other . hash . into () , block : Some (other . block . into ()) , } } } impl From < super :: types :: BlockResult > for ffi :: BlockResult { fn from (other : super :: types :: BlockResult) -> Self { ffi :: BlockResult { hash : other . hash . into () , block : other . block . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: Block > for super :: types :: Block { fn from (other : ffi :: Block) -> Self { super :: types :: Block { hash : other . hash . into () , confirmations : other . confirmations . into () , size : other . size . into () , strippedsize : other . strippedsize . into () , weight : other . weight . into () , height : other . height . into () , version : other . version . into () , version_hex : other . version_hex . into () , merkleroot : other . merkleroot . into () , tx : other . tx . into_iter () . map (Into :: into) . collect () , time : other . time . into () , mediantime : other . mediantime . into () , nonce : other . nonce . into () , bits : other . bits . into () , difficulty : other . difficulty . into () , chainwork : other . chainwork . into () , n_tx : other . n_tx . into () , previous_block_hash : other . previous_block_hash . into () , next_block_hash : other . next_block_hash . into () , masternode : other . masternode . into () , minter : other . minter . into () , minted_blocks : other . minted_blocks . into () , stake_modifier : other . stake_modifier . into () , nonutxo : other . nonutxo . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: Block > for ffi :: Block { fn from (other : super :: types :: Block) -> Self { ffi :: Block { hash : other . hash . into () , confirmations : other . confirmations . into () , size : other . size . into () , strippedsize : other . strippedsize . into () , weight : other . weight . into () , height : other . height . into () , version : other . version . into () , version_hex : other . version_hex . into () , merkleroot : other . merkleroot . into () , tx : other . tx . into_iter () . map (Into :: into) . collect () , time : other . time . into () , mediantime : other . mediantime . into () , nonce : other . nonce . into () , bits : other . bits . into () , difficulty : other . difficulty . into () , chainwork : other . chainwork . into () , n_tx : other . n_tx . into () , previous_block_hash : other . previous_block_hash . into () , next_block_hash : other . next_block_hash . into () , masternode : other . masternode . into () , minter : other . minter . into () , minted_blocks : other . minted_blocks . into () , stake_modifier : other . stake_modifier . into () , nonutxo : other . nonutxo . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetCodeInput > for super :: types :: EthGetCodeInput { fn from (other : ffi :: EthGetCodeInput) -> Self { super :: types :: EthGetCodeInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetCodeInput > for ffi :: EthGetCodeInput { fn from (other : super :: types :: EthGetCodeInput) -> Self { ffi :: EthGetCodeInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthGetTransactionByBlockNumberAndIndexResult > for super :: types :: EthGetTransactionByBlockNumberAndIndexResult { fn from (other : ffi :: EthGetTransactionByBlockNumberAndIndexResult) -> Self { super :: types :: EthGetTransactionByBlockNumberAndIndexResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByBlockNumberAndIndexResult > for ffi :: EthGetTransactionByBlockNumberAndIndexResult { fn from (other : super :: types :: EthGetTransactionByBlockNumberAndIndexResult) -> Self { ffi :: EthGetTransactionByBlockNumberAndIndexResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: Web3Sha3Input > for super :: types :: Web3Sha3Input { fn from (other : ffi :: Web3Sha3Input) -> Self { super :: types :: Web3Sha3Input { data : other . data . into () , } } } impl From < super :: types :: Web3Sha3Input > for ffi :: Web3Sha3Input { fn from (other : super :: types :: Web3Sha3Input) -> Self { ffi :: Web3Sha3Input { data : other . data . into () , } } } impl From < ffi :: BlockHashResult > for super :: types :: BlockHashResult { fn from (other : ffi :: BlockHashResult) -> Self { super :: types :: BlockHashResult { hash : other . hash . into () , } } } impl From < super :: types :: BlockHashResult > for ffi :: BlockHashResult { fn from (other : super :: types :: BlockHashResult) -> Self { ffi :: BlockHashResult { hash : other . hash . into () , } } } impl From < ffi :: EthSignInput > for super :: types :: EthSignInput { fn from (other : ffi :: EthSignInput) -> Self { super :: types :: EthSignInput { address : other . address . into () , message : other . message . into () , } } } impl From < super :: types :: EthSignInput > for ffi :: EthSignInput { fn from (other : super :: types :: EthSignInput) -> Self { ffi :: EthSignInput { address : other . address . into () , message : other . message . into () , } } } impl From < ffi :: EthGetTransactionByHashInput > for super :: types :: EthGetTransactionByHashInput { fn from (other : ffi :: EthGetTransactionByHashInput) -> Self { super :: types :: EthGetTransactionByHashInput { hash : other . hash . into () , } } } impl From < super :: types :: EthGetTransactionByHashInput > for ffi :: EthGetTransactionByHashInput { fn from (other : super :: types :: EthGetTransactionByHashInput) -> Self { ffi :: EthGetTransactionByHashInput { hash : other . hash . into () , } } } impl From < ffi :: EthGetCompilersResult > for super :: types :: EthGetCompilersResult { fn from (other : ffi :: EthGetCompilersResult) -> Self { super :: types :: EthGetCompilersResult { compilers : other . compilers . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthGetCompilersResult > for ffi :: EthGetCompilersResult { fn from (other : super :: types :: EthGetCompilersResult) -> Self { ffi :: EthGetCompilersResult { compilers : other . compilers . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetTransactionCountResult > for super :: types :: EthGetTransactionCountResult { fn from (other : ffi :: EthGetTransactionCountResult) -> Self { super :: types :: EthGetTransactionCountResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetTransactionCountResult > for ffi :: EthGetTransactionCountResult { fn from (other : super :: types :: EthGetTransactionCountResult) -> Self { ffi :: EthGetTransactionCountResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: EthSendRawTransactionInput > for super :: types :: EthSendRawTransactionInput { fn from (other : ffi :: EthSendRawTransactionInput) -> Self { super :: types :: EthSendRawTransactionInput { transaction : other . transaction . into () , } } } impl From < super :: types :: EthSendRawTransactionInput > for ffi :: EthSendRawTransactionInput { fn from (other : super :: types :: EthSendRawTransactionInput) -> Self { ffi :: EthSendRawTransactionInput { transaction : other . transaction . into () , } } } impl From < ffi :: EthGetBlockByHashInput > for super :: types :: EthGetBlockByHashInput { fn from (other : ffi :: EthGetBlockByHashInput) -> Self { super :: types :: EthGetBlockByHashInput { hash : other . hash . into () , full_transaction : other . full_transaction . into () , } } } impl From < super :: types :: EthGetBlockByHashInput > for ffi :: EthGetBlockByHashInput { fn from (other : super :: types :: EthGetBlockByHashInput) -> Self { ffi :: EthGetBlockByHashInput { hash : other . hash . into () , full_transaction : other . full_transaction . into () , } } } impl From < ffi :: EthSendRawTransactionResult > for super :: types :: EthSendRawTransactionResult { fn from (other : ffi :: EthSendRawTransactionResult) -> Self { super :: types :: EthSendRawTransactionResult { hash : other . hash . into () , } } } impl From < super :: types :: EthSendRawTransactionResult > for ffi :: EthSendRawTransactionResult { fn from (other : super :: types :: EthSendRawTransactionResult) -> Self { ffi :: EthSendRawTransactionResult { hash : other . hash . into () , } } } impl From < ffi :: EthCompileSerpentInput > for super :: types :: EthCompileSerpentInput { fn from (other : ffi :: EthCompileSerpentInput) -> Self { super :: types :: EthCompileSerpentInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileSerpentInput > for ffi :: EthCompileSerpentInput { fn from (other : super :: types :: EthCompileSerpentInput) -> Self { ffi :: EthCompileSerpentInput { code : other . code . into () , } } } impl From < ffi :: NetVersionResult > for super :: types :: NetVersionResult { fn from (other : ffi :: NetVersionResult) -> Self { super :: types :: NetVersionResult { network_version : other . network_version . into () , } } } impl From < super :: types :: NetVersionResult > for ffi :: NetVersionResult { fn from (other : super :: types :: NetVersionResult) -> Self { ffi :: NetVersionResult { network_version : other . network_version . into () , } } } impl From < ffi :: EthGetTransactionReceiptInput > for super :: types :: EthGetTransactionReceiptInput { fn from (other : ffi :: EthGetTransactionReceiptInput) -> Self { super :: types :: EthGetTransactionReceiptInput { transaction_hash : other . transaction_hash . into () , } } } impl From < super :: types :: EthGetTransactionReceiptInput > for ffi :: EthGetTransactionReceiptInput { fn from (other : super :: types :: EthGetTransactionReceiptInput) -> Self { ffi :: EthGetTransactionReceiptInput { transaction_hash : other . transaction_hash . into () , } } } impl From < ffi :: EthHashRateResult > for super :: types :: EthHashRateResult { fn from (other : ffi :: EthHashRateResult) -> Self { super :: types :: EthHashRateResult { hash_rate : other . hash_rate . into () , } } } impl From < super :: types :: EthHashRateResult > for ffi :: EthHashRateResult { fn from (other : super :: types :: EthHashRateResult) -> Self { ffi :: EthHashRateResult { hash_rate : other . hash_rate . into () , } } } impl From < ffi :: Vin > for super :: types :: Vin { fn from (other : ffi :: Vin) -> Self { super :: types :: Vin { txid : other . txid . into () , vout : other . vout . into () , script_sig : Some (other . script_sig . into ()) , sequence : other . sequence . into () , txinwitness : other . txinwitness . into_iter () . map (Into :: into) . collect () , coinbase : other . coinbase . into () , } } } impl From < super :: types :: Vin > for ffi :: Vin { fn from (other : super :: types :: Vin) -> Self { ffi :: Vin { txid : other . txid . into () , vout : other . vout . into () , script_sig : other . script_sig . map (Into :: into) . unwrap_or_default () , sequence : other . sequence . into () , txinwitness : other . txinwitness . into_iter () . map (Into :: into) . collect () , coinbase : other . coinbase . into () , } } } impl From < ffi :: EthSubmitHashrateInput > for super :: types :: EthSubmitHashrateInput { fn from (other : ffi :: EthSubmitHashrateInput) -> Self { super :: types :: EthSubmitHashrateInput { hash_rate : other . hash_rate . into () , id : other . id . into () , } } } impl From < super :: types :: EthSubmitHashrateInput > for ffi :: EthSubmitHashrateInput { fn from (other : super :: types :: EthSubmitHashrateInput) -> Self { ffi :: EthSubmitHashrateInput { hash_rate : other . hash_rate . into () , id : other . id . into () , } } } impl From < ffi :: EthCallInput > for super :: types :: EthCallInput { fn from (other : ffi :: EthCallInput) -> Self { super :: types :: EthCallInput { transaction_info : Some (other . transaction_info . into ()) , block_number : other . block_number . into () , } } } impl From < super :: types :: EthCallInput > for ffi :: EthCallInput { fn from (other : super :: types :: EthCallInput) -> Self { ffi :: EthCallInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , block_number : other . block_number . into () , } } } impl From < ffi :: PubKey > for super :: types :: PubKey { fn from (other : ffi :: PubKey) -> Self { super :: types :: PubKey { field_asm : other . field_asm . into () , hex : other . hex . into () , field_type : other . field_type . into () , req_sigs : other . req_sigs . into () , addresses : other . addresses . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: PubKey > for ffi :: PubKey { fn from (other : super :: types :: PubKey) -> Self { ffi :: PubKey { field_asm : other . field_asm . into () , hex : other . hex . into () , field_type : other . field_type . into () , req_sigs : other . req_sigs . into () , addresses : other . addresses . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetBlockTransactionCountByNumberResult > for super :: types :: EthGetBlockTransactionCountByNumberResult { fn from (other : ffi :: EthGetBlockTransactionCountByNumberResult) -> Self { super :: types :: EthGetBlockTransactionCountByNumberResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByNumberResult > for ffi :: EthGetBlockTransactionCountByNumberResult { fn from (other : super :: types :: EthGetBlockTransactionCountByNumberResult) -> Self { ffi :: EthGetBlockTransactionCountByNumberResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: EthGetUncleByBlockHashAndIndexInput > for super :: types :: EthGetUncleByBlockHashAndIndexInput { fn from (other : ffi :: EthGetUncleByBlockHashAndIndexInput) -> Self { super :: types :: EthGetUncleByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetUncleByBlockHashAndIndexInput > for ffi :: EthGetUncleByBlockHashAndIndexInput { fn from (other : super :: types :: EthGetUncleByBlockHashAndIndexInput) -> Self { ffi :: EthGetUncleByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < ffi :: Web3ClientVersionResult > for super :: types :: Web3ClientVersionResult { fn from (other : ffi :: Web3ClientVersionResult) -> Self { super :: types :: Web3ClientVersionResult { client_version : other . client_version . into () , } } } impl From < super :: types :: Web3ClientVersionResult > for ffi :: Web3ClientVersionResult { fn from (other : super :: types :: Web3ClientVersionResult) -> Self { ffi :: Web3ClientVersionResult { client_version : other . client_version . into () , } } } impl From < ffi :: EthGetTransactionByBlockHashAndIndexResult > for super :: types :: EthGetTransactionByBlockHashAndIndexResult { fn from (other : ffi :: EthGetTransactionByBlockHashAndIndexResult) -> Self { super :: types :: EthGetTransactionByBlockHashAndIndexResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByBlockHashAndIndexResult > for ffi :: EthGetTransactionByBlockHashAndIndexResult { fn from (other : super :: types :: EthGetTransactionByBlockHashAndIndexResult) -> Self { ffi :: EthGetTransactionByBlockHashAndIndexResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthSubmitWorkInput > for super :: types :: EthSubmitWorkInput { fn from (other : ffi :: EthSubmitWorkInput) -> Self { super :: types :: EthSubmitWorkInput { nounce : other . nounce . into () , pow_hash : other . pow_hash . into () , mix_digest : other . mix_digest . into () , } } } impl From < super :: types :: EthSubmitWorkInput > for ffi :: EthSubmitWorkInput { fn from (other : super :: types :: EthSubmitWorkInput) -> Self { ffi :: EthSubmitWorkInput { nounce : other . nounce . into () , pow_hash : other . pow_hash . into () , mix_digest : other . mix_digest . into () , } } } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Accounts (client : & Box < Client >) -> Result < ffi :: EthAccountsResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthAccountsResult , _ > = c . request ("eth_accounts" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Call (client : & Box < Client > , eth_call_input : EthCallInput) -> Result < ffi :: EthCallResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_call_input = super :: types :: EthCallInput :: from (eth_call_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_call_input . transaction_info , & eth_call_input . block_number] ; let resp : Result < super :: types :: EthCallResult , _ > = c . request ("eth_call" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBalance (client : & Box < Client > , eth_get_balance_input : EthGetBalanceInput) -> Result < ffi :: EthGetBalanceResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_balance_input = super :: types :: EthGetBalanceInput :: from (eth_get_balance_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_balance_input . address , & eth_get_balance_input . block_number] ; let resp : Result < super :: types :: EthGetBalanceResult , _ > = c . request ("eth_getbalance" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByHash (client : & Box < Client > , eth_get_block_by_hash_input : EthGetBlockByHashInput) -> Result < ffi :: EthBlockInfo , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_block_by_hash_input = super :: types :: EthGetBlockByHashInput :: from (eth_get_block_by_hash_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_block_by_hash_input . hash , & eth_get_block_by_hash_input . full_transaction] ; let resp : Result < super :: types :: EthBlockInfo , _ > = c . request ("eth_getblockbyhash" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_ChainId (client : & Box < Client >) -> Result < ffi :: EthChainIdResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthChainIdResult , _ > = c . request ("eth_chainid" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallNet_Version (client : & Box < Client >) -> Result < ffi :: EthChainIdResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthChainIdResult , _ > = c . request ("net_version" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_BlockNumber (client : & Box < Client >) -> Result < ffi :: EthBlockNumberResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthBlockNumberResult , _ > = c . request ("eth_blocknumber" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByNumber (client : & Box < Client > , eth_get_block_by_number_input : EthGetBlockByNumberInput) -> Result < ffi :: EthBlockInfo , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_block_by_number_input = super :: types :: EthGetBlockByNumberInput :: from (eth_get_block_by_number_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_block_by_number_input . number , & eth_get_block_by_number_input . full_transaction] ; let resp : Result < super :: types :: EthBlockInfo , _ > = c . request ("eth_getblockbynumber" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Mining (client : & Box < Client >) -> Result < ffi :: EthMiningResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthMiningResult , _ > = c . request ("eth_mining" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) }# [derive (Clone)] pub struct BlockchainService { adapter : Arc < Handlers > } impl BlockchainService { # [inline] # [allow (dead_code)] pub fn new (adapter : Arc < Handlers >) -> BlockchainService { BlockchainService { adapter } } # [inline] # [allow (dead_code)] pub fn service (& self) -> blockchain_server :: BlockchainServer < BlockchainService > { blockchain_server :: BlockchainServer :: new (self . clone ()) } # [inline] # [allow (unused_mut , dead_code)] pub fn module (& self) -> Result < jsonrpsee_http_server :: RpcModule < () > , jsonrpsee_core :: Error > { let mut module = jsonrpsee_http_server :: RpcModule :: new (()) ; Ok (module) } } # [tonic :: async_trait] impl blockchain_server :: Blockchain for BlockchainService { # [allow (unused_variables)] async fn get_best_block_hash (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: BlockHashResult > , tonic :: Status > { unimplemented ! () ; } # [allow (unused_variables)] async fn get_block (& self , request : tonic :: Request < super :: types :: BlockInput >) -> Result < tonic :: Response < super :: types :: BlockResult > , tonic :: Status > { unimplemented ! () ; } }# [derive (Clone)] pub struct EthService { adapter : Arc < Handlers > } impl EthService { # [inline] # [allow (dead_code)] pub fn new (adapter : Arc < Handlers >) -> EthService { EthService { adapter } } # [inline] # [allow (dead_code)] pub fn service (& self) -> eth_server :: EthServer < EthService > { eth_server :: EthServer :: new (self . clone ()) } # [inline] # [allow (unused_mut , dead_code)] pub fn module (& self) -> Result < jsonrpsee_http_server :: RpcModule < () > , jsonrpsee_core :: Error > { let mut module = jsonrpsee_http_server :: RpcModule :: new (()) ; let adapter = self . adapter . clone () ; module . register_method ("eth_accounts" , move | _params , _ | { Self :: Eth_Accounts (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_call" , move | _params , _ | { let mut eth_call_input = super :: types :: EthCallInput :: default () ; if _params . is_object () { eth_call_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_call_input . transaction_info = seq . next () . map_err (| _ | missing_param ("transaction_info")) ? ; eth_call_input . block_number = seq . next () . map_err (| _ | missing_param ("block_number")) ? ; } let mut input = eth_call_input . into () ; Self :: Eth_Call (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getbalance" , move | _params , _ | { let mut eth_get_balance_input = super :: types :: EthGetBalanceInput :: default () ; if _params . is_object () { eth_get_balance_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_balance_input . address = seq . next () . map_err (| _ | missing_param ("address")) ? ; eth_get_balance_input . block_number = seq . next () . map_err (| _ | missing_param ("block_number")) ? ; } let mut input = eth_get_balance_input . into () ; Self :: Eth_GetBalance (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getblockbyhash" , move | _params , _ | { let mut eth_get_block_by_hash_input = super :: types :: EthGetBlockByHashInput :: default () ; if _params . is_object () { eth_get_block_by_hash_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_block_by_hash_input . hash = seq . next () . map_err (| _ | missing_param ("hash")) ? ; eth_get_block_by_hash_input . full_transaction = seq . next () . map_err (| _ | missing_param ("full_transaction")) ? ; } let mut input = eth_get_block_by_hash_input . into () ; Self :: Eth_GetBlockByHash (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_chainid" , move | _params , _ | { Self :: Eth_ChainId (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("net_version" , move | _params , _ | { Self :: Net_Version (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_blocknumber" , move | _params , _ | { Self :: Eth_BlockNumber (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getblockbynumber" , move | _params , _ | { let mut eth_get_block_by_number_input = super :: types :: EthGetBlockByNumberInput :: default () ; if _params . is_object () { eth_get_block_by_number_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_block_by_number_input . number = seq . next () . map_err (| _ | missing_param ("number")) ? ; eth_get_block_by_number_input . full_transaction = seq . next () . map_err (| _ | missing_param ("full_transaction")) ? ; } let mut input = eth_get_block_by_number_input . into () ; Self :: Eth_GetBlockByNumber (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_mining" , move | _params , _ | { Self :: Eth_Mining (adapter . clone () ,) }) ? ; Ok (module) } } # [tonic :: async_trait] impl eth_server :: Eth for EthService { async fn eth_accounts (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthAccountsResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_Accounts (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_call (& self , request : tonic :: Request < super :: types :: EthCallInput >) -> Result < tonic :: Response < super :: types :: EthCallResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_Call (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_balance (& self , request : tonic :: Request < super :: types :: EthGetBalanceInput >) -> Result < tonic :: Response < super :: types :: EthGetBalanceResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBalance (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_block_by_hash (& self , request : tonic :: Request < super :: types :: EthGetBlockByHashInput >) -> Result < tonic :: Response < super :: types :: EthBlockInfo > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBlockByHash (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } # [allow (unused_variables)] async fn eth_send_transaction (& self , request : tonic :: Request < super :: types :: EthSendTransactionInput >) -> Result < tonic :: Response < super :: types :: EthSendTransactionResult > , tonic :: Status > { unimplemented ! () ; } async fn eth_chain_id (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthChainIdResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_ChainId (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn net_version (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthChainIdResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Net_Version (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_block_number (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthBlockNumberResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_BlockNumber (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_block_by_number (& self , request : tonic :: Request < super :: types :: EthGetBlockByNumberInput >) -> Result < tonic :: Response < super :: types :: EthBlockInfo > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBlockByNumber (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_mining (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthMiningResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_Mining (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } } \ No newline at end of file diff --git a/src/rust/ain-grpc/src/gen/types.rs b/src/rust/ain-grpc/src/gen/types.rs index bd8227bae5..b5aefd45ec 100644 --- a/src/rust/ain-grpc/src/gen/types.rs +++ b/src/rust/ain-grpc/src/gen/types.rs @@ -1 +1,1167 @@ -fn ignore_integer < T : num_traits :: PrimInt + num_traits :: Signed + num_traits :: NumCast > (i : & T) -> bool { T :: from (- 1) . unwrap () == * i } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Transaction { # [doc = " Transaction hash"] # [prost (string , tag = "1")] pub hash : :: prost :: alloc :: string :: String , # [doc = " Raw transaction data"] # [prost (message , optional , tag = "2")] pub raw : :: core :: option :: Option < RawTransaction > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct RawTransaction { # [doc = " Whether specified block is in the active chain or not (only present with explicit \"blockhash\" argument)"] # [prost (bool , tag = "1")] pub in_active_chain : bool , # [doc = " The serialized, hex-encoded data for 'txid'"] # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub hex : :: prost :: alloc :: string :: String , # [doc = " The transaction id (same as provided)"] # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub txid : :: prost :: alloc :: string :: String , # [doc = " The transaction hash (differs from txid for witness transactions)"] # [prost (string , tag = "4")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , # [doc = " The serialized transaction size"] # [prost (uint32 , tag = "5")] pub size : u32 , # [doc = " The virtual transaction size (differs from size for witness transactions)"] # [prost (uint32 , tag = "6")] pub vsize : u32 , # [doc = " The transaction's weight (between vsize*4-3 and vsize*4)"] # [prost (uint32 , tag = "7")] pub weight : u32 , # [doc = " The transaction version"] # [prost (uint32 , tag = "8")] pub version : u32 , # [doc = " The lock time"] # [prost (uint64 , tag = "9")] pub locktime : u64 , # [doc = " List of inputs"] # [prost (message , repeated , tag = "10")] # [serde (skip_serializing_if = "Vec::is_empty")] pub vin : :: prost :: alloc :: vec :: Vec < Vin > , # [doc = " List of outputs"] # [prost (message , repeated , tag = "11")] # [serde (skip_serializing_if = "Vec::is_empty")] pub vout : :: prost :: alloc :: vec :: Vec < Vout > , # [doc = " The block hash"] # [prost (string , tag = "12")] # [serde (skip_serializing_if = "String::is_empty")] pub blockhash : :: prost :: alloc :: string :: String , # [doc = " The confirmations"] # [prost (string , tag = "13")] # [serde (skip_serializing_if = "String::is_empty")] pub confirmations : :: prost :: alloc :: string :: String , # [doc = " The block time in seconds since UNIX epoch"] # [prost (uint64 , tag = "14")] pub blocktime : u64 , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Vin { # [doc = " The transaction id"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub txid : :: prost :: alloc :: string :: String , # [doc = " The output index"] # [prost (uint32 , tag = "2")] pub vout : u32 , # [doc = " The script signature"] # [prost (message , optional , tag = "3")] pub script_sig : :: core :: option :: Option < ScriptSig > , # [doc = " The script sequence number"] # [prost (uint64 , tag = "4")] pub sequence : u64 , # [doc = " Hex-encoded witness data"] # [prost (string , repeated , tag = "5")] # [serde (skip_serializing_if = "Vec::is_empty")] pub txinwitness : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , # [doc = " DeFiChain fields"] # [prost (string , tag = "51")] # [serde (skip_serializing_if = "String::is_empty")] pub coinbase : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct ScriptSig { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] # [serde (rename = "asm")] pub field_asm : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub hex : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Vout { # [prost (double , tag = "1")] pub value : f64 , # [prost (uint64 , tag = "2")] pub n : u64 , # [prost (message , optional , tag = "3")] pub script_pub_key : :: core :: option :: Option < PubKey > , # [prost (uint64 , tag = "4")] pub token_id : u64 , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct PubKey { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] # [serde (rename = "asm")] pub field_asm : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub hex : :: prost :: alloc :: string :: String , # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] # [serde (rename = "type")] pub field_type : :: prost :: alloc :: string :: String , # [prost (int32 , tag = "4")] # [serde (skip_serializing_if = "ignore_integer")] pub req_sigs : i32 , # [prost (string , repeated , tag = "5")] # [serde (skip_serializing_if = "Vec::is_empty")] pub addresses : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Block { # [doc = " Block hash (same as input, if any)"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , # [doc = " The number of confirmations, or -1 if the block is not on the main chain"] # [prost (int64 , tag = "2")] pub confirmations : i64 , # [doc = " Block size"] # [prost (uint64 , tag = "3")] pub size : u64 , # [doc = " Block size without witness data"] # [prost (uint64 , tag = "4")] pub strippedsize : u64 , # [doc = " The block weight as defined in BIP 141"] # [prost (uint64 , tag = "5")] pub weight : u64 , # [doc = " The block height or index"] # [prost (uint64 , tag = "6")] pub height : u64 , # [doc = " The block version"] # [prost (uint64 , tag = "7")] pub version : u64 , # [doc = " The block version in hex"] # [prost (string , tag = "8")] # [serde (skip_serializing_if = "String::is_empty")] pub version_hex : :: prost :: alloc :: string :: String , # [doc = " The merkle root"] # [prost (string , tag = "9")] # [serde (skip_serializing_if = "String::is_empty")] pub merkleroot : :: prost :: alloc :: string :: String , # [doc = " List of transaction IDs"] # [prost (message , repeated , tag = "10")] # [serde (skip_serializing_if = "Vec::is_empty")] pub tx : :: prost :: alloc :: vec :: Vec < Transaction > , # [doc = " The block time in seconds since UNIX epoch"] # [prost (uint64 , tag = "11")] pub time : u64 , # [doc = " The median block time in seconds since UNIX epoch"] # [prost (uint64 , tag = "12")] pub mediantime : u64 , # [doc = " The nonce used to generate the block (property exists only when PoW is used)"] # [prost (uint64 , tag = "13")] pub nonce : u64 , # [doc = " The bits which represent the target difficulty"] # [prost (string , tag = "14")] # [serde (skip_serializing_if = "String::is_empty")] pub bits : :: prost :: alloc :: string :: String , # [doc = " The difficulty of the block"] # [prost (double , tag = "15")] pub difficulty : f64 , # [doc = " Expected number of hashes required to produce the chain up to this block (in hex)"] # [prost (string , tag = "16")] # [serde (skip_serializing_if = "String::is_empty")] pub chainwork : :: prost :: alloc :: string :: String , # [doc = " Number of transactions in the block"] # [prost (uint32 , tag = "17")] pub n_tx : u32 , # [doc = " The hash of the previous block"] # [prost (string , tag = "18")] # [serde (skip_serializing_if = "String::is_empty")] # [serde (rename = "previousblockhash")] pub previous_block_hash : :: prost :: alloc :: string :: String , # [doc = " The hash of the next block"] # [prost (string , tag = "19")] # [serde (skip_serializing_if = "String::is_empty")] # [serde (rename = "nextblockhash")] pub next_block_hash : :: prost :: alloc :: string :: String , # [doc = " DeFiChain fields"] # [prost (string , tag = "101")] # [serde (skip_serializing_if = "String::is_empty")] pub masternode : :: prost :: alloc :: string :: String , # [prost (string , tag = "102")] # [serde (skip_serializing_if = "String::is_empty")] pub minter : :: prost :: alloc :: string :: String , # [prost (uint64 , tag = "103")] pub minted_blocks : u64 , # [prost (string , tag = "104")] # [serde (skip_serializing_if = "String::is_empty")] pub stake_modifier : :: prost :: alloc :: string :: String , # [prost (message , repeated , tag = "105")] # [serde (skip_serializing_if = "Vec::is_empty")] pub nonutxo : :: prost :: alloc :: vec :: Vec < NonUtxo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "PascalCase")] pub struct NonUtxo { # [prost (double , tag = "1")] pub anchor_reward : f64 , # [prost (double , tag = "2")] pub burnt : f64 , # [prost (double , tag = "3")] pub incentive_funding : f64 , # [prost (double , tag = "4")] pub loan : f64 , # [prost (double , tag = "5")] pub options : f64 , # [prost (double , tag = "6")] pub unknown : f64 , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct BlockInput { # [doc = " Block hash"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub blockhash : :: prost :: alloc :: string :: String , # [doc = " 0 for hex-encoded data, 1 for a json object, and 2 for json object with transaction data [default: 1]"] # [prost (uint32 , tag = "2")] pub verbosity : u32 , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct BlockResult { # [doc = " Hex-encoded data for block hash (for verbosity 0)"] # [prost (string , tag = "1")] pub hash : :: prost :: alloc :: string :: String , # [doc = " Block data (for verbosity 1 and 2)"] # [prost (message , optional , tag = "2")] pub block : :: core :: option :: Option < Block > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct BlockHashResult { # [doc = " Hex-encoded data for block hash"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthAccountsResult { # [doc = " Accounts"] # [prost (string , repeated , tag = "1")] # [serde (skip_serializing_if = "Vec::is_empty")] pub accounts : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthTransactionInfo { # [doc = " The address from which the transaction is sent"] # [prost (string , optional , tag = "1")] pub from : :: core :: option :: Option < :: prost :: alloc :: string :: String > , # [doc = " The address to which the transaction is addressed"] # [prost (string , optional , tag = "2")] pub to : :: core :: option :: Option < :: prost :: alloc :: string :: String > , # [doc = " The integer of gas provided for the transaction execution"] # [prost (uint64 , optional , tag = "3")] pub gas : :: core :: option :: Option < u64 > , # [doc = " The integer of gas price used for each paid gas encoded as hexadecimal"] # [prost (uint64 , optional , tag = "4")] pub price : :: core :: option :: Option < u64 > , # [doc = " The integer of value sent with this transaction encoded as hexadecimal"] # [prost (uint64 , optional , tag = "5")] pub value : :: core :: option :: Option < u64 > , # [doc = " The hash of the method signature and encoded parameters."] # [prost (string , optional , tag = "6")] pub data : :: core :: option :: Option < :: prost :: alloc :: string :: String > , # [doc = " The integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce."] # [prost (uint64 , optional , tag = "7")] pub nonce : :: core :: option :: Option < u64 > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthChainIdResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub id : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthBlockInfo { # [doc = " The block number. null when its pending block."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , # [doc = " Hash of the block. null when its pending block."] # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , # [doc = " Hash of the parent block."] # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub parent_hash : :: prost :: alloc :: string :: String , # [doc = " Hash of the generated proof-of-work. null when its pending block."] # [prost (string , tag = "4")] # [serde (skip_serializing_if = "String::is_empty")] pub nonce : :: prost :: alloc :: string :: String , # [doc = " SHA3 of the uncles data in the block."] # [prost (string , tag = "5")] # [serde (skip_serializing_if = "String::is_empty")] pub sha3_uncles : :: prost :: alloc :: string :: String , # [doc = " The bloom filter for the logs of the block. null when its pending block."] # [prost (string , tag = "6")] # [serde (skip_serializing_if = "String::is_empty")] pub logs_bloom : :: prost :: alloc :: string :: String , # [doc = " The root of the transaction trie of the block."] # [prost (string , tag = "7")] # [serde (skip_serializing_if = "String::is_empty")] pub transactions_root : :: prost :: alloc :: string :: String , # [doc = " The root of the final state trie of the block."] # [prost (string , tag = "8")] # [serde (skip_serializing_if = "String::is_empty")] pub state_root : :: prost :: alloc :: string :: String , # [doc = " The root of the receipts trie of the block."] # [prost (string , tag = "9")] # [serde (skip_serializing_if = "String::is_empty")] pub receipt_root : :: prost :: alloc :: string :: String , # [doc = " The address of the beneficiary to whom the mining rewards were given."] # [prost (string , tag = "10")] # [serde (skip_serializing_if = "String::is_empty")] pub miner : :: prost :: alloc :: string :: String , # [doc = " Integer of the difficulty for this block."] # [prost (string , tag = "11")] # [serde (skip_serializing_if = "String::is_empty")] pub difficulty : :: prost :: alloc :: string :: String , # [doc = " Integer of the total difficulty of the chain until this block."] # [prost (string , tag = "12")] # [serde (skip_serializing_if = "String::is_empty")] pub total_difficulty : :: prost :: alloc :: string :: String , # [doc = " The \"extra data\" field of this block."] # [prost (string , tag = "13")] # [serde (skip_serializing_if = "String::is_empty")] pub extra_data : :: prost :: alloc :: string :: String , # [doc = " Integer the size of this block in bytes."] # [prost (string , tag = "14")] # [serde (skip_serializing_if = "String::is_empty")] pub size : :: prost :: alloc :: string :: String , # [doc = " The maximum gas allowed in this block."] # [prost (string , tag = "15")] # [serde (skip_serializing_if = "String::is_empty")] pub gas_limit : :: prost :: alloc :: string :: String , # [doc = " The total used gas by all transactions in this block."] # [prost (string , tag = "16")] # [serde (skip_serializing_if = "String::is_empty")] pub gas_used : :: prost :: alloc :: string :: String , # [doc = " The unix timestamp for when the block was collated."] # [prost (string , tag = "17")] # [serde (skip_serializing_if = "String::is_empty")] pub timestamps : :: prost :: alloc :: string :: String , # [doc = " Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter."] # [prost (string , repeated , tag = "18")] # [serde (skip_serializing_if = "Vec::is_empty")] pub transactions : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , # [doc = " Array of uncle hashes."] # [prost (string , repeated , tag = "19")] # [serde (skip_serializing_if = "Vec::is_empty")] pub uncles : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthTransactionReceipt { # [doc = " Hash of the transaction."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub transaction_hash : :: prost :: alloc :: string :: String , # [doc = " Integer of the transactions index position in the block."] # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub transaction_index : :: prost :: alloc :: string :: String , # [doc = " Hash of the block where this transaction was in."] # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub block_hash : :: prost :: alloc :: string :: String , # [doc = " Block number where this transaction was in."] # [prost (string , tag = "4")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , # [doc = " Address of the sender."] # [prost (string , tag = "5")] # [serde (skip_serializing_if = "String::is_empty")] pub from : :: prost :: alloc :: string :: String , # [doc = " Address of the receiver. null when its a contract creation transaction."] # [prost (string , tag = "6")] # [serde (skip_serializing_if = "String::is_empty")] pub to : :: prost :: alloc :: string :: String , # [doc = " The total amount of gas used when this transaction was executed in the block."] # [prost (string , tag = "7")] # [serde (skip_serializing_if = "String::is_empty")] pub cumulative_gas_used : :: prost :: alloc :: string :: String , # [doc = " The sum of the base fee and tip paid per unit of gas."] # [prost (string , tag = "8")] # [serde (skip_serializing_if = "String::is_empty")] pub effective_gas_price : :: prost :: alloc :: string :: String , # [doc = " The amount of gas used by this specific transaction alone."] # [prost (string , tag = "9")] # [serde (skip_serializing_if = "String::is_empty")] pub gas_used : :: prost :: alloc :: string :: String , # [doc = " The contract address created, if the transaction was a contract creation, otherwise null."] # [prost (string , tag = "10")] # [serde (skip_serializing_if = "String::is_empty")] pub contract_address : :: prost :: alloc :: string :: String , # [doc = " Array of log objects, which this transaction generated."] # [prost (string , repeated , tag = "11")] # [serde (skip_serializing_if = "Vec::is_empty")] pub logs : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , # [doc = " Bloom filter for light clients to quickly retrieve related logs."] # [prost (string , tag = "12")] # [serde (skip_serializing_if = "String::is_empty")] pub logs_bloom : :: prost :: alloc :: string :: String , # [doc = " Integer of the transaction type, 0x00 for legacy transactions, 0x01 for access list types, 0x02 for dynamic fees. It also returns either :"] # [prost (string , tag = "13")] # [serde (skip_serializing_if = "String::is_empty")] # [serde (rename = "type")] pub field_type : :: prost :: alloc :: string :: String , # [doc = " 32 bytes of post-transaction stateroot (pre Byzantium)"] # [prost (string , optional , tag = "14")] pub root : :: core :: option :: Option < :: prost :: alloc :: string :: String > , # [doc = " Either 1 (success) or 0 (failure)"] # [prost (string , optional , tag = "15")] pub status : :: core :: option :: Option < :: prost :: alloc :: string :: String > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCallInput { # [doc = " Transaction info"] # [prost (message , optional , tag = "1")] pub transaction_info : :: core :: option :: Option < EthTransactionInfo > , # [doc = " Block number in hexadecimal format or the string latest, earliest, pending, safe or finalized"] # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCallResult { # [doc = " The return value of the executed contract method"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub data : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSignInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub address : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub message : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSignResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub signature : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBalanceInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub address : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBalanceResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub balance : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSendTransactionInput { # [prost (message , optional , tag = "1")] pub transaction_info : :: core :: option :: Option < EthTransactionInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSendTransactionResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCoinBaseResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub address : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthMiningResult { # [prost (bool , tag = "1")] pub is_mining : bool , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthHashRateResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash_rate : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGasPriceResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub gas_price : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthBlockNumberResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionCountInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub address : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionCountResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number_transaction : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockTransactionCountByHashInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockTransactionCountByHashResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number_transaction : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockTransactionCountByNumberInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockTransactionCountByNumberResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number_transaction : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleCountByBlockHashInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleCountByBlockHashResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number_uncles : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleCountByBlockNumberInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleCountByBlockNumberResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number_uncles : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetCodeInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub address : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetCodeResult { # [doc = " The code from the given address."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSignTransactionInput { # [prost (message , optional , tag = "1")] pub transaction_info : :: core :: option :: Option < EthTransactionInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSignTransactionResult { # [doc = " The signed transaction object."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub transaction : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSendRawTransactionInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub transaction : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSendRawTransactionResult { # [doc = " The transaction hash, or the zero hash if the transaction is not yet available."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthEstimateGasInput { # [doc = " Transaction info"] # [prost (message , optional , tag = "1")] pub transaction_info : :: core :: option :: Option < EthTransactionInfo > , # [doc = " Block number in hexadecimal format or the string latest, earliest, pending, safe or finalized"] # [prost (string , optional , tag = "2")] pub block_number : :: core :: option :: Option < :: prost :: alloc :: string :: String > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthEstimateGasResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub gas_used : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockByHashInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , # [prost (bool , tag = "2")] pub full_transaction : bool , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockByHashResult { # [prost (message , optional , tag = "1")] pub block_info : :: core :: option :: Option < EthBlockInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockByNumberInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number : :: prost :: alloc :: string :: String , # [prost (bool , tag = "2")] pub full_transaction : bool , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockByNumberResult { # [prost (message , optional , tag = "1")] pub block_info : :: core :: option :: Option < EthBlockInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionByHashInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionByHashResult { # [prost (message , optional , tag = "1")] pub transaction : :: core :: option :: Option < EthTransactionInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionByBlockHashAndIndexInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_hash : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub index : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionByBlockHashAndIndexResult { # [prost (message , optional , tag = "1")] pub transaction : :: core :: option :: Option < EthTransactionInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionByBlockNumberAndIndexInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub index : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionByBlockNumberAndIndexResult { # [prost (message , optional , tag = "1")] pub transaction : :: core :: option :: Option < EthTransactionInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleByBlockHashAndIndexInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_hash : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub index : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleByBlockHashAndIndexResult { # [prost (message , optional , tag = "1")] pub block_info : :: core :: option :: Option < EthBlockInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleByBlockNumberAndIndexInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub index : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleByBlockNumberAndIndexResult { # [prost (message , optional , tag = "1")] pub block_info : :: core :: option :: Option < EthBlockInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetCompilersResult { # [prost (string , repeated , tag = "1")] # [serde (skip_serializing_if = "Vec::is_empty")] pub compilers : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCompileSolidityInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCompileSolidityResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub compiled_code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCompileLllInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCompileLllResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub compiled_code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCompileSerpentInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCompileSerpentResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub compiled_code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthProtocolVersionResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub protocol_version : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Web3Sha3Input { # [doc = " The data to convert into a SHA3 hash"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub data : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Web3Sha3Result { # [doc = " The SHA3 result of the given string."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub data : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct NetPeerCountResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number_peer : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct NetVersionResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub network_version : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Web3ClientVersionResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub client_version : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetWorkResult { # [doc = " Current block header pow-hash"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub currentblock : :: prost :: alloc :: string :: String , # [doc = " The seed hash used for the DAG."] # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub seed_hash : :: prost :: alloc :: string :: String , # [doc = " The boundary condition (\"target\"), 2^256 / difficulty."] # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub target : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSubmitWorkInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub nounce : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub pow_hash : :: prost :: alloc :: string :: String , # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub mix_digest : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSubmitWorkResult { # [prost (bool , tag = "1")] pub is_valid : bool , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSubmitHashrateInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash_rate : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub id : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSubmitHashrateResult { # [prost (bool , tag = "1")] pub is_valid : bool , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetStorageAtInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub address : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub position : :: prost :: alloc :: string :: String , # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetStorageAtResult { # [doc = " The value at this storage position."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub value : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionReceiptInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub transaction_hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionReceiptResult { # [prost (message , optional , tag = "1")] pub transaction_receipt : :: core :: option :: Option < EthTransactionReceipt > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSyncingInfo { # [doc = " The block at which the import started (will only be reset, after the sync reached his head)"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub starting_block : :: prost :: alloc :: string :: String , # [doc = " The current block, same as eth_blockNumber"] # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub current_block : :: prost :: alloc :: string :: String , # [doc = " The estimated highest block"] # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub highest_block : :: prost :: alloc :: string :: String , } # [doc = " TODO make it oneof"] # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSyncingResult { # [prost (bool , optional , tag = "1")] pub status : :: core :: option :: Option < bool > , # [prost (message , optional , tag = "2")] pub sync_info : :: core :: option :: Option < EthSyncingInfo > , } \ No newline at end of file +fn ignore_integer( + i: &T, +) -> bool { + T::from(-1).unwrap() == *i +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct Transaction { + #[doc = " Transaction hash"] + #[prost(string, tag = "1")] + pub hash: ::prost::alloc::string::String, + #[doc = " Raw transaction data"] + #[prost(message, optional, tag = "2")] + pub raw: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct RawTransaction { + #[doc = " Whether specified block is in the active chain or not (only present with explicit \"blockhash\" argument)"] + #[prost(bool, tag = "1")] + pub in_active_chain: bool, + #[doc = " The serialized, hex-encoded data for 'txid'"] + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub hex: ::prost::alloc::string::String, + #[doc = " The transaction id (same as provided)"] + #[prost(string, tag = "3")] + #[serde(skip_serializing_if = "String::is_empty")] + pub txid: ::prost::alloc::string::String, + #[doc = " The transaction hash (differs from txid for witness transactions)"] + #[prost(string, tag = "4")] + #[serde(skip_serializing_if = "String::is_empty")] + pub hash: ::prost::alloc::string::String, + #[doc = " The serialized transaction size"] + #[prost(uint32, tag = "5")] + pub size: u32, + #[doc = " The virtual transaction size (differs from size for witness transactions)"] + #[prost(uint32, tag = "6")] + pub vsize: u32, + #[doc = " The transaction's weight (between vsize*4-3 and vsize*4)"] + #[prost(uint32, tag = "7")] + pub weight: u32, + #[doc = " The transaction version"] + #[prost(uint32, tag = "8")] + pub version: u32, + #[doc = " The lock time"] + #[prost(uint64, tag = "9")] + pub locktime: u64, + #[doc = " List of inputs"] + #[prost(message, repeated, tag = "10")] + #[serde(skip_serializing_if = "Vec::is_empty")] + pub vin: ::prost::alloc::vec::Vec, + #[doc = " List of outputs"] + #[prost(message, repeated, tag = "11")] + #[serde(skip_serializing_if = "Vec::is_empty")] + pub vout: ::prost::alloc::vec::Vec, + #[doc = " The block hash"] + #[prost(string, tag = "12")] + #[serde(skip_serializing_if = "String::is_empty")] + pub blockhash: ::prost::alloc::string::String, + #[doc = " The confirmations"] + #[prost(string, tag = "13")] + #[serde(skip_serializing_if = "String::is_empty")] + pub confirmations: ::prost::alloc::string::String, + #[doc = " The block time in seconds since UNIX epoch"] + #[prost(uint64, tag = "14")] + pub blocktime: u64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct Vin { + #[doc = " The transaction id"] + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub txid: ::prost::alloc::string::String, + #[doc = " The output index"] + #[prost(uint32, tag = "2")] + pub vout: u32, + #[doc = " The script signature"] + #[prost(message, optional, tag = "3")] + pub script_sig: ::core::option::Option, + #[doc = " The script sequence number"] + #[prost(uint64, tag = "4")] + pub sequence: u64, + #[doc = " Hex-encoded witness data"] + #[prost(string, repeated, tag = "5")] + #[serde(skip_serializing_if = "Vec::is_empty")] + pub txinwitness: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[doc = " DeFiChain fields"] + #[prost(string, tag = "51")] + #[serde(skip_serializing_if = "String::is_empty")] + pub coinbase: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct ScriptSig { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + #[serde(rename = "asm")] + pub field_asm: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub hex: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct Vout { + #[prost(double, tag = "1")] + pub value: f64, + #[prost(uint64, tag = "2")] + pub n: u64, + #[prost(message, optional, tag = "3")] + pub script_pub_key: ::core::option::Option, + #[prost(uint64, tag = "4")] + pub token_id: u64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct PubKey { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + #[serde(rename = "asm")] + pub field_asm: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub hex: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + #[serde(skip_serializing_if = "String::is_empty")] + #[serde(rename = "type")] + pub field_type: ::prost::alloc::string::String, + #[prost(int32, tag = "4")] + #[serde(skip_serializing_if = "ignore_integer")] + pub req_sigs: i32, + #[prost(string, repeated, tag = "5")] + #[serde(skip_serializing_if = "Vec::is_empty")] + pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct Block { + #[doc = " Block hash (same as input, if any)"] + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub hash: ::prost::alloc::string::String, + #[doc = " The number of confirmations, or -1 if the block is not on the main chain"] + #[prost(int64, tag = "2")] + pub confirmations: i64, + #[doc = " Block size"] + #[prost(uint64, tag = "3")] + pub size: u64, + #[doc = " Block size without witness data"] + #[prost(uint64, tag = "4")] + pub strippedsize: u64, + #[doc = " The block weight as defined in BIP 141"] + #[prost(uint64, tag = "5")] + pub weight: u64, + #[doc = " The block height or index"] + #[prost(uint64, tag = "6")] + pub height: u64, + #[doc = " The block version"] + #[prost(uint64, tag = "7")] + pub version: u64, + #[doc = " The block version in hex"] + #[prost(string, tag = "8")] + #[serde(skip_serializing_if = "String::is_empty")] + pub version_hex: ::prost::alloc::string::String, + #[doc = " The merkle root"] + #[prost(string, tag = "9")] + #[serde(skip_serializing_if = "String::is_empty")] + pub merkleroot: ::prost::alloc::string::String, + #[doc = " List of transaction IDs"] + #[prost(message, repeated, tag = "10")] + #[serde(skip_serializing_if = "Vec::is_empty")] + pub tx: ::prost::alloc::vec::Vec, + #[doc = " The block time in seconds since UNIX epoch"] + #[prost(uint64, tag = "11")] + pub time: u64, + #[doc = " The median block time in seconds since UNIX epoch"] + #[prost(uint64, tag = "12")] + pub mediantime: u64, + #[doc = " The nonce used to generate the block (property exists only when PoW is used)"] + #[prost(uint64, tag = "13")] + pub nonce: u64, + #[doc = " The bits which represent the target difficulty"] + #[prost(string, tag = "14")] + #[serde(skip_serializing_if = "String::is_empty")] + pub bits: ::prost::alloc::string::String, + #[doc = " The difficulty of the block"] + #[prost(double, tag = "15")] + pub difficulty: f64, + #[doc = " Expected number of hashes required to produce the chain up to this block (in hex)"] + #[prost(string, tag = "16")] + #[serde(skip_serializing_if = "String::is_empty")] + pub chainwork: ::prost::alloc::string::String, + #[doc = " Number of transactions in the block"] + #[prost(uint32, tag = "17")] + pub n_tx: u32, + #[doc = " The hash of the previous block"] + #[prost(string, tag = "18")] + #[serde(skip_serializing_if = "String::is_empty")] + #[serde(rename = "previousblockhash")] + pub previous_block_hash: ::prost::alloc::string::String, + #[doc = " The hash of the next block"] + #[prost(string, tag = "19")] + #[serde(skip_serializing_if = "String::is_empty")] + #[serde(rename = "nextblockhash")] + pub next_block_hash: ::prost::alloc::string::String, + #[doc = " DeFiChain fields"] + #[prost(string, tag = "101")] + #[serde(skip_serializing_if = "String::is_empty")] + pub masternode: ::prost::alloc::string::String, + #[prost(string, tag = "102")] + #[serde(skip_serializing_if = "String::is_empty")] + pub minter: ::prost::alloc::string::String, + #[prost(uint64, tag = "103")] + pub minted_blocks: u64, + #[prost(string, tag = "104")] + #[serde(skip_serializing_if = "String::is_empty")] + pub stake_modifier: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "105")] + #[serde(skip_serializing_if = "Vec::is_empty")] + pub nonutxo: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct NonUtxo { + #[prost(double, tag = "1")] + pub anchor_reward: f64, + #[prost(double, tag = "2")] + pub burnt: f64, + #[prost(double, tag = "3")] + pub incentive_funding: f64, + #[prost(double, tag = "4")] + pub loan: f64, + #[prost(double, tag = "5")] + pub options: f64, + #[prost(double, tag = "6")] + pub unknown: f64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct BlockInput { + #[doc = " Block hash"] + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub blockhash: ::prost::alloc::string::String, + #[doc = " 0 for hex-encoded data, 1 for a json object, and 2 for json object with transaction data [default: 1]"] + #[prost(uint32, tag = "2")] + pub verbosity: u32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct BlockResult { + #[doc = " Hex-encoded data for block hash (for verbosity 0)"] + #[prost(string, tag = "1")] + pub hash: ::prost::alloc::string::String, + #[doc = " Block data (for verbosity 1 and 2)"] + #[prost(message, optional, tag = "2")] + pub block: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct BlockHashResult { + #[doc = " Hex-encoded data for block hash"] + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub hash: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthAccountsResult { + #[doc = " Accounts"] + #[prost(string, repeated, tag = "1")] + #[serde(skip_serializing_if = "Vec::is_empty")] + pub accounts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthTransactionInfo { + #[doc = " The address from which the transaction is sent"] + #[prost(string, optional, tag = "1")] + pub from: ::core::option::Option<::prost::alloc::string::String>, + #[doc = " The address to which the transaction is addressed"] + #[prost(string, optional, tag = "2")] + pub to: ::core::option::Option<::prost::alloc::string::String>, + #[doc = " The integer of gas provided for the transaction execution"] + #[prost(uint64, optional, tag = "3")] + pub gas: ::core::option::Option, + #[doc = " The integer of gas price used for each paid gas encoded as hexadecimal"] + #[prost(uint64, optional, tag = "4")] + pub price: ::core::option::Option, + #[doc = " The integer of value sent with this transaction encoded as hexadecimal"] + #[prost(uint64, optional, tag = "5")] + pub value: ::core::option::Option, + #[doc = " The hash of the method signature and encoded parameters."] + #[prost(string, optional, tag = "6")] + pub data: ::core::option::Option<::prost::alloc::string::String>, + #[doc = " The integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce."] + #[prost(uint64, optional, tag = "7")] + pub nonce: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthChainIdResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthBlockInfo { + #[doc = " The block number. null when its pending block."] + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub block_number: ::prost::alloc::string::String, + #[doc = " Hash of the block. null when its pending block."] + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub hash: ::prost::alloc::string::String, + #[doc = " Hash of the parent block."] + #[prost(string, tag = "3")] + #[serde(skip_serializing_if = "String::is_empty")] + pub parent_hash: ::prost::alloc::string::String, + #[doc = " Hash of the generated proof-of-work. null when its pending block."] + #[prost(string, tag = "4")] + #[serde(skip_serializing_if = "String::is_empty")] + pub nonce: ::prost::alloc::string::String, + #[doc = " SHA3 of the uncles data in the block."] + #[prost(string, tag = "5")] + #[serde(skip_serializing_if = "String::is_empty")] + pub sha3_uncles: ::prost::alloc::string::String, + #[doc = " The bloom filter for the logs of the block. null when its pending block."] + #[prost(string, tag = "6")] + #[serde(skip_serializing_if = "String::is_empty")] + pub logs_bloom: ::prost::alloc::string::String, + #[doc = " The root of the transaction trie of the block."] + #[prost(string, tag = "7")] + #[serde(skip_serializing_if = "String::is_empty")] + pub transactions_root: ::prost::alloc::string::String, + #[doc = " The root of the final state trie of the block."] + #[prost(string, tag = "8")] + #[serde(skip_serializing_if = "String::is_empty")] + pub state_root: ::prost::alloc::string::String, + #[doc = " The root of the receipts trie of the block."] + #[prost(string, tag = "9")] + #[serde(skip_serializing_if = "String::is_empty")] + pub receipt_root: ::prost::alloc::string::String, + #[doc = " The address of the beneficiary to whom the mining rewards were given."] + #[prost(string, tag = "10")] + #[serde(skip_serializing_if = "String::is_empty")] + pub miner: ::prost::alloc::string::String, + #[doc = " Integer of the difficulty for this block."] + #[prost(string, tag = "11")] + #[serde(skip_serializing_if = "String::is_empty")] + pub difficulty: ::prost::alloc::string::String, + #[doc = " Integer of the total difficulty of the chain until this block."] + #[prost(string, tag = "12")] + #[serde(skip_serializing_if = "String::is_empty")] + pub total_difficulty: ::prost::alloc::string::String, + #[doc = " The \"extra data\" field of this block."] + #[prost(string, tag = "13")] + #[serde(skip_serializing_if = "String::is_empty")] + pub extra_data: ::prost::alloc::string::String, + #[doc = " Integer the size of this block in bytes."] + #[prost(string, tag = "14")] + #[serde(skip_serializing_if = "String::is_empty")] + pub size: ::prost::alloc::string::String, + #[doc = " The maximum gas allowed in this block."] + #[prost(string, tag = "15")] + #[serde(skip_serializing_if = "String::is_empty")] + pub gas_limit: ::prost::alloc::string::String, + #[doc = " The total used gas by all transactions in this block."] + #[prost(string, tag = "16")] + #[serde(skip_serializing_if = "String::is_empty")] + pub gas_used: ::prost::alloc::string::String, + #[doc = " The unix timestamp for when the block was collated."] + #[prost(string, tag = "17")] + #[serde(skip_serializing_if = "String::is_empty")] + pub timestamps: ::prost::alloc::string::String, + #[doc = " Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter."] + #[prost(string, repeated, tag = "18")] + #[serde(skip_serializing_if = "Vec::is_empty")] + pub transactions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[doc = " Array of uncle hashes."] + #[prost(string, repeated, tag = "19")] + #[serde(skip_serializing_if = "Vec::is_empty")] + pub uncles: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthTransactionReceipt { + #[doc = " Hash of the transaction."] + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub transaction_hash: ::prost::alloc::string::String, + #[doc = " Integer of the transactions index position in the block."] + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub transaction_index: ::prost::alloc::string::String, + #[doc = " Hash of the block where this transaction was in."] + #[prost(string, tag = "3")] + #[serde(skip_serializing_if = "String::is_empty")] + pub block_hash: ::prost::alloc::string::String, + #[doc = " Block number where this transaction was in."] + #[prost(string, tag = "4")] + #[serde(skip_serializing_if = "String::is_empty")] + pub block_number: ::prost::alloc::string::String, + #[doc = " Address of the sender."] + #[prost(string, tag = "5")] + #[serde(skip_serializing_if = "String::is_empty")] + pub from: ::prost::alloc::string::String, + #[doc = " Address of the receiver. null when its a contract creation transaction."] + #[prost(string, tag = "6")] + #[serde(skip_serializing_if = "String::is_empty")] + pub to: ::prost::alloc::string::String, + #[doc = " The total amount of gas used when this transaction was executed in the block."] + #[prost(string, tag = "7")] + #[serde(skip_serializing_if = "String::is_empty")] + pub cumulative_gas_used: ::prost::alloc::string::String, + #[doc = " The sum of the base fee and tip paid per unit of gas."] + #[prost(string, tag = "8")] + #[serde(skip_serializing_if = "String::is_empty")] + pub effective_gas_price: ::prost::alloc::string::String, + #[doc = " The amount of gas used by this specific transaction alone."] + #[prost(string, tag = "9")] + #[serde(skip_serializing_if = "String::is_empty")] + pub gas_used: ::prost::alloc::string::String, + #[doc = " The contract address created, if the transaction was a contract creation, otherwise null."] + #[prost(string, tag = "10")] + #[serde(skip_serializing_if = "String::is_empty")] + pub contract_address: ::prost::alloc::string::String, + #[doc = " Array of log objects, which this transaction generated."] + #[prost(string, repeated, tag = "11")] + #[serde(skip_serializing_if = "Vec::is_empty")] + pub logs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[doc = " Bloom filter for light clients to quickly retrieve related logs."] + #[prost(string, tag = "12")] + #[serde(skip_serializing_if = "String::is_empty")] + pub logs_bloom: ::prost::alloc::string::String, + #[doc = " Integer of the transaction type, 0x00 for legacy transactions, 0x01 for access list types, 0x02 for dynamic fees. It also returns either :"] + #[prost(string, tag = "13")] + #[serde(skip_serializing_if = "String::is_empty")] + #[serde(rename = "type")] + pub field_type: ::prost::alloc::string::String, + #[doc = " 32 bytes of post-transaction stateroot (pre Byzantium)"] + #[prost(string, optional, tag = "14")] + pub root: ::core::option::Option<::prost::alloc::string::String>, + #[doc = " Either 1 (success) or 0 (failure)"] + #[prost(string, optional, tag = "15")] + pub status: ::core::option::Option<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthCallInput { + #[doc = " Transaction info"] + #[prost(message, optional, tag = "1")] + pub transaction_info: ::core::option::Option, + #[doc = " Block number in hexadecimal format or the string latest, earliest, pending, safe or finalized"] + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub block_number: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthCallResult { + #[doc = " The return value of the executed contract method"] + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub data: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthSignInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub message: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthSignResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub signature: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetBalanceInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub block_number: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetBalanceResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub balance: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthSendTransactionInput { + #[prost(message, optional, tag = "1")] + pub transaction_info: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthSendTransactionResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub hash: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthCoinBaseResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub address: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthMiningResult { + #[prost(bool, tag = "1")] + pub is_mining: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthHashRateResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub hash_rate: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGasPriceResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub gas_price: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthBlockNumberResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub block_number: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetTransactionCountInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub block_number: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetTransactionCountResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub number_transaction: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetBlockTransactionCountByHashInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub block_hash: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetBlockTransactionCountByHashResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub number_transaction: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetBlockTransactionCountByNumberInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub block_number: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetBlockTransactionCountByNumberResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub number_transaction: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetUncleCountByBlockHashInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub block_hash: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetUncleCountByBlockHashResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub number_uncles: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetUncleCountByBlockNumberInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub block_number: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetUncleCountByBlockNumberResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub number_uncles: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetCodeInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub block_number: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetCodeResult { + #[doc = " The code from the given address."] + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub code: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthSignTransactionInput { + #[prost(message, optional, tag = "1")] + pub transaction_info: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthSignTransactionResult { + #[doc = " The signed transaction object."] + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub transaction: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthSendRawTransactionInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub transaction: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthSendRawTransactionResult { + #[doc = " The transaction hash, or the zero hash if the transaction is not yet available."] + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub hash: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthEstimateGasInput { + #[doc = " Transaction info"] + #[prost(message, optional, tag = "1")] + pub transaction_info: ::core::option::Option, + #[doc = " Block number in hexadecimal format or the string latest, earliest, pending, safe or finalized"] + #[prost(string, optional, tag = "2")] + pub block_number: ::core::option::Option<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthEstimateGasResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub gas_used: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetBlockByHashInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub hash: ::prost::alloc::string::String, + #[prost(bool, tag = "2")] + pub full_transaction: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetBlockByHashResult { + #[prost(message, optional, tag = "1")] + pub block_info: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetBlockByNumberInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub number: ::prost::alloc::string::String, + #[prost(bool, tag = "2")] + pub full_transaction: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetBlockByNumberResult { + #[prost(message, optional, tag = "1")] + pub block_info: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetTransactionByHashInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub hash: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetTransactionByHashResult { + #[prost(message, optional, tag = "1")] + pub transaction: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetTransactionByBlockHashAndIndexInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub block_hash: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub index: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetTransactionByBlockHashAndIndexResult { + #[prost(message, optional, tag = "1")] + pub transaction: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetTransactionByBlockNumberAndIndexInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub block_number: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub index: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetTransactionByBlockNumberAndIndexResult { + #[prost(message, optional, tag = "1")] + pub transaction: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetUncleByBlockHashAndIndexInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub block_hash: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub index: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetUncleByBlockHashAndIndexResult { + #[prost(message, optional, tag = "1")] + pub block_info: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetUncleByBlockNumberAndIndexInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub block_number: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub index: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetUncleByBlockNumberAndIndexResult { + #[prost(message, optional, tag = "1")] + pub block_info: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetCompilersResult { + #[prost(string, repeated, tag = "1")] + #[serde(skip_serializing_if = "Vec::is_empty")] + pub compilers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthCompileSolidityInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub code: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthCompileSolidityResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub compiled_code: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthCompileLllInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub code: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthCompileLllResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub compiled_code: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthCompileSerpentInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub code: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthCompileSerpentResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub compiled_code: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthProtocolVersionResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub protocol_version: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct Web3Sha3Input { + #[doc = " The data to convert into a SHA3 hash"] + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub data: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct Web3Sha3Result { + #[doc = " The SHA3 result of the given string."] + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub data: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct NetPeerCountResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub number_peer: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct NetVersionResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub network_version: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct Web3ClientVersionResult { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub client_version: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetWorkResult { + #[doc = " Current block header pow-hash"] + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub currentblock: ::prost::alloc::string::String, + #[doc = " The seed hash used for the DAG."] + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub seed_hash: ::prost::alloc::string::String, + #[doc = " The boundary condition (\"target\"), 2^256 / difficulty."] + #[prost(string, tag = "3")] + #[serde(skip_serializing_if = "String::is_empty")] + pub target: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthSubmitWorkInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub nounce: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub pow_hash: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + #[serde(skip_serializing_if = "String::is_empty")] + pub mix_digest: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthSubmitWorkResult { + #[prost(bool, tag = "1")] + pub is_valid: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthSubmitHashrateInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub hash_rate: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthSubmitHashrateResult { + #[prost(bool, tag = "1")] + pub is_valid: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetStorageAtInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub position: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + #[serde(skip_serializing_if = "String::is_empty")] + pub block_number: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetStorageAtResult { + #[doc = " The value at this storage position."] + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub value: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetTransactionReceiptInput { + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub transaction_hash: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthGetTransactionReceiptResult { + #[prost(message, optional, tag = "1")] + pub transaction_receipt: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthSyncingInfo { + #[doc = " The block at which the import started (will only be reset, after the sync reached his head)"] + #[prost(string, tag = "1")] + #[serde(skip_serializing_if = "String::is_empty")] + pub starting_block: ::prost::alloc::string::String, + #[doc = " The current block, same as eth_blockNumber"] + #[prost(string, tag = "2")] + #[serde(skip_serializing_if = "String::is_empty")] + pub current_block: ::prost::alloc::string::String, + #[doc = " The estimated highest block"] + #[prost(string, tag = "3")] + #[serde(skip_serializing_if = "String::is_empty")] + pub highest_block: ::prost::alloc::string::String, +} +#[doc = " TODO make it oneof"] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(clippy::derive_partial_eq_without_eq)] +pub struct EthSyncingResult { + #[prost(bool, optional, tag = "1")] + pub status: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub sync_info: ::core::option::Option, +} diff --git a/src/rust/ain-grpc/src/rpc.rs b/src/rust/ain-grpc/src/rpc.rs index 751378f35b..d63d5c9e69 100644 --- a/src/rust/ain-grpc/src/rpc.rs +++ b/src/rust/ain-grpc/src/rpc.rs @@ -11,6 +11,7 @@ use primitive_types::{H256, U256}; use std::mem::size_of_val; use std::sync::Arc; +#[allow(non_snake_case)] pub trait EthServiceApi { // Read only call fn Eth_Call( @@ -205,7 +206,7 @@ impl EthServiceApi for EthService { }) } - fn Eth_Mining(handler: Arc) -> Result { + fn Eth_Mining(_handler: Arc) -> Result { let mining = ain_cpp_exports::is_mining().unwrap(); Ok(EthMiningResult { is_mining: mining }) diff --git a/src/rust/ain-grpc/src/tests.rs b/src/rust/ain-grpc/src/tests.rs index 7d368f926b..a964dfc167 100644 --- a/src/rust/ain-grpc/src/tests.rs +++ b/src/rust/ain-grpc/src/tests.rs @@ -87,7 +87,7 @@ fn should_get_block_by_hash() { handler.block.connect_block(block.clone()); let binding = handler.block.block_map.read().unwrap(); - let bno = binding.get(&block.header.hash()).unwrap(); + let _bno = binding.get(&block.header.hash()).unwrap(); let input = EthGetBlockByHashInput { hash: format!("{:x}", block.header.hash()), diff --git a/src/rust/ain-rs-exports/build.rs b/src/rust/ain-rs-exports/build.rs index 8e1e0962ad..cd7f6c5548 100644 --- a/src/rust/ain-rs-exports/build.rs +++ b/src/rust/ain-rs-exports/build.rs @@ -6,7 +6,7 @@ use std::io::{Read, Write}; use std::path::PathBuf; fn main() { - let pkg_name = env::var("CARGO_PKG_NAME").unwrap(); + let _pkg_name = env::var("CARGO_PKG_NAME").unwrap(); let manifest_path = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()); // TODO: Use root path to force re-run during development @@ -14,7 +14,7 @@ fn main() { println!("cargo:rerun-if-changed=.git/HEAD"); } - let mut target_dir = if let Ok(v) = env::var("BUILD_DIR") { + let target_dir = if let Ok(v) = env::var("BUILD_DIR") { PathBuf::from(v) } else { manifest_path.clone() From 3be300917402fb86562878bcd97fed271476a5ba Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Thu, 13 Apr 2023 15:51:09 +0800 Subject: [PATCH 3/6] Resolve all warning, rename to cpp-imports --- src/rust/Cargo.lock | 4 +- src/rust/Makefile.am | 8 +- .../.gitignore | 0 .../Cargo.toml | 2 +- .../build.rs.disabled | 0 .../src/lib.rs | 0 src/rust/ain-grpc/Cargo.toml | 2 +- src/rust/ain-grpc/build.rs | 2 +- src/rust/ain-grpc/src/gen/rpc.rs | 2 +- src/rust/ain-grpc/src/gen/types.rs | 1168 +---------------- src/rust/ain-grpc/src/rpc.rs | 6 +- src/rust/ain-rs-exports/build.rs | 6 +- 12 files changed, 17 insertions(+), 1183 deletions(-) rename src/rust/{ain-cpp-exports => ain-cpp-imports}/.gitignore (100%) rename src/rust/{ain-cpp-exports => ain-cpp-imports}/Cargo.toml (89%) rename src/rust/{ain-cpp-exports => ain-cpp-imports}/build.rs.disabled (100%) rename src/rust/{ain-cpp-exports => ain-cpp-imports}/src/lib.rs (100%) diff --git a/src/rust/Cargo.lock b/src/rust/Cargo.lock index a025ead0cd..d6037eaef8 100644 --- a/src/rust/Cargo.lock +++ b/src/rust/Cargo.lock @@ -12,7 +12,7 @@ dependencies = [ ] [[package]] -name = "ain-cpp-exports" +name = "ain-cpp-imports" version = "0.1.0" dependencies = [ "cxx", @@ -46,7 +46,7 @@ dependencies = [ name = "ain-grpc" version = "0.1.0" dependencies = [ - "ain-cpp-exports", + "ain-cpp-imports", "ain-evm", "cxx", "cxx-gen", diff --git a/src/rust/Makefile.am b/src/rust/Makefile.am index dd4138679c..6178bfe461 100644 --- a/src/rust/Makefile.am +++ b/src/rust/Makefile.am @@ -9,12 +9,12 @@ all: build-evm-pkg build-grpc-pkg .PHONY: build-evm-pkg: build-grpc-pkg @cd $(abs_srcdir) && \ - CRATE_CC_NO_DEFAULTS=1 BUILD_DIR="$(abs_builddir)" $(CARGO) build --package ain-evm-ffi \ + CRATE_CC_NO_DEFAULTS=1 BUILD_DIR="$(abs_builddir)" $(CARGO) build --package ain-rs-exports \ --release $(if $(RUST_TARGET),--target $(RUST_TARGET),) --target-dir $(abs_builddir)/target && \ mkdir -p $(abs_builddir)/{include,lib,src} && \ - cp $(abs_builddir)/target/$(RUST_TARGET)/release/libain_evm_ffi.a $(abs_builddir)/lib/ && \ - cp $(abs_builddir)/libain_evm.h $(abs_builddir)/include/ && \ - cp $(abs_builddir)/libain_evm.cpp $(abs_builddir)/src/libain_evm.cpp + cp $(abs_builddir)/target/$(RUST_TARGET)/release/libain_rs_exports.a $(abs_builddir)/lib/ && \ + cp $(abs_builddir)/libain_rs_exports.h $(abs_builddir)/include/ && \ + cp $(abs_builddir)/libain_rs_exports.cpp $(abs_builddir)/src/libain_evm.cpp .PHONY: build-grpc-pkg: diff --git a/src/rust/ain-cpp-exports/.gitignore b/src/rust/ain-cpp-imports/.gitignore similarity index 100% rename from src/rust/ain-cpp-exports/.gitignore rename to src/rust/ain-cpp-imports/.gitignore diff --git a/src/rust/ain-cpp-exports/Cargo.toml b/src/rust/ain-cpp-imports/Cargo.toml similarity index 89% rename from src/rust/ain-cpp-exports/Cargo.toml rename to src/rust/ain-cpp-imports/Cargo.toml index 16aa99980d..e5b21cb865 100644 --- a/src/rust/ain-cpp-exports/Cargo.toml +++ b/src/rust/ain-cpp-imports/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "ain-cpp-exports" +name = "ain-cpp-imports" version = "0.1.0" edition = "2021" diff --git a/src/rust/ain-cpp-exports/build.rs.disabled b/src/rust/ain-cpp-imports/build.rs.disabled similarity index 100% rename from src/rust/ain-cpp-exports/build.rs.disabled rename to src/rust/ain-cpp-imports/build.rs.disabled diff --git a/src/rust/ain-cpp-exports/src/lib.rs b/src/rust/ain-cpp-imports/src/lib.rs similarity index 100% rename from src/rust/ain-cpp-exports/src/lib.rs rename to src/rust/ain-cpp-imports/src/lib.rs diff --git a/src/rust/ain-grpc/Cargo.toml b/src/rust/ain-grpc/Cargo.toml index d5751b265e..dd1aed9d99 100644 --- a/src/rust/ain-grpc/Cargo.toml +++ b/src/rust/ain-grpc/Cargo.toml @@ -6,7 +6,7 @@ build = "build.rs" [dependencies] ain-evm = { path = "../ain-evm" } -ain-cpp-exports = { path = "../ain-cpp-exports" } +ain-cpp-imports = { path = "../ain-cpp-imports" } cxx = "1.0" env_logger = "0.9" jsonrpsee-core = "0.15" diff --git a/src/rust/ain-grpc/build.rs b/src/rust/ain-grpc/build.rs index 435f9d9d0e..c9f0c26be4 100644 --- a/src/rust/ain-grpc/build.rs +++ b/src/rust/ain-grpc/build.rs @@ -298,7 +298,7 @@ fn modify_codegen( "e!( #[derive(Clone)] pub struct #service { - adapter: Arc + #[allow(dead_code)] adapter: Arc } impl #service { diff --git a/src/rust/ain-grpc/src/gen/rpc.rs b/src/rust/ain-grpc/src/gen/rpc.rs index c023541ff3..a8a86730d4 100644 --- a/src/rust/ain-grpc/src/gen/rpc.rs +++ b/src/rust/ain-grpc/src/gen/rpc.rs @@ -745,4 +745,4 @@ pub mod eth_server { pub mod ffi { # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Transaction { pub hash : String , pub raw : RawTransaction , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct RawTransaction { pub in_active_chain : bool , pub hex : String , pub txid : String , pub hash : String , pub size : u32 , pub vsize : u32 , pub weight : u32 , pub version : u32 , pub locktime : u64 , pub vin : Vec < Vin > , pub vout : Vec < Vout > , pub blockhash : String , pub confirmations : String , pub blocktime : u64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Vin { pub txid : String , pub vout : u32 , pub script_sig : ScriptSig , pub sequence : u64 , pub txinwitness : Vec < String > , pub coinbase : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct ScriptSig { pub field_asm : String , pub hex : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Vout { pub value : f64 , pub n : u64 , pub script_pub_key : PubKey , pub token_id : u64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct PubKey { pub field_asm : String , pub hex : String , pub field_type : String , pub req_sigs : i32 , pub addresses : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Block { pub hash : String , pub confirmations : i64 , pub size : u64 , pub strippedsize : u64 , pub weight : u64 , pub height : u64 , pub version : u64 , pub version_hex : String , pub merkleroot : String , pub tx : Vec < Transaction > , pub time : u64 , pub mediantime : u64 , pub nonce : u64 , pub bits : String , pub difficulty : f64 , pub chainwork : String , pub n_tx : u32 , pub previous_block_hash : String , pub next_block_hash : String , pub masternode : String , pub minter : String , pub minted_blocks : u64 , pub stake_modifier : String , pub nonutxo : Vec < NonUtxo > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct NonUtxo { pub anchor_reward : f64 , pub burnt : f64 , pub incentive_funding : f64 , pub loan : f64 , pub options : f64 , pub unknown : f64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct BlockInput { pub blockhash : String , pub verbosity : u32 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct BlockResult { pub hash : String , pub block : Block , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct BlockHashResult { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthAccountsResult { pub accounts : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthTransactionInfo { pub from : String , pub to : String , pub gas : u64 , pub price : u64 , pub value : u64 , pub data : String , pub nonce : u64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthChainIdResult { pub id : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthBlockInfo { pub block_number : String , pub hash : String , pub parent_hash : String , pub nonce : String , pub sha3_uncles : String , pub logs_bloom : String , pub transactions_root : String , pub state_root : String , pub receipt_root : String , pub miner : String , pub difficulty : String , pub total_difficulty : String , pub extra_data : String , pub size : String , pub gas_limit : String , pub gas_used : String , pub timestamps : String , pub transactions : Vec < String > , pub uncles : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthTransactionReceipt { pub transaction_hash : String , pub transaction_index : String , pub block_hash : String , pub block_number : String , pub from : String , pub to : String , pub cumulative_gas_used : String , pub effective_gas_price : String , pub gas_used : String , pub contract_address : String , pub logs : Vec < String > , pub logs_bloom : String , pub field_type : String , pub root : String , pub status : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCallInput { pub transaction_info : EthTransactionInfo , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCallResult { pub data : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignInput { pub address : String , pub message : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignResult { pub signature : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBalanceInput { pub address : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBalanceResult { pub balance : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendTransactionInput { pub transaction_info : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendTransactionResult { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCoinBaseResult { pub address : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthMiningResult { pub is_mining : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthHashRateResult { pub hash_rate : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGasPriceResult { pub gas_price : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthBlockNumberResult { pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionCountInput { pub address : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionCountResult { pub number_transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByHashInput { pub block_hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByHashResult { pub number_transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByNumberInput { pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByNumberResult { pub number_transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockHashInput { pub block_hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockHashResult { pub number_uncles : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockNumberInput { pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockNumberResult { pub number_uncles : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetCodeInput { pub address : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetCodeResult { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignTransactionInput { pub transaction_info : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignTransactionResult { pub transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendRawTransactionInput { pub transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendRawTransactionResult { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthEstimateGasInput { pub transaction_info : EthTransactionInfo , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthEstimateGasResult { pub gas_used : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByHashInput { pub hash : String , pub full_transaction : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByHashResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByNumberInput { pub number : String , pub full_transaction : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByNumberResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByHashInput { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByHashResult { pub transaction : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockHashAndIndexInput { pub block_hash : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockHashAndIndexResult { pub transaction : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockNumberAndIndexInput { pub block_number : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockNumberAndIndexResult { pub transaction : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockHashAndIndexInput { pub block_hash : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockHashAndIndexResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockNumberAndIndexInput { pub block_number : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockNumberAndIndexResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetCompilersResult { pub compilers : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSolidityInput { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSolidityResult { pub compiled_code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileLllInput { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileLllResult { pub compiled_code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSerpentInput { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSerpentResult { pub compiled_code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthProtocolVersionResult { pub protocol_version : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Web3Sha3Input { pub data : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Web3Sha3Result { pub data : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct NetPeerCountResult { pub number_peer : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct NetVersionResult { pub network_version : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Web3ClientVersionResult { pub client_version : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetWorkResult { pub currentblock : String , pub seed_hash : String , pub target : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitWorkInput { pub nounce : String , pub pow_hash : String , pub mix_digest : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitWorkResult { pub is_valid : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitHashrateInput { pub hash_rate : String , pub id : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitHashrateResult { pub is_valid : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetStorageAtInput { pub address : String , pub position : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetStorageAtResult { pub value : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionReceiptInput { pub transaction_hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionReceiptResult { pub transaction_receipt : EthTransactionReceipt , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSyncingInfo { pub starting_block : String , pub current_block : String , pub highest_block : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSyncingResult { pub status : bool , pub sync_info : EthSyncingInfo , } extern "Rust" { type Client ; fn NewClient (addr : & str) -> Result < Box < Client >> ; # [allow (clippy :: borrowed_box)] fn CallEth_Accounts (client : & Box < Client >) -> Result < EthAccountsResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_Call (client : & Box < Client > , eth_call_input : EthCallInput) -> Result < EthCallResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_GetBalance (client : & Box < Client > , eth_get_balance_input : EthGetBalanceInput) -> Result < EthGetBalanceResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByHash (client : & Box < Client > , eth_get_block_by_hash_input : EthGetBlockByHashInput) -> Result < EthBlockInfo > ; # [allow (clippy :: borrowed_box)] fn CallEth_ChainId (client : & Box < Client >) -> Result < EthChainIdResult > ; # [allow (clippy :: borrowed_box)] fn CallNet_Version (client : & Box < Client >) -> Result < EthChainIdResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_BlockNumber (client : & Box < Client >) -> Result < EthBlockNumberResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByNumber (client : & Box < Client > , eth_get_block_by_number_input : EthGetBlockByNumberInput) -> Result < EthBlockInfo > ; # [allow (clippy :: borrowed_box)] fn CallEth_Mining (client : & Box < Client >) -> Result < EthMiningResult > ; } } -use jsonrpsee_core :: client :: ClientT ; use jsonrpsee_http_client :: { HttpClient , HttpClientBuilder } ; use std :: sync :: Arc ; use crate :: { CLIENTS } ; use ain_evm :: runtime :: RUNTIME ; use crate :: rpc :: * ; # [allow (unused_imports)] use self :: ffi :: * ; use ain_evm :: handler :: Handlers ; # [derive (Clone)] pub struct Client { inner : Arc < HttpClient > , handle : tokio :: runtime :: Handle , } # [allow (non_snake_case)] fn NewClient (addr : & str) -> Result < Box < Client > , Box < dyn std :: error :: Error >> { if CLIENTS . read () . unwrap () . get (addr) . is_none () { log :: info ! ("Initializing RPC client for {}" , addr) ; let c = Client { inner : Arc :: new (HttpClientBuilder :: default () . build (addr) ?) , handle : RUNTIME . rt_handle . clone () , } ; CLIENTS . write () . unwrap () . insert (addr . into () , c) ; } Ok (Box :: new (CLIENTS . read () . unwrap () . get (addr) . unwrap () . clone ())) } # [allow (dead_code)] fn missing_param (field : & str) -> jsonrpsee_core :: Error { jsonrpsee_core :: Error :: Call (jsonrpsee_types :: error :: CallError :: Custom (jsonrpsee_types :: ErrorObject :: borrowed (- 1 , & format ! ("Missing required parameter '{field}'") , None) . into_owned ())) } impl From < ffi :: EthGetBlockByHashResult > for super :: types :: EthGetBlockByHashResult { fn from (other : ffi :: EthGetBlockByHashResult) -> Self { super :: types :: EthGetBlockByHashResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetBlockByHashResult > for ffi :: EthGetBlockByHashResult { fn from (other : super :: types :: EthGetBlockByHashResult) -> Self { ffi :: EthGetBlockByHashResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthCompileLllInput > for super :: types :: EthCompileLllInput { fn from (other : ffi :: EthCompileLllInput) -> Self { super :: types :: EthCompileLllInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileLllInput > for ffi :: EthCompileLllInput { fn from (other : super :: types :: EthCompileLllInput) -> Self { ffi :: EthCompileLllInput { code : other . code . into () , } } } impl From < ffi :: EthBlockInfo > for super :: types :: EthBlockInfo { fn from (other : ffi :: EthBlockInfo) -> Self { super :: types :: EthBlockInfo { block_number : other . block_number . into () , hash : other . hash . into () , parent_hash : other . parent_hash . into () , nonce : other . nonce . into () , sha3_uncles : other . sha3_uncles . into () , logs_bloom : other . logs_bloom . into () , transactions_root : other . transactions_root . into () , state_root : other . state_root . into () , receipt_root : other . receipt_root . into () , miner : other . miner . into () , difficulty : other . difficulty . into () , total_difficulty : other . total_difficulty . into () , extra_data : other . extra_data . into () , size : other . size . into () , gas_limit : other . gas_limit . into () , gas_used : other . gas_used . into () , timestamps : other . timestamps . into () , transactions : other . transactions . into_iter () . map (Into :: into) . collect () , uncles : other . uncles . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthBlockInfo > for ffi :: EthBlockInfo { fn from (other : super :: types :: EthBlockInfo) -> Self { ffi :: EthBlockInfo { block_number : other . block_number . into () , hash : other . hash . into () , parent_hash : other . parent_hash . into () , nonce : other . nonce . into () , sha3_uncles : other . sha3_uncles . into () , logs_bloom : other . logs_bloom . into () , transactions_root : other . transactions_root . into () , state_root : other . state_root . into () , receipt_root : other . receipt_root . into () , miner : other . miner . into () , difficulty : other . difficulty . into () , total_difficulty : other . total_difficulty . into () , extra_data : other . extra_data . into () , size : other . size . into () , gas_limit : other . gas_limit . into () , gas_used : other . gas_used . into () , timestamps : other . timestamps . into () , transactions : other . transactions . into_iter () . map (Into :: into) . collect () , uncles : other . uncles . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthChainIdResult > for super :: types :: EthChainIdResult { fn from (other : ffi :: EthChainIdResult) -> Self { super :: types :: EthChainIdResult { id : other . id . into () , } } } impl From < super :: types :: EthChainIdResult > for ffi :: EthChainIdResult { fn from (other : super :: types :: EthChainIdResult) -> Self { ffi :: EthChainIdResult { id : other . id . into () , } } } impl From < ffi :: Transaction > for super :: types :: Transaction { fn from (other : ffi :: Transaction) -> Self { super :: types :: Transaction { hash : other . hash . into () , raw : Some (other . raw . into ()) , } } } impl From < super :: types :: Transaction > for ffi :: Transaction { fn from (other : super :: types :: Transaction) -> Self { ffi :: Transaction { hash : other . hash . into () , raw : other . raw . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthSignTransactionResult > for super :: types :: EthSignTransactionResult { fn from (other : ffi :: EthSignTransactionResult) -> Self { super :: types :: EthSignTransactionResult { transaction : other . transaction . into () , } } } impl From < super :: types :: EthSignTransactionResult > for ffi :: EthSignTransactionResult { fn from (other : super :: types :: EthSignTransactionResult) -> Self { ffi :: EthSignTransactionResult { transaction : other . transaction . into () , } } } impl From < ffi :: EthGetBlockByNumberResult > for super :: types :: EthGetBlockByNumberResult { fn from (other : ffi :: EthGetBlockByNumberResult) -> Self { super :: types :: EthGetBlockByNumberResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetBlockByNumberResult > for ffi :: EthGetBlockByNumberResult { fn from (other : super :: types :: EthGetBlockByNumberResult) -> Self { ffi :: EthGetBlockByNumberResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetUncleByBlockNumberAndIndexResult > for super :: types :: EthGetUncleByBlockNumberAndIndexResult { fn from (other : ffi :: EthGetUncleByBlockNumberAndIndexResult) -> Self { super :: types :: EthGetUncleByBlockNumberAndIndexResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetUncleByBlockNumberAndIndexResult > for ffi :: EthGetUncleByBlockNumberAndIndexResult { fn from (other : super :: types :: EthGetUncleByBlockNumberAndIndexResult) -> Self { ffi :: EthGetUncleByBlockNumberAndIndexResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: NonUtxo > for super :: types :: NonUtxo { fn from (other : ffi :: NonUtxo) -> Self { super :: types :: NonUtxo { anchor_reward : other . anchor_reward . into () , burnt : other . burnt . into () , incentive_funding : other . incentive_funding . into () , loan : other . loan . into () , options : other . options . into () , unknown : other . unknown . into () , } } } impl From < super :: types :: NonUtxo > for ffi :: NonUtxo { fn from (other : super :: types :: NonUtxo) -> Self { ffi :: NonUtxo { anchor_reward : other . anchor_reward . into () , burnt : other . burnt . into () , incentive_funding : other . incentive_funding . into () , loan : other . loan . into () , options : other . options . into () , unknown : other . unknown . into () , } } } impl From < ffi :: EthAccountsResult > for super :: types :: EthAccountsResult { fn from (other : ffi :: EthAccountsResult) -> Self { super :: types :: EthAccountsResult { accounts : other . accounts . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthAccountsResult > for ffi :: EthAccountsResult { fn from (other : super :: types :: EthAccountsResult) -> Self { ffi :: EthAccountsResult { accounts : other . accounts . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetUncleCountByBlockHashResult > for super :: types :: EthGetUncleCountByBlockHashResult { fn from (other : ffi :: EthGetUncleCountByBlockHashResult) -> Self { super :: types :: EthGetUncleCountByBlockHashResult { number_uncles : other . number_uncles . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockHashResult > for ffi :: EthGetUncleCountByBlockHashResult { fn from (other : super :: types :: EthGetUncleCountByBlockHashResult) -> Self { ffi :: EthGetUncleCountByBlockHashResult { number_uncles : other . number_uncles . into () , } } } impl From < ffi :: BlockInput > for super :: types :: BlockInput { fn from (other : ffi :: BlockInput) -> Self { super :: types :: BlockInput { blockhash : other . blockhash . into () , verbosity : other . verbosity . into () , } } } impl From < super :: types :: BlockInput > for ffi :: BlockInput { fn from (other : super :: types :: BlockInput) -> Self { ffi :: BlockInput { blockhash : other . blockhash . into () , verbosity : other . verbosity . into () , } } } impl From < ffi :: EthGetTransactionCountInput > for super :: types :: EthGetTransactionCountInput { fn from (other : ffi :: EthGetTransactionCountInput) -> Self { super :: types :: EthGetTransactionCountInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetTransactionCountInput > for ffi :: EthGetTransactionCountInput { fn from (other : super :: types :: EthGetTransactionCountInput) -> Self { ffi :: EthGetTransactionCountInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthGetUncleCountByBlockNumberResult > for super :: types :: EthGetUncleCountByBlockNumberResult { fn from (other : ffi :: EthGetUncleCountByBlockNumberResult) -> Self { super :: types :: EthGetUncleCountByBlockNumberResult { number_uncles : other . number_uncles . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockNumberResult > for ffi :: EthGetUncleCountByBlockNumberResult { fn from (other : super :: types :: EthGetUncleCountByBlockNumberResult) -> Self { ffi :: EthGetUncleCountByBlockNumberResult { number_uncles : other . number_uncles . into () , } } } impl From < ffi :: EthSignTransactionInput > for super :: types :: EthSignTransactionInput { fn from (other : ffi :: EthSignTransactionInput) -> Self { super :: types :: EthSignTransactionInput { transaction_info : Some (other . transaction_info . into ()) , } } } impl From < super :: types :: EthSignTransactionInput > for ffi :: EthSignTransactionInput { fn from (other : super :: types :: EthSignTransactionInput) -> Self { ffi :: EthSignTransactionInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetBlockByNumberInput > for super :: types :: EthGetBlockByNumberInput { fn from (other : ffi :: EthGetBlockByNumberInput) -> Self { super :: types :: EthGetBlockByNumberInput { number : other . number . into () , full_transaction : other . full_transaction . into () , } } } impl From < super :: types :: EthGetBlockByNumberInput > for ffi :: EthGetBlockByNumberInput { fn from (other : super :: types :: EthGetBlockByNumberInput) -> Self { ffi :: EthGetBlockByNumberInput { number : other . number . into () , full_transaction : other . full_transaction . into () , } } } impl From < ffi :: EthCompileLllResult > for super :: types :: EthCompileLllResult { fn from (other : ffi :: EthCompileLllResult) -> Self { super :: types :: EthCompileLllResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileLllResult > for ffi :: EthCompileLllResult { fn from (other : super :: types :: EthCompileLllResult) -> Self { ffi :: EthCompileLllResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: EthCompileSerpentResult > for super :: types :: EthCompileSerpentResult { fn from (other : ffi :: EthCompileSerpentResult) -> Self { super :: types :: EthCompileSerpentResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileSerpentResult > for ffi :: EthCompileSerpentResult { fn from (other : super :: types :: EthCompileSerpentResult) -> Self { ffi :: EthCompileSerpentResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: EthCallResult > for super :: types :: EthCallResult { fn from (other : ffi :: EthCallResult) -> Self { super :: types :: EthCallResult { data : other . data . into () , } } } impl From < super :: types :: EthCallResult > for ffi :: EthCallResult { fn from (other : super :: types :: EthCallResult) -> Self { ffi :: EthCallResult { data : other . data . into () , } } } impl From < ffi :: EthTransactionReceipt > for super :: types :: EthTransactionReceipt { fn from (other : ffi :: EthTransactionReceipt) -> Self { super :: types :: EthTransactionReceipt { transaction_hash : other . transaction_hash . into () , transaction_index : other . transaction_index . into () , block_hash : other . block_hash . into () , block_number : other . block_number . into () , from : other . from . into () , to : other . to . into () , cumulative_gas_used : other . cumulative_gas_used . into () , effective_gas_price : other . effective_gas_price . into () , gas_used : other . gas_used . into () , contract_address : other . contract_address . into () , logs : other . logs . into_iter () . map (Into :: into) . collect () , logs_bloom : other . logs_bloom . into () , field_type : other . field_type . into () , root : Some (other . root . into ()) , status : Some (other . status . into ()) , } } } impl From < super :: types :: EthTransactionReceipt > for ffi :: EthTransactionReceipt { fn from (other : super :: types :: EthTransactionReceipt) -> Self { ffi :: EthTransactionReceipt { transaction_hash : other . transaction_hash . into () , transaction_index : other . transaction_index . into () , block_hash : other . block_hash . into () , block_number : other . block_number . into () , from : other . from . into () , to : other . to . into () , cumulative_gas_used : other . cumulative_gas_used . into () , effective_gas_price : other . effective_gas_price . into () , gas_used : other . gas_used . into () , contract_address : other . contract_address . into () , logs : other . logs . into_iter () . map (Into :: into) . collect () , logs_bloom : other . logs_bloom . into () , field_type : other . field_type . into () , root : other . root . map (Into :: into) . unwrap_or_default () , status : other . status . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthSendTransactionInput > for super :: types :: EthSendTransactionInput { fn from (other : ffi :: EthSendTransactionInput) -> Self { super :: types :: EthSendTransactionInput { transaction_info : Some (other . transaction_info . into ()) , } } } impl From < super :: types :: EthSendTransactionInput > for ffi :: EthSendTransactionInput { fn from (other : super :: types :: EthSendTransactionInput) -> Self { ffi :: EthSendTransactionInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthEstimateGasInput > for super :: types :: EthEstimateGasInput { fn from (other : ffi :: EthEstimateGasInput) -> Self { super :: types :: EthEstimateGasInput { transaction_info : Some (other . transaction_info . into ()) , block_number : Some (other . block_number . into ()) , } } } impl From < super :: types :: EthEstimateGasInput > for ffi :: EthEstimateGasInput { fn from (other : super :: types :: EthEstimateGasInput) -> Self { ffi :: EthEstimateGasInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , block_number : other . block_number . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetWorkResult > for super :: types :: EthGetWorkResult { fn from (other : ffi :: EthGetWorkResult) -> Self { super :: types :: EthGetWorkResult { currentblock : other . currentblock . into () , seed_hash : other . seed_hash . into () , target : other . target . into () , } } } impl From < super :: types :: EthGetWorkResult > for ffi :: EthGetWorkResult { fn from (other : super :: types :: EthGetWorkResult) -> Self { ffi :: EthGetWorkResult { currentblock : other . currentblock . into () , seed_hash : other . seed_hash . into () , target : other . target . into () , } } } impl From < ffi :: EthGasPriceResult > for super :: types :: EthGasPriceResult { fn from (other : ffi :: EthGasPriceResult) -> Self { super :: types :: EthGasPriceResult { gas_price : other . gas_price . into () , } } } impl From < super :: types :: EthGasPriceResult > for ffi :: EthGasPriceResult { fn from (other : super :: types :: EthGasPriceResult) -> Self { ffi :: EthGasPriceResult { gas_price : other . gas_price . into () , } } } impl From < ffi :: EthSignResult > for super :: types :: EthSignResult { fn from (other : ffi :: EthSignResult) -> Self { super :: types :: EthSignResult { signature : other . signature . into () , } } } impl From < super :: types :: EthSignResult > for ffi :: EthSignResult { fn from (other : super :: types :: EthSignResult) -> Self { ffi :: EthSignResult { signature : other . signature . into () , } } } impl From < ffi :: EthBlockNumberResult > for super :: types :: EthBlockNumberResult { fn from (other : ffi :: EthBlockNumberResult) -> Self { super :: types :: EthBlockNumberResult { block_number : other . block_number . into () , } } } impl From < super :: types :: EthBlockNumberResult > for ffi :: EthBlockNumberResult { fn from (other : super :: types :: EthBlockNumberResult) -> Self { ffi :: EthBlockNumberResult { block_number : other . block_number . into () , } } } impl From < ffi :: EthGetUncleByBlockNumberAndIndexInput > for super :: types :: EthGetUncleByBlockNumberAndIndexInput { fn from (other : ffi :: EthGetUncleByBlockNumberAndIndexInput) -> Self { super :: types :: EthGetUncleByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetUncleByBlockNumberAndIndexInput > for ffi :: EthGetUncleByBlockNumberAndIndexInput { fn from (other : super :: types :: EthGetUncleByBlockNumberAndIndexInput) -> Self { ffi :: EthGetUncleByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < ffi :: EthGetTransactionByBlockNumberAndIndexInput > for super :: types :: EthGetTransactionByBlockNumberAndIndexInput { fn from (other : ffi :: EthGetTransactionByBlockNumberAndIndexInput) -> Self { super :: types :: EthGetTransactionByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetTransactionByBlockNumberAndIndexInput > for ffi :: EthGetTransactionByBlockNumberAndIndexInput { fn from (other : super :: types :: EthGetTransactionByBlockNumberAndIndexInput) -> Self { ffi :: EthGetTransactionByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < ffi :: EthSubmitWorkResult > for super :: types :: EthSubmitWorkResult { fn from (other : ffi :: EthSubmitWorkResult) -> Self { super :: types :: EthSubmitWorkResult { is_valid : other . is_valid . into () , } } } impl From < super :: types :: EthSubmitWorkResult > for ffi :: EthSubmitWorkResult { fn from (other : super :: types :: EthSubmitWorkResult) -> Self { ffi :: EthSubmitWorkResult { is_valid : other . is_valid . into () , } } } impl From < ffi :: EthTransactionInfo > for super :: types :: EthTransactionInfo { fn from (other : ffi :: EthTransactionInfo) -> Self { super :: types :: EthTransactionInfo { from : Some (other . from . into ()) , to : Some (other . to . into ()) , gas : Some (other . gas . into ()) , price : Some (other . price . into ()) , value : Some (other . value . into ()) , data : Some (other . data . into ()) , nonce : Some (other . nonce . into ()) , } } } impl From < super :: types :: EthTransactionInfo > for ffi :: EthTransactionInfo { fn from (other : super :: types :: EthTransactionInfo) -> Self { ffi :: EthTransactionInfo { from : other . from . map (Into :: into) . unwrap_or_default () , to : other . to . map (Into :: into) . unwrap_or_default () , gas : other . gas . map (Into :: into) . unwrap_or_default () , price : other . price . map (Into :: into) . unwrap_or_default () , value : other . value . map (Into :: into) . unwrap_or_default () , data : other . data . map (Into :: into) . unwrap_or_default () , nonce : other . nonce . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetStorageAtResult > for super :: types :: EthGetStorageAtResult { fn from (other : ffi :: EthGetStorageAtResult) -> Self { super :: types :: EthGetStorageAtResult { value : other . value . into () , } } } impl From < super :: types :: EthGetStorageAtResult > for ffi :: EthGetStorageAtResult { fn from (other : super :: types :: EthGetStorageAtResult) -> Self { ffi :: EthGetStorageAtResult { value : other . value . into () , } } } impl From < ffi :: EthCoinBaseResult > for super :: types :: EthCoinBaseResult { fn from (other : ffi :: EthCoinBaseResult) -> Self { super :: types :: EthCoinBaseResult { address : other . address . into () , } } } impl From < super :: types :: EthCoinBaseResult > for ffi :: EthCoinBaseResult { fn from (other : super :: types :: EthCoinBaseResult) -> Self { ffi :: EthCoinBaseResult { address : other . address . into () , } } } impl From < ffi :: EthCompileSolidityResult > for super :: types :: EthCompileSolidityResult { fn from (other : ffi :: EthCompileSolidityResult) -> Self { super :: types :: EthCompileSolidityResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileSolidityResult > for ffi :: EthCompileSolidityResult { fn from (other : super :: types :: EthCompileSolidityResult) -> Self { ffi :: EthCompileSolidityResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: EthGetStorageAtInput > for super :: types :: EthGetStorageAtInput { fn from (other : ffi :: EthGetStorageAtInput) -> Self { super :: types :: EthGetStorageAtInput { address : other . address . into () , position : other . position . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetStorageAtInput > for ffi :: EthGetStorageAtInput { fn from (other : super :: types :: EthGetStorageAtInput) -> Self { ffi :: EthGetStorageAtInput { address : other . address . into () , position : other . position . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthMiningResult > for super :: types :: EthMiningResult { fn from (other : ffi :: EthMiningResult) -> Self { super :: types :: EthMiningResult { is_mining : other . is_mining . into () , } } } impl From < super :: types :: EthMiningResult > for ffi :: EthMiningResult { fn from (other : super :: types :: EthMiningResult) -> Self { ffi :: EthMiningResult { is_mining : other . is_mining . into () , } } } impl From < ffi :: EthGetBalanceInput > for super :: types :: EthGetBalanceInput { fn from (other : ffi :: EthGetBalanceInput) -> Self { super :: types :: EthGetBalanceInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetBalanceInput > for ffi :: EthGetBalanceInput { fn from (other : super :: types :: EthGetBalanceInput) -> Self { ffi :: EthGetBalanceInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthGetBalanceResult > for super :: types :: EthGetBalanceResult { fn from (other : ffi :: EthGetBalanceResult) -> Self { super :: types :: EthGetBalanceResult { balance : other . balance . into () , } } } impl From < super :: types :: EthGetBalanceResult > for ffi :: EthGetBalanceResult { fn from (other : super :: types :: EthGetBalanceResult) -> Self { ffi :: EthGetBalanceResult { balance : other . balance . into () , } } } impl From < ffi :: EthGetBlockTransactionCountByHashResult > for super :: types :: EthGetBlockTransactionCountByHashResult { fn from (other : ffi :: EthGetBlockTransactionCountByHashResult) -> Self { super :: types :: EthGetBlockTransactionCountByHashResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByHashResult > for ffi :: EthGetBlockTransactionCountByHashResult { fn from (other : super :: types :: EthGetBlockTransactionCountByHashResult) -> Self { ffi :: EthGetBlockTransactionCountByHashResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: Vout > for super :: types :: Vout { fn from (other : ffi :: Vout) -> Self { super :: types :: Vout { value : other . value . into () , n : other . n . into () , script_pub_key : Some (other . script_pub_key . into ()) , token_id : other . token_id . into () , } } } impl From < super :: types :: Vout > for ffi :: Vout { fn from (other : super :: types :: Vout) -> Self { ffi :: Vout { value : other . value . into () , n : other . n . into () , script_pub_key : other . script_pub_key . map (Into :: into) . unwrap_or_default () , token_id : other . token_id . into () , } } } impl From < ffi :: EthSendTransactionResult > for super :: types :: EthSendTransactionResult { fn from (other : ffi :: EthSendTransactionResult) -> Self { super :: types :: EthSendTransactionResult { hash : other . hash . into () , } } } impl From < super :: types :: EthSendTransactionResult > for ffi :: EthSendTransactionResult { fn from (other : super :: types :: EthSendTransactionResult) -> Self { ffi :: EthSendTransactionResult { hash : other . hash . into () , } } } impl From < ffi :: EthGetTransactionByBlockHashAndIndexInput > for super :: types :: EthGetTransactionByBlockHashAndIndexInput { fn from (other : ffi :: EthGetTransactionByBlockHashAndIndexInput) -> Self { super :: types :: EthGetTransactionByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetTransactionByBlockHashAndIndexInput > for ffi :: EthGetTransactionByBlockHashAndIndexInput { fn from (other : super :: types :: EthGetTransactionByBlockHashAndIndexInput) -> Self { ffi :: EthGetTransactionByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < ffi :: EthProtocolVersionResult > for super :: types :: EthProtocolVersionResult { fn from (other : ffi :: EthProtocolVersionResult) -> Self { super :: types :: EthProtocolVersionResult { protocol_version : other . protocol_version . into () , } } } impl From < super :: types :: EthProtocolVersionResult > for ffi :: EthProtocolVersionResult { fn from (other : super :: types :: EthProtocolVersionResult) -> Self { ffi :: EthProtocolVersionResult { protocol_version : other . protocol_version . into () , } } } impl From < ffi :: ScriptSig > for super :: types :: ScriptSig { fn from (other : ffi :: ScriptSig) -> Self { super :: types :: ScriptSig { field_asm : other . field_asm . into () , hex : other . hex . into () , } } } impl From < super :: types :: ScriptSig > for ffi :: ScriptSig { fn from (other : super :: types :: ScriptSig) -> Self { ffi :: ScriptSig { field_asm : other . field_asm . into () , hex : other . hex . into () , } } } impl From < ffi :: EthSyncingInfo > for super :: types :: EthSyncingInfo { fn from (other : ffi :: EthSyncingInfo) -> Self { super :: types :: EthSyncingInfo { starting_block : other . starting_block . into () , current_block : other . current_block . into () , highest_block : other . highest_block . into () , } } } impl From < super :: types :: EthSyncingInfo > for ffi :: EthSyncingInfo { fn from (other : super :: types :: EthSyncingInfo) -> Self { ffi :: EthSyncingInfo { starting_block : other . starting_block . into () , current_block : other . current_block . into () , highest_block : other . highest_block . into () , } } } impl From < ffi :: EthSyncingResult > for super :: types :: EthSyncingResult { fn from (other : ffi :: EthSyncingResult) -> Self { super :: types :: EthSyncingResult { status : Some (other . status . into ()) , sync_info : Some (other . sync_info . into ()) , } } } impl From < super :: types :: EthSyncingResult > for ffi :: EthSyncingResult { fn from (other : super :: types :: EthSyncingResult) -> Self { ffi :: EthSyncingResult { status : other . status . map (Into :: into) . unwrap_or_default () , sync_info : other . sync_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthEstimateGasResult > for super :: types :: EthEstimateGasResult { fn from (other : ffi :: EthEstimateGasResult) -> Self { super :: types :: EthEstimateGasResult { gas_used : other . gas_used . into () , } } } impl From < super :: types :: EthEstimateGasResult > for ffi :: EthEstimateGasResult { fn from (other : super :: types :: EthEstimateGasResult) -> Self { ffi :: EthEstimateGasResult { gas_used : other . gas_used . into () , } } } impl From < ffi :: EthGetUncleCountByBlockNumberInput > for super :: types :: EthGetUncleCountByBlockNumberInput { fn from (other : ffi :: EthGetUncleCountByBlockNumberInput) -> Self { super :: types :: EthGetUncleCountByBlockNumberInput { block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockNumberInput > for ffi :: EthGetUncleCountByBlockNumberInput { fn from (other : super :: types :: EthGetUncleCountByBlockNumberInput) -> Self { ffi :: EthGetUncleCountByBlockNumberInput { block_number : other . block_number . into () , } } } impl From < ffi :: EthGetTransactionByHashResult > for super :: types :: EthGetTransactionByHashResult { fn from (other : ffi :: EthGetTransactionByHashResult) -> Self { super :: types :: EthGetTransactionByHashResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByHashResult > for ffi :: EthGetTransactionByHashResult { fn from (other : super :: types :: EthGetTransactionByHashResult) -> Self { ffi :: EthGetTransactionByHashResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetBlockTransactionCountByNumberInput > for super :: types :: EthGetBlockTransactionCountByNumberInput { fn from (other : ffi :: EthGetBlockTransactionCountByNumberInput) -> Self { super :: types :: EthGetBlockTransactionCountByNumberInput { block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByNumberInput > for ffi :: EthGetBlockTransactionCountByNumberInput { fn from (other : super :: types :: EthGetBlockTransactionCountByNumberInput) -> Self { ffi :: EthGetBlockTransactionCountByNumberInput { block_number : other . block_number . into () , } } } impl From < ffi :: EthSubmitHashrateResult > for super :: types :: EthSubmitHashrateResult { fn from (other : ffi :: EthSubmitHashrateResult) -> Self { super :: types :: EthSubmitHashrateResult { is_valid : other . is_valid . into () , } } } impl From < super :: types :: EthSubmitHashrateResult > for ffi :: EthSubmitHashrateResult { fn from (other : super :: types :: EthSubmitHashrateResult) -> Self { ffi :: EthSubmitHashrateResult { is_valid : other . is_valid . into () , } } } impl From < ffi :: EthGetTransactionReceiptResult > for super :: types :: EthGetTransactionReceiptResult { fn from (other : ffi :: EthGetTransactionReceiptResult) -> Self { super :: types :: EthGetTransactionReceiptResult { transaction_receipt : Some (other . transaction_receipt . into ()) , } } } impl From < super :: types :: EthGetTransactionReceiptResult > for ffi :: EthGetTransactionReceiptResult { fn from (other : super :: types :: EthGetTransactionReceiptResult) -> Self { ffi :: EthGetTransactionReceiptResult { transaction_receipt : other . transaction_receipt . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetBlockTransactionCountByHashInput > for super :: types :: EthGetBlockTransactionCountByHashInput { fn from (other : ffi :: EthGetBlockTransactionCountByHashInput) -> Self { super :: types :: EthGetBlockTransactionCountByHashInput { block_hash : other . block_hash . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByHashInput > for ffi :: EthGetBlockTransactionCountByHashInput { fn from (other : super :: types :: EthGetBlockTransactionCountByHashInput) -> Self { ffi :: EthGetBlockTransactionCountByHashInput { block_hash : other . block_hash . into () , } } } impl From < ffi :: RawTransaction > for super :: types :: RawTransaction { fn from (other : ffi :: RawTransaction) -> Self { super :: types :: RawTransaction { in_active_chain : other . in_active_chain . into () , hex : other . hex . into () , txid : other . txid . into () , hash : other . hash . into () , size : other . size . into () , vsize : other . vsize . into () , weight : other . weight . into () , version : other . version . into () , locktime : other . locktime . into () , vin : other . vin . into_iter () . map (Into :: into) . collect () , vout : other . vout . into_iter () . map (Into :: into) . collect () , blockhash : other . blockhash . into () , confirmations : other . confirmations . into () , blocktime : other . blocktime . into () , } } } impl From < super :: types :: RawTransaction > for ffi :: RawTransaction { fn from (other : super :: types :: RawTransaction) -> Self { ffi :: RawTransaction { in_active_chain : other . in_active_chain . into () , hex : other . hex . into () , txid : other . txid . into () , hash : other . hash . into () , size : other . size . into () , vsize : other . vsize . into () , weight : other . weight . into () , version : other . version . into () , locktime : other . locktime . into () , vin : other . vin . into_iter () . map (Into :: into) . collect () , vout : other . vout . into_iter () . map (Into :: into) . collect () , blockhash : other . blockhash . into () , confirmations : other . confirmations . into () , blocktime : other . blocktime . into () , } } } impl From < ffi :: EthGetUncleCountByBlockHashInput > for super :: types :: EthGetUncleCountByBlockHashInput { fn from (other : ffi :: EthGetUncleCountByBlockHashInput) -> Self { super :: types :: EthGetUncleCountByBlockHashInput { block_hash : other . block_hash . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockHashInput > for ffi :: EthGetUncleCountByBlockHashInput { fn from (other : super :: types :: EthGetUncleCountByBlockHashInput) -> Self { ffi :: EthGetUncleCountByBlockHashInput { block_hash : other . block_hash . into () , } } } impl From < ffi :: EthCompileSolidityInput > for super :: types :: EthCompileSolidityInput { fn from (other : ffi :: EthCompileSolidityInput) -> Self { super :: types :: EthCompileSolidityInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileSolidityInput > for ffi :: EthCompileSolidityInput { fn from (other : super :: types :: EthCompileSolidityInput) -> Self { ffi :: EthCompileSolidityInput { code : other . code . into () , } } } impl From < ffi :: NetPeerCountResult > for super :: types :: NetPeerCountResult { fn from (other : ffi :: NetPeerCountResult) -> Self { super :: types :: NetPeerCountResult { number_peer : other . number_peer . into () , } } } impl From < super :: types :: NetPeerCountResult > for ffi :: NetPeerCountResult { fn from (other : super :: types :: NetPeerCountResult) -> Self { ffi :: NetPeerCountResult { number_peer : other . number_peer . into () , } } } impl From < ffi :: EthGetUncleByBlockHashAndIndexResult > for super :: types :: EthGetUncleByBlockHashAndIndexResult { fn from (other : ffi :: EthGetUncleByBlockHashAndIndexResult) -> Self { super :: types :: EthGetUncleByBlockHashAndIndexResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetUncleByBlockHashAndIndexResult > for ffi :: EthGetUncleByBlockHashAndIndexResult { fn from (other : super :: types :: EthGetUncleByBlockHashAndIndexResult) -> Self { ffi :: EthGetUncleByBlockHashAndIndexResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: Web3Sha3Result > for super :: types :: Web3Sha3Result { fn from (other : ffi :: Web3Sha3Result) -> Self { super :: types :: Web3Sha3Result { data : other . data . into () , } } } impl From < super :: types :: Web3Sha3Result > for ffi :: Web3Sha3Result { fn from (other : super :: types :: Web3Sha3Result) -> Self { ffi :: Web3Sha3Result { data : other . data . into () , } } } impl From < ffi :: EthGetCodeResult > for super :: types :: EthGetCodeResult { fn from (other : ffi :: EthGetCodeResult) -> Self { super :: types :: EthGetCodeResult { code : other . code . into () , } } } impl From < super :: types :: EthGetCodeResult > for ffi :: EthGetCodeResult { fn from (other : super :: types :: EthGetCodeResult) -> Self { ffi :: EthGetCodeResult { code : other . code . into () , } } } impl From < ffi :: BlockResult > for super :: types :: BlockResult { fn from (other : ffi :: BlockResult) -> Self { super :: types :: BlockResult { hash : other . hash . into () , block : Some (other . block . into ()) , } } } impl From < super :: types :: BlockResult > for ffi :: BlockResult { fn from (other : super :: types :: BlockResult) -> Self { ffi :: BlockResult { hash : other . hash . into () , block : other . block . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: Block > for super :: types :: Block { fn from (other : ffi :: Block) -> Self { super :: types :: Block { hash : other . hash . into () , confirmations : other . confirmations . into () , size : other . size . into () , strippedsize : other . strippedsize . into () , weight : other . weight . into () , height : other . height . into () , version : other . version . into () , version_hex : other . version_hex . into () , merkleroot : other . merkleroot . into () , tx : other . tx . into_iter () . map (Into :: into) . collect () , time : other . time . into () , mediantime : other . mediantime . into () , nonce : other . nonce . into () , bits : other . bits . into () , difficulty : other . difficulty . into () , chainwork : other . chainwork . into () , n_tx : other . n_tx . into () , previous_block_hash : other . previous_block_hash . into () , next_block_hash : other . next_block_hash . into () , masternode : other . masternode . into () , minter : other . minter . into () , minted_blocks : other . minted_blocks . into () , stake_modifier : other . stake_modifier . into () , nonutxo : other . nonutxo . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: Block > for ffi :: Block { fn from (other : super :: types :: Block) -> Self { ffi :: Block { hash : other . hash . into () , confirmations : other . confirmations . into () , size : other . size . into () , strippedsize : other . strippedsize . into () , weight : other . weight . into () , height : other . height . into () , version : other . version . into () , version_hex : other . version_hex . into () , merkleroot : other . merkleroot . into () , tx : other . tx . into_iter () . map (Into :: into) . collect () , time : other . time . into () , mediantime : other . mediantime . into () , nonce : other . nonce . into () , bits : other . bits . into () , difficulty : other . difficulty . into () , chainwork : other . chainwork . into () , n_tx : other . n_tx . into () , previous_block_hash : other . previous_block_hash . into () , next_block_hash : other . next_block_hash . into () , masternode : other . masternode . into () , minter : other . minter . into () , minted_blocks : other . minted_blocks . into () , stake_modifier : other . stake_modifier . into () , nonutxo : other . nonutxo . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetCodeInput > for super :: types :: EthGetCodeInput { fn from (other : ffi :: EthGetCodeInput) -> Self { super :: types :: EthGetCodeInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetCodeInput > for ffi :: EthGetCodeInput { fn from (other : super :: types :: EthGetCodeInput) -> Self { ffi :: EthGetCodeInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthGetTransactionByBlockNumberAndIndexResult > for super :: types :: EthGetTransactionByBlockNumberAndIndexResult { fn from (other : ffi :: EthGetTransactionByBlockNumberAndIndexResult) -> Self { super :: types :: EthGetTransactionByBlockNumberAndIndexResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByBlockNumberAndIndexResult > for ffi :: EthGetTransactionByBlockNumberAndIndexResult { fn from (other : super :: types :: EthGetTransactionByBlockNumberAndIndexResult) -> Self { ffi :: EthGetTransactionByBlockNumberAndIndexResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: Web3Sha3Input > for super :: types :: Web3Sha3Input { fn from (other : ffi :: Web3Sha3Input) -> Self { super :: types :: Web3Sha3Input { data : other . data . into () , } } } impl From < super :: types :: Web3Sha3Input > for ffi :: Web3Sha3Input { fn from (other : super :: types :: Web3Sha3Input) -> Self { ffi :: Web3Sha3Input { data : other . data . into () , } } } impl From < ffi :: BlockHashResult > for super :: types :: BlockHashResult { fn from (other : ffi :: BlockHashResult) -> Self { super :: types :: BlockHashResult { hash : other . hash . into () , } } } impl From < super :: types :: BlockHashResult > for ffi :: BlockHashResult { fn from (other : super :: types :: BlockHashResult) -> Self { ffi :: BlockHashResult { hash : other . hash . into () , } } } impl From < ffi :: EthSignInput > for super :: types :: EthSignInput { fn from (other : ffi :: EthSignInput) -> Self { super :: types :: EthSignInput { address : other . address . into () , message : other . message . into () , } } } impl From < super :: types :: EthSignInput > for ffi :: EthSignInput { fn from (other : super :: types :: EthSignInput) -> Self { ffi :: EthSignInput { address : other . address . into () , message : other . message . into () , } } } impl From < ffi :: EthGetTransactionByHashInput > for super :: types :: EthGetTransactionByHashInput { fn from (other : ffi :: EthGetTransactionByHashInput) -> Self { super :: types :: EthGetTransactionByHashInput { hash : other . hash . into () , } } } impl From < super :: types :: EthGetTransactionByHashInput > for ffi :: EthGetTransactionByHashInput { fn from (other : super :: types :: EthGetTransactionByHashInput) -> Self { ffi :: EthGetTransactionByHashInput { hash : other . hash . into () , } } } impl From < ffi :: EthGetCompilersResult > for super :: types :: EthGetCompilersResult { fn from (other : ffi :: EthGetCompilersResult) -> Self { super :: types :: EthGetCompilersResult { compilers : other . compilers . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthGetCompilersResult > for ffi :: EthGetCompilersResult { fn from (other : super :: types :: EthGetCompilersResult) -> Self { ffi :: EthGetCompilersResult { compilers : other . compilers . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetTransactionCountResult > for super :: types :: EthGetTransactionCountResult { fn from (other : ffi :: EthGetTransactionCountResult) -> Self { super :: types :: EthGetTransactionCountResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetTransactionCountResult > for ffi :: EthGetTransactionCountResult { fn from (other : super :: types :: EthGetTransactionCountResult) -> Self { ffi :: EthGetTransactionCountResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: EthSendRawTransactionInput > for super :: types :: EthSendRawTransactionInput { fn from (other : ffi :: EthSendRawTransactionInput) -> Self { super :: types :: EthSendRawTransactionInput { transaction : other . transaction . into () , } } } impl From < super :: types :: EthSendRawTransactionInput > for ffi :: EthSendRawTransactionInput { fn from (other : super :: types :: EthSendRawTransactionInput) -> Self { ffi :: EthSendRawTransactionInput { transaction : other . transaction . into () , } } } impl From < ffi :: EthGetBlockByHashInput > for super :: types :: EthGetBlockByHashInput { fn from (other : ffi :: EthGetBlockByHashInput) -> Self { super :: types :: EthGetBlockByHashInput { hash : other . hash . into () , full_transaction : other . full_transaction . into () , } } } impl From < super :: types :: EthGetBlockByHashInput > for ffi :: EthGetBlockByHashInput { fn from (other : super :: types :: EthGetBlockByHashInput) -> Self { ffi :: EthGetBlockByHashInput { hash : other . hash . into () , full_transaction : other . full_transaction . into () , } } } impl From < ffi :: EthSendRawTransactionResult > for super :: types :: EthSendRawTransactionResult { fn from (other : ffi :: EthSendRawTransactionResult) -> Self { super :: types :: EthSendRawTransactionResult { hash : other . hash . into () , } } } impl From < super :: types :: EthSendRawTransactionResult > for ffi :: EthSendRawTransactionResult { fn from (other : super :: types :: EthSendRawTransactionResult) -> Self { ffi :: EthSendRawTransactionResult { hash : other . hash . into () , } } } impl From < ffi :: EthCompileSerpentInput > for super :: types :: EthCompileSerpentInput { fn from (other : ffi :: EthCompileSerpentInput) -> Self { super :: types :: EthCompileSerpentInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileSerpentInput > for ffi :: EthCompileSerpentInput { fn from (other : super :: types :: EthCompileSerpentInput) -> Self { ffi :: EthCompileSerpentInput { code : other . code . into () , } } } impl From < ffi :: NetVersionResult > for super :: types :: NetVersionResult { fn from (other : ffi :: NetVersionResult) -> Self { super :: types :: NetVersionResult { network_version : other . network_version . into () , } } } impl From < super :: types :: NetVersionResult > for ffi :: NetVersionResult { fn from (other : super :: types :: NetVersionResult) -> Self { ffi :: NetVersionResult { network_version : other . network_version . into () , } } } impl From < ffi :: EthGetTransactionReceiptInput > for super :: types :: EthGetTransactionReceiptInput { fn from (other : ffi :: EthGetTransactionReceiptInput) -> Self { super :: types :: EthGetTransactionReceiptInput { transaction_hash : other . transaction_hash . into () , } } } impl From < super :: types :: EthGetTransactionReceiptInput > for ffi :: EthGetTransactionReceiptInput { fn from (other : super :: types :: EthGetTransactionReceiptInput) -> Self { ffi :: EthGetTransactionReceiptInput { transaction_hash : other . transaction_hash . into () , } } } impl From < ffi :: EthHashRateResult > for super :: types :: EthHashRateResult { fn from (other : ffi :: EthHashRateResult) -> Self { super :: types :: EthHashRateResult { hash_rate : other . hash_rate . into () , } } } impl From < super :: types :: EthHashRateResult > for ffi :: EthHashRateResult { fn from (other : super :: types :: EthHashRateResult) -> Self { ffi :: EthHashRateResult { hash_rate : other . hash_rate . into () , } } } impl From < ffi :: Vin > for super :: types :: Vin { fn from (other : ffi :: Vin) -> Self { super :: types :: Vin { txid : other . txid . into () , vout : other . vout . into () , script_sig : Some (other . script_sig . into ()) , sequence : other . sequence . into () , txinwitness : other . txinwitness . into_iter () . map (Into :: into) . collect () , coinbase : other . coinbase . into () , } } } impl From < super :: types :: Vin > for ffi :: Vin { fn from (other : super :: types :: Vin) -> Self { ffi :: Vin { txid : other . txid . into () , vout : other . vout . into () , script_sig : other . script_sig . map (Into :: into) . unwrap_or_default () , sequence : other . sequence . into () , txinwitness : other . txinwitness . into_iter () . map (Into :: into) . collect () , coinbase : other . coinbase . into () , } } } impl From < ffi :: EthSubmitHashrateInput > for super :: types :: EthSubmitHashrateInput { fn from (other : ffi :: EthSubmitHashrateInput) -> Self { super :: types :: EthSubmitHashrateInput { hash_rate : other . hash_rate . into () , id : other . id . into () , } } } impl From < super :: types :: EthSubmitHashrateInput > for ffi :: EthSubmitHashrateInput { fn from (other : super :: types :: EthSubmitHashrateInput) -> Self { ffi :: EthSubmitHashrateInput { hash_rate : other . hash_rate . into () , id : other . id . into () , } } } impl From < ffi :: EthCallInput > for super :: types :: EthCallInput { fn from (other : ffi :: EthCallInput) -> Self { super :: types :: EthCallInput { transaction_info : Some (other . transaction_info . into ()) , block_number : other . block_number . into () , } } } impl From < super :: types :: EthCallInput > for ffi :: EthCallInput { fn from (other : super :: types :: EthCallInput) -> Self { ffi :: EthCallInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , block_number : other . block_number . into () , } } } impl From < ffi :: PubKey > for super :: types :: PubKey { fn from (other : ffi :: PubKey) -> Self { super :: types :: PubKey { field_asm : other . field_asm . into () , hex : other . hex . into () , field_type : other . field_type . into () , req_sigs : other . req_sigs . into () , addresses : other . addresses . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: PubKey > for ffi :: PubKey { fn from (other : super :: types :: PubKey) -> Self { ffi :: PubKey { field_asm : other . field_asm . into () , hex : other . hex . into () , field_type : other . field_type . into () , req_sigs : other . req_sigs . into () , addresses : other . addresses . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetBlockTransactionCountByNumberResult > for super :: types :: EthGetBlockTransactionCountByNumberResult { fn from (other : ffi :: EthGetBlockTransactionCountByNumberResult) -> Self { super :: types :: EthGetBlockTransactionCountByNumberResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByNumberResult > for ffi :: EthGetBlockTransactionCountByNumberResult { fn from (other : super :: types :: EthGetBlockTransactionCountByNumberResult) -> Self { ffi :: EthGetBlockTransactionCountByNumberResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: EthGetUncleByBlockHashAndIndexInput > for super :: types :: EthGetUncleByBlockHashAndIndexInput { fn from (other : ffi :: EthGetUncleByBlockHashAndIndexInput) -> Self { super :: types :: EthGetUncleByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetUncleByBlockHashAndIndexInput > for ffi :: EthGetUncleByBlockHashAndIndexInput { fn from (other : super :: types :: EthGetUncleByBlockHashAndIndexInput) -> Self { ffi :: EthGetUncleByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < ffi :: Web3ClientVersionResult > for super :: types :: Web3ClientVersionResult { fn from (other : ffi :: Web3ClientVersionResult) -> Self { super :: types :: Web3ClientVersionResult { client_version : other . client_version . into () , } } } impl From < super :: types :: Web3ClientVersionResult > for ffi :: Web3ClientVersionResult { fn from (other : super :: types :: Web3ClientVersionResult) -> Self { ffi :: Web3ClientVersionResult { client_version : other . client_version . into () , } } } impl From < ffi :: EthGetTransactionByBlockHashAndIndexResult > for super :: types :: EthGetTransactionByBlockHashAndIndexResult { fn from (other : ffi :: EthGetTransactionByBlockHashAndIndexResult) -> Self { super :: types :: EthGetTransactionByBlockHashAndIndexResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByBlockHashAndIndexResult > for ffi :: EthGetTransactionByBlockHashAndIndexResult { fn from (other : super :: types :: EthGetTransactionByBlockHashAndIndexResult) -> Self { ffi :: EthGetTransactionByBlockHashAndIndexResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthSubmitWorkInput > for super :: types :: EthSubmitWorkInput { fn from (other : ffi :: EthSubmitWorkInput) -> Self { super :: types :: EthSubmitWorkInput { nounce : other . nounce . into () , pow_hash : other . pow_hash . into () , mix_digest : other . mix_digest . into () , } } } impl From < super :: types :: EthSubmitWorkInput > for ffi :: EthSubmitWorkInput { fn from (other : super :: types :: EthSubmitWorkInput) -> Self { ffi :: EthSubmitWorkInput { nounce : other . nounce . into () , pow_hash : other . pow_hash . into () , mix_digest : other . mix_digest . into () , } } } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Accounts (client : & Box < Client >) -> Result < ffi :: EthAccountsResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthAccountsResult , _ > = c . request ("eth_accounts" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Call (client : & Box < Client > , eth_call_input : EthCallInput) -> Result < ffi :: EthCallResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_call_input = super :: types :: EthCallInput :: from (eth_call_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_call_input . transaction_info , & eth_call_input . block_number] ; let resp : Result < super :: types :: EthCallResult , _ > = c . request ("eth_call" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBalance (client : & Box < Client > , eth_get_balance_input : EthGetBalanceInput) -> Result < ffi :: EthGetBalanceResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_balance_input = super :: types :: EthGetBalanceInput :: from (eth_get_balance_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_balance_input . address , & eth_get_balance_input . block_number] ; let resp : Result < super :: types :: EthGetBalanceResult , _ > = c . request ("eth_getbalance" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByHash (client : & Box < Client > , eth_get_block_by_hash_input : EthGetBlockByHashInput) -> Result < ffi :: EthBlockInfo , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_block_by_hash_input = super :: types :: EthGetBlockByHashInput :: from (eth_get_block_by_hash_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_block_by_hash_input . hash , & eth_get_block_by_hash_input . full_transaction] ; let resp : Result < super :: types :: EthBlockInfo , _ > = c . request ("eth_getblockbyhash" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_ChainId (client : & Box < Client >) -> Result < ffi :: EthChainIdResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthChainIdResult , _ > = c . request ("eth_chainid" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallNet_Version (client : & Box < Client >) -> Result < ffi :: EthChainIdResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthChainIdResult , _ > = c . request ("net_version" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_BlockNumber (client : & Box < Client >) -> Result < ffi :: EthBlockNumberResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthBlockNumberResult , _ > = c . request ("eth_blocknumber" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByNumber (client : & Box < Client > , eth_get_block_by_number_input : EthGetBlockByNumberInput) -> Result < ffi :: EthBlockInfo , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_block_by_number_input = super :: types :: EthGetBlockByNumberInput :: from (eth_get_block_by_number_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_block_by_number_input . number , & eth_get_block_by_number_input . full_transaction] ; let resp : Result < super :: types :: EthBlockInfo , _ > = c . request ("eth_getblockbynumber" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Mining (client : & Box < Client >) -> Result < ffi :: EthMiningResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthMiningResult , _ > = c . request ("eth_mining" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) }# [derive (Clone)] pub struct BlockchainService { adapter : Arc < Handlers > } impl BlockchainService { # [inline] # [allow (dead_code)] pub fn new (adapter : Arc < Handlers >) -> BlockchainService { BlockchainService { adapter } } # [inline] # [allow (dead_code)] pub fn service (& self) -> blockchain_server :: BlockchainServer < BlockchainService > { blockchain_server :: BlockchainServer :: new (self . clone ()) } # [inline] # [allow (unused_mut , dead_code)] pub fn module (& self) -> Result < jsonrpsee_http_server :: RpcModule < () > , jsonrpsee_core :: Error > { let mut module = jsonrpsee_http_server :: RpcModule :: new (()) ; Ok (module) } } # [tonic :: async_trait] impl blockchain_server :: Blockchain for BlockchainService { # [allow (unused_variables)] async fn get_best_block_hash (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: BlockHashResult > , tonic :: Status > { unimplemented ! () ; } # [allow (unused_variables)] async fn get_block (& self , request : tonic :: Request < super :: types :: BlockInput >) -> Result < tonic :: Response < super :: types :: BlockResult > , tonic :: Status > { unimplemented ! () ; } }# [derive (Clone)] pub struct EthService { adapter : Arc < Handlers > } impl EthService { # [inline] # [allow (dead_code)] pub fn new (adapter : Arc < Handlers >) -> EthService { EthService { adapter } } # [inline] # [allow (dead_code)] pub fn service (& self) -> eth_server :: EthServer < EthService > { eth_server :: EthServer :: new (self . clone ()) } # [inline] # [allow (unused_mut , dead_code)] pub fn module (& self) -> Result < jsonrpsee_http_server :: RpcModule < () > , jsonrpsee_core :: Error > { let mut module = jsonrpsee_http_server :: RpcModule :: new (()) ; let adapter = self . adapter . clone () ; module . register_method ("eth_accounts" , move | _params , _ | { Self :: Eth_Accounts (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_call" , move | _params , _ | { let mut eth_call_input = super :: types :: EthCallInput :: default () ; if _params . is_object () { eth_call_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_call_input . transaction_info = seq . next () . map_err (| _ | missing_param ("transaction_info")) ? ; eth_call_input . block_number = seq . next () . map_err (| _ | missing_param ("block_number")) ? ; } let mut input = eth_call_input . into () ; Self :: Eth_Call (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getbalance" , move | _params , _ | { let mut eth_get_balance_input = super :: types :: EthGetBalanceInput :: default () ; if _params . is_object () { eth_get_balance_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_balance_input . address = seq . next () . map_err (| _ | missing_param ("address")) ? ; eth_get_balance_input . block_number = seq . next () . map_err (| _ | missing_param ("block_number")) ? ; } let mut input = eth_get_balance_input . into () ; Self :: Eth_GetBalance (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getblockbyhash" , move | _params , _ | { let mut eth_get_block_by_hash_input = super :: types :: EthGetBlockByHashInput :: default () ; if _params . is_object () { eth_get_block_by_hash_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_block_by_hash_input . hash = seq . next () . map_err (| _ | missing_param ("hash")) ? ; eth_get_block_by_hash_input . full_transaction = seq . next () . map_err (| _ | missing_param ("full_transaction")) ? ; } let mut input = eth_get_block_by_hash_input . into () ; Self :: Eth_GetBlockByHash (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_chainid" , move | _params , _ | { Self :: Eth_ChainId (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("net_version" , move | _params , _ | { Self :: Net_Version (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_blocknumber" , move | _params , _ | { Self :: Eth_BlockNumber (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getblockbynumber" , move | _params , _ | { let mut eth_get_block_by_number_input = super :: types :: EthGetBlockByNumberInput :: default () ; if _params . is_object () { eth_get_block_by_number_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_block_by_number_input . number = seq . next () . map_err (| _ | missing_param ("number")) ? ; eth_get_block_by_number_input . full_transaction = seq . next () . map_err (| _ | missing_param ("full_transaction")) ? ; } let mut input = eth_get_block_by_number_input . into () ; Self :: Eth_GetBlockByNumber (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_mining" , move | _params , _ | { Self :: Eth_Mining (adapter . clone () ,) }) ? ; Ok (module) } } # [tonic :: async_trait] impl eth_server :: Eth for EthService { async fn eth_accounts (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthAccountsResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_Accounts (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_call (& self , request : tonic :: Request < super :: types :: EthCallInput >) -> Result < tonic :: Response < super :: types :: EthCallResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_Call (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_balance (& self , request : tonic :: Request < super :: types :: EthGetBalanceInput >) -> Result < tonic :: Response < super :: types :: EthGetBalanceResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBalance (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_block_by_hash (& self , request : tonic :: Request < super :: types :: EthGetBlockByHashInput >) -> Result < tonic :: Response < super :: types :: EthBlockInfo > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBlockByHash (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } # [allow (unused_variables)] async fn eth_send_transaction (& self , request : tonic :: Request < super :: types :: EthSendTransactionInput >) -> Result < tonic :: Response < super :: types :: EthSendTransactionResult > , tonic :: Status > { unimplemented ! () ; } async fn eth_chain_id (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthChainIdResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_ChainId (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn net_version (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthChainIdResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Net_Version (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_block_number (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthBlockNumberResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_BlockNumber (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_block_by_number (& self , request : tonic :: Request < super :: types :: EthGetBlockByNumberInput >) -> Result < tonic :: Response < super :: types :: EthBlockInfo > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBlockByNumber (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_mining (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthMiningResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_Mining (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } } \ No newline at end of file +use jsonrpsee_core :: client :: ClientT ; use jsonrpsee_http_client :: { HttpClient , HttpClientBuilder } ; use std :: sync :: Arc ; use crate :: { CLIENTS } ; use ain_evm :: runtime :: RUNTIME ; use crate :: rpc :: * ; # [allow (unused_imports)] use self :: ffi :: * ; use ain_evm :: handler :: Handlers ; # [derive (Clone)] pub struct Client { inner : Arc < HttpClient > , handle : tokio :: runtime :: Handle , } # [allow (non_snake_case)] fn NewClient (addr : & str) -> Result < Box < Client > , Box < dyn std :: error :: Error >> { if CLIENTS . read () . unwrap () . get (addr) . is_none () { log :: info ! ("Initializing RPC client for {}" , addr) ; let c = Client { inner : Arc :: new (HttpClientBuilder :: default () . build (addr) ?) , handle : RUNTIME . rt_handle . clone () , } ; CLIENTS . write () . unwrap () . insert (addr . into () , c) ; } Ok (Box :: new (CLIENTS . read () . unwrap () . get (addr) . unwrap () . clone ())) } # [allow (dead_code)] fn missing_param (field : & str) -> jsonrpsee_core :: Error { jsonrpsee_core :: Error :: Call (jsonrpsee_types :: error :: CallError :: Custom (jsonrpsee_types :: ErrorObject :: borrowed (- 1 , & format ! ("Missing required parameter '{field}'") , None) . into_owned ())) } impl From < ffi :: EthTransactionInfo > for super :: types :: EthTransactionInfo { fn from (other : ffi :: EthTransactionInfo) -> Self { super :: types :: EthTransactionInfo { from : Some (other . from . into ()) , to : Some (other . to . into ()) , gas : Some (other . gas . into ()) , price : Some (other . price . into ()) , value : Some (other . value . into ()) , data : Some (other . data . into ()) , nonce : Some (other . nonce . into ()) , } } } impl From < super :: types :: EthTransactionInfo > for ffi :: EthTransactionInfo { fn from (other : super :: types :: EthTransactionInfo) -> Self { ffi :: EthTransactionInfo { from : other . from . map (Into :: into) . unwrap_or_default () , to : other . to . map (Into :: into) . unwrap_or_default () , gas : other . gas . map (Into :: into) . unwrap_or_default () , price : other . price . map (Into :: into) . unwrap_or_default () , value : other . value . map (Into :: into) . unwrap_or_default () , data : other . data . map (Into :: into) . unwrap_or_default () , nonce : other . nonce . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetBlockTransactionCountByHashInput > for super :: types :: EthGetBlockTransactionCountByHashInput { fn from (other : ffi :: EthGetBlockTransactionCountByHashInput) -> Self { super :: types :: EthGetBlockTransactionCountByHashInput { block_hash : other . block_hash . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByHashInput > for ffi :: EthGetBlockTransactionCountByHashInput { fn from (other : super :: types :: EthGetBlockTransactionCountByHashInput) -> Self { ffi :: EthGetBlockTransactionCountByHashInput { block_hash : other . block_hash . into () , } } } impl From < ffi :: EthGetUncleCountByBlockNumberResult > for super :: types :: EthGetUncleCountByBlockNumberResult { fn from (other : ffi :: EthGetUncleCountByBlockNumberResult) -> Self { super :: types :: EthGetUncleCountByBlockNumberResult { number_uncles : other . number_uncles . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockNumberResult > for ffi :: EthGetUncleCountByBlockNumberResult { fn from (other : super :: types :: EthGetUncleCountByBlockNumberResult) -> Self { ffi :: EthGetUncleCountByBlockNumberResult { number_uncles : other . number_uncles . into () , } } } impl From < ffi :: EthSyncingInfo > for super :: types :: EthSyncingInfo { fn from (other : ffi :: EthSyncingInfo) -> Self { super :: types :: EthSyncingInfo { starting_block : other . starting_block . into () , current_block : other . current_block . into () , highest_block : other . highest_block . into () , } } } impl From < super :: types :: EthSyncingInfo > for ffi :: EthSyncingInfo { fn from (other : super :: types :: EthSyncingInfo) -> Self { ffi :: EthSyncingInfo { starting_block : other . starting_block . into () , current_block : other . current_block . into () , highest_block : other . highest_block . into () , } } } impl From < ffi :: EthSignTransactionInput > for super :: types :: EthSignTransactionInput { fn from (other : ffi :: EthSignTransactionInput) -> Self { super :: types :: EthSignTransactionInput { transaction_info : Some (other . transaction_info . into ()) , } } } impl From < super :: types :: EthSignTransactionInput > for ffi :: EthSignTransactionInput { fn from (other : super :: types :: EthSignTransactionInput) -> Self { ffi :: EthSignTransactionInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthCoinBaseResult > for super :: types :: EthCoinBaseResult { fn from (other : ffi :: EthCoinBaseResult) -> Self { super :: types :: EthCoinBaseResult { address : other . address . into () , } } } impl From < super :: types :: EthCoinBaseResult > for ffi :: EthCoinBaseResult { fn from (other : super :: types :: EthCoinBaseResult) -> Self { ffi :: EthCoinBaseResult { address : other . address . into () , } } } impl From < ffi :: EthGetBlockByNumberResult > for super :: types :: EthGetBlockByNumberResult { fn from (other : ffi :: EthGetBlockByNumberResult) -> Self { super :: types :: EthGetBlockByNumberResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetBlockByNumberResult > for ffi :: EthGetBlockByNumberResult { fn from (other : super :: types :: EthGetBlockByNumberResult) -> Self { ffi :: EthGetBlockByNumberResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthCompileLllResult > for super :: types :: EthCompileLllResult { fn from (other : ffi :: EthCompileLllResult) -> Self { super :: types :: EthCompileLllResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileLllResult > for ffi :: EthCompileLllResult { fn from (other : super :: types :: EthCompileLllResult) -> Self { ffi :: EthCompileLllResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: EthGetUncleCountByBlockHashResult > for super :: types :: EthGetUncleCountByBlockHashResult { fn from (other : ffi :: EthGetUncleCountByBlockHashResult) -> Self { super :: types :: EthGetUncleCountByBlockHashResult { number_uncles : other . number_uncles . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockHashResult > for ffi :: EthGetUncleCountByBlockHashResult { fn from (other : super :: types :: EthGetUncleCountByBlockHashResult) -> Self { ffi :: EthGetUncleCountByBlockHashResult { number_uncles : other . number_uncles . into () , } } } impl From < ffi :: EthSignResult > for super :: types :: EthSignResult { fn from (other : ffi :: EthSignResult) -> Self { super :: types :: EthSignResult { signature : other . signature . into () , } } } impl From < super :: types :: EthSignResult > for ffi :: EthSignResult { fn from (other : super :: types :: EthSignResult) -> Self { ffi :: EthSignResult { signature : other . signature . into () , } } } impl From < ffi :: EthSendRawTransactionResult > for super :: types :: EthSendRawTransactionResult { fn from (other : ffi :: EthSendRawTransactionResult) -> Self { super :: types :: EthSendRawTransactionResult { hash : other . hash . into () , } } } impl From < super :: types :: EthSendRawTransactionResult > for ffi :: EthSendRawTransactionResult { fn from (other : super :: types :: EthSendRawTransactionResult) -> Self { ffi :: EthSendRawTransactionResult { hash : other . hash . into () , } } } impl From < ffi :: EthCallResult > for super :: types :: EthCallResult { fn from (other : ffi :: EthCallResult) -> Self { super :: types :: EthCallResult { data : other . data . into () , } } } impl From < super :: types :: EthCallResult > for ffi :: EthCallResult { fn from (other : super :: types :: EthCallResult) -> Self { ffi :: EthCallResult { data : other . data . into () , } } } impl From < ffi :: EthGetBlockByNumberInput > for super :: types :: EthGetBlockByNumberInput { fn from (other : ffi :: EthGetBlockByNumberInput) -> Self { super :: types :: EthGetBlockByNumberInput { number : other . number . into () , full_transaction : other . full_transaction . into () , } } } impl From < super :: types :: EthGetBlockByNumberInput > for ffi :: EthGetBlockByNumberInput { fn from (other : super :: types :: EthGetBlockByNumberInput) -> Self { ffi :: EthGetBlockByNumberInput { number : other . number . into () , full_transaction : other . full_transaction . into () , } } } impl From < ffi :: EthGetUncleByBlockNumberAndIndexResult > for super :: types :: EthGetUncleByBlockNumberAndIndexResult { fn from (other : ffi :: EthGetUncleByBlockNumberAndIndexResult) -> Self { super :: types :: EthGetUncleByBlockNumberAndIndexResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetUncleByBlockNumberAndIndexResult > for ffi :: EthGetUncleByBlockNumberAndIndexResult { fn from (other : super :: types :: EthGetUncleByBlockNumberAndIndexResult) -> Self { ffi :: EthGetUncleByBlockNumberAndIndexResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthSignInput > for super :: types :: EthSignInput { fn from (other : ffi :: EthSignInput) -> Self { super :: types :: EthSignInput { address : other . address . into () , message : other . message . into () , } } } impl From < super :: types :: EthSignInput > for ffi :: EthSignInput { fn from (other : super :: types :: EthSignInput) -> Self { ffi :: EthSignInput { address : other . address . into () , message : other . message . into () , } } } impl From < ffi :: EthCompileSolidityResult > for super :: types :: EthCompileSolidityResult { fn from (other : ffi :: EthCompileSolidityResult) -> Self { super :: types :: EthCompileSolidityResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileSolidityResult > for ffi :: EthCompileSolidityResult { fn from (other : super :: types :: EthCompileSolidityResult) -> Self { ffi :: EthCompileSolidityResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: EthGetTransactionByHashInput > for super :: types :: EthGetTransactionByHashInput { fn from (other : ffi :: EthGetTransactionByHashInput) -> Self { super :: types :: EthGetTransactionByHashInput { hash : other . hash . into () , } } } impl From < super :: types :: EthGetTransactionByHashInput > for ffi :: EthGetTransactionByHashInput { fn from (other : super :: types :: EthGetTransactionByHashInput) -> Self { ffi :: EthGetTransactionByHashInput { hash : other . hash . into () , } } } impl From < ffi :: ScriptSig > for super :: types :: ScriptSig { fn from (other : ffi :: ScriptSig) -> Self { super :: types :: ScriptSig { field_asm : other . field_asm . into () , hex : other . hex . into () , } } } impl From < super :: types :: ScriptSig > for ffi :: ScriptSig { fn from (other : super :: types :: ScriptSig) -> Self { ffi :: ScriptSig { field_asm : other . field_asm . into () , hex : other . hex . into () , } } } impl From < ffi :: Web3Sha3Result > for super :: types :: Web3Sha3Result { fn from (other : ffi :: Web3Sha3Result) -> Self { super :: types :: Web3Sha3Result { data : other . data . into () , } } } impl From < super :: types :: Web3Sha3Result > for ffi :: Web3Sha3Result { fn from (other : super :: types :: Web3Sha3Result) -> Self { ffi :: Web3Sha3Result { data : other . data . into () , } } } impl From < ffi :: EthGetBlockTransactionCountByHashResult > for super :: types :: EthGetBlockTransactionCountByHashResult { fn from (other : ffi :: EthGetBlockTransactionCountByHashResult) -> Self { super :: types :: EthGetBlockTransactionCountByHashResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByHashResult > for ffi :: EthGetBlockTransactionCountByHashResult { fn from (other : super :: types :: EthGetBlockTransactionCountByHashResult) -> Self { ffi :: EthGetBlockTransactionCountByHashResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: EthEstimateGasInput > for super :: types :: EthEstimateGasInput { fn from (other : ffi :: EthEstimateGasInput) -> Self { super :: types :: EthEstimateGasInput { transaction_info : Some (other . transaction_info . into ()) , block_number : Some (other . block_number . into ()) , } } } impl From < super :: types :: EthEstimateGasInput > for ffi :: EthEstimateGasInput { fn from (other : super :: types :: EthEstimateGasInput) -> Self { ffi :: EthEstimateGasInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , block_number : other . block_number . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthCompileLllInput > for super :: types :: EthCompileLllInput { fn from (other : ffi :: EthCompileLllInput) -> Self { super :: types :: EthCompileLllInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileLllInput > for ffi :: EthCompileLllInput { fn from (other : super :: types :: EthCompileLllInput) -> Self { ffi :: EthCompileLllInput { code : other . code . into () , } } } impl From < ffi :: EthMiningResult > for super :: types :: EthMiningResult { fn from (other : ffi :: EthMiningResult) -> Self { super :: types :: EthMiningResult { is_mining : other . is_mining . into () , } } } impl From < super :: types :: EthMiningResult > for ffi :: EthMiningResult { fn from (other : super :: types :: EthMiningResult) -> Self { ffi :: EthMiningResult { is_mining : other . is_mining . into () , } } } impl From < ffi :: EthSubmitHashrateInput > for super :: types :: EthSubmitHashrateInput { fn from (other : ffi :: EthSubmitHashrateInput) -> Self { super :: types :: EthSubmitHashrateInput { hash_rate : other . hash_rate . into () , id : other . id . into () , } } } impl From < super :: types :: EthSubmitHashrateInput > for ffi :: EthSubmitHashrateInput { fn from (other : super :: types :: EthSubmitHashrateInput) -> Self { ffi :: EthSubmitHashrateInput { hash_rate : other . hash_rate . into () , id : other . id . into () , } } } impl From < ffi :: PubKey > for super :: types :: PubKey { fn from (other : ffi :: PubKey) -> Self { super :: types :: PubKey { field_asm : other . field_asm . into () , hex : other . hex . into () , field_type : other . field_type . into () , req_sigs : other . req_sigs . into () , addresses : other . addresses . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: PubKey > for ffi :: PubKey { fn from (other : super :: types :: PubKey) -> Self { ffi :: PubKey { field_asm : other . field_asm . into () , hex : other . hex . into () , field_type : other . field_type . into () , req_sigs : other . req_sigs . into () , addresses : other . addresses . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthCompileSerpentInput > for super :: types :: EthCompileSerpentInput { fn from (other : ffi :: EthCompileSerpentInput) -> Self { super :: types :: EthCompileSerpentInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileSerpentInput > for ffi :: EthCompileSerpentInput { fn from (other : super :: types :: EthCompileSerpentInput) -> Self { ffi :: EthCompileSerpentInput { code : other . code . into () , } } } impl From < ffi :: EthGetCodeInput > for super :: types :: EthGetCodeInput { fn from (other : ffi :: EthGetCodeInput) -> Self { super :: types :: EthGetCodeInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetCodeInput > for ffi :: EthGetCodeInput { fn from (other : super :: types :: EthGetCodeInput) -> Self { ffi :: EthGetCodeInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthAccountsResult > for super :: types :: EthAccountsResult { fn from (other : ffi :: EthAccountsResult) -> Self { super :: types :: EthAccountsResult { accounts : other . accounts . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthAccountsResult > for ffi :: EthAccountsResult { fn from (other : super :: types :: EthAccountsResult) -> Self { ffi :: EthAccountsResult { accounts : other . accounts . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetUncleByBlockNumberAndIndexInput > for super :: types :: EthGetUncleByBlockNumberAndIndexInput { fn from (other : ffi :: EthGetUncleByBlockNumberAndIndexInput) -> Self { super :: types :: EthGetUncleByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetUncleByBlockNumberAndIndexInput > for ffi :: EthGetUncleByBlockNumberAndIndexInput { fn from (other : super :: types :: EthGetUncleByBlockNumberAndIndexInput) -> Self { ffi :: EthGetUncleByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < ffi :: EthGetStorageAtResult > for super :: types :: EthGetStorageAtResult { fn from (other : ffi :: EthGetStorageAtResult) -> Self { super :: types :: EthGetStorageAtResult { value : other . value . into () , } } } impl From < super :: types :: EthGetStorageAtResult > for ffi :: EthGetStorageAtResult { fn from (other : super :: types :: EthGetStorageAtResult) -> Self { ffi :: EthGetStorageAtResult { value : other . value . into () , } } } impl From < ffi :: EthSubmitWorkInput > for super :: types :: EthSubmitWorkInput { fn from (other : ffi :: EthSubmitWorkInput) -> Self { super :: types :: EthSubmitWorkInput { nounce : other . nounce . into () , pow_hash : other . pow_hash . into () , mix_digest : other . mix_digest . into () , } } } impl From < super :: types :: EthSubmitWorkInput > for ffi :: EthSubmitWorkInput { fn from (other : super :: types :: EthSubmitWorkInput) -> Self { ffi :: EthSubmitWorkInput { nounce : other . nounce . into () , pow_hash : other . pow_hash . into () , mix_digest : other . mix_digest . into () , } } } impl From < ffi :: EthChainIdResult > for super :: types :: EthChainIdResult { fn from (other : ffi :: EthChainIdResult) -> Self { super :: types :: EthChainIdResult { id : other . id . into () , } } } impl From < super :: types :: EthChainIdResult > for ffi :: EthChainIdResult { fn from (other : super :: types :: EthChainIdResult) -> Self { ffi :: EthChainIdResult { id : other . id . into () , } } } impl From < ffi :: EthSubmitHashrateResult > for super :: types :: EthSubmitHashrateResult { fn from (other : ffi :: EthSubmitHashrateResult) -> Self { super :: types :: EthSubmitHashrateResult { is_valid : other . is_valid . into () , } } } impl From < super :: types :: EthSubmitHashrateResult > for ffi :: EthSubmitHashrateResult { fn from (other : super :: types :: EthSubmitHashrateResult) -> Self { ffi :: EthSubmitHashrateResult { is_valid : other . is_valid . into () , } } } impl From < ffi :: EthSendTransactionInput > for super :: types :: EthSendTransactionInput { fn from (other : ffi :: EthSendTransactionInput) -> Self { super :: types :: EthSendTransactionInput { transaction_info : Some (other . transaction_info . into ()) , } } } impl From < super :: types :: EthSendTransactionInput > for ffi :: EthSendTransactionInput { fn from (other : super :: types :: EthSendTransactionInput) -> Self { ffi :: EthSendTransactionInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetTransactionByHashResult > for super :: types :: EthGetTransactionByHashResult { fn from (other : ffi :: EthGetTransactionByHashResult) -> Self { super :: types :: EthGetTransactionByHashResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByHashResult > for ffi :: EthGetTransactionByHashResult { fn from (other : super :: types :: EthGetTransactionByHashResult) -> Self { ffi :: EthGetTransactionByHashResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetTransactionByBlockNumberAndIndexInput > for super :: types :: EthGetTransactionByBlockNumberAndIndexInput { fn from (other : ffi :: EthGetTransactionByBlockNumberAndIndexInput) -> Self { super :: types :: EthGetTransactionByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetTransactionByBlockNumberAndIndexInput > for ffi :: EthGetTransactionByBlockNumberAndIndexInput { fn from (other : super :: types :: EthGetTransactionByBlockNumberAndIndexInput) -> Self { ffi :: EthGetTransactionByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < ffi :: EthSendRawTransactionInput > for super :: types :: EthSendRawTransactionInput { fn from (other : ffi :: EthSendRawTransactionInput) -> Self { super :: types :: EthSendRawTransactionInput { transaction : other . transaction . into () , } } } impl From < super :: types :: EthSendRawTransactionInput > for ffi :: EthSendRawTransactionInput { fn from (other : super :: types :: EthSendRawTransactionInput) -> Self { ffi :: EthSendRawTransactionInput { transaction : other . transaction . into () , } } } impl From < ffi :: EthBlockInfo > for super :: types :: EthBlockInfo { fn from (other : ffi :: EthBlockInfo) -> Self { super :: types :: EthBlockInfo { block_number : other . block_number . into () , hash : other . hash . into () , parent_hash : other . parent_hash . into () , nonce : other . nonce . into () , sha3_uncles : other . sha3_uncles . into () , logs_bloom : other . logs_bloom . into () , transactions_root : other . transactions_root . into () , state_root : other . state_root . into () , receipt_root : other . receipt_root . into () , miner : other . miner . into () , difficulty : other . difficulty . into () , total_difficulty : other . total_difficulty . into () , extra_data : other . extra_data . into () , size : other . size . into () , gas_limit : other . gas_limit . into () , gas_used : other . gas_used . into () , timestamps : other . timestamps . into () , transactions : other . transactions . into_iter () . map (Into :: into) . collect () , uncles : other . uncles . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthBlockInfo > for ffi :: EthBlockInfo { fn from (other : super :: types :: EthBlockInfo) -> Self { ffi :: EthBlockInfo { block_number : other . block_number . into () , hash : other . hash . into () , parent_hash : other . parent_hash . into () , nonce : other . nonce . into () , sha3_uncles : other . sha3_uncles . into () , logs_bloom : other . logs_bloom . into () , transactions_root : other . transactions_root . into () , state_root : other . state_root . into () , receipt_root : other . receipt_root . into () , miner : other . miner . into () , difficulty : other . difficulty . into () , total_difficulty : other . total_difficulty . into () , extra_data : other . extra_data . into () , size : other . size . into () , gas_limit : other . gas_limit . into () , gas_used : other . gas_used . into () , timestamps : other . timestamps . into () , transactions : other . transactions . into_iter () . map (Into :: into) . collect () , uncles : other . uncles . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetBlockTransactionCountByNumberResult > for super :: types :: EthGetBlockTransactionCountByNumberResult { fn from (other : ffi :: EthGetBlockTransactionCountByNumberResult) -> Self { super :: types :: EthGetBlockTransactionCountByNumberResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByNumberResult > for ffi :: EthGetBlockTransactionCountByNumberResult { fn from (other : super :: types :: EthGetBlockTransactionCountByNumberResult) -> Self { ffi :: EthGetBlockTransactionCountByNumberResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: EthProtocolVersionResult > for super :: types :: EthProtocolVersionResult { fn from (other : ffi :: EthProtocolVersionResult) -> Self { super :: types :: EthProtocolVersionResult { protocol_version : other . protocol_version . into () , } } } impl From < super :: types :: EthProtocolVersionResult > for ffi :: EthProtocolVersionResult { fn from (other : super :: types :: EthProtocolVersionResult) -> Self { ffi :: EthProtocolVersionResult { protocol_version : other . protocol_version . into () , } } } impl From < ffi :: EthSyncingResult > for super :: types :: EthSyncingResult { fn from (other : ffi :: EthSyncingResult) -> Self { super :: types :: EthSyncingResult { status : Some (other . status . into ()) , sync_info : Some (other . sync_info . into ()) , } } } impl From < super :: types :: EthSyncingResult > for ffi :: EthSyncingResult { fn from (other : super :: types :: EthSyncingResult) -> Self { ffi :: EthSyncingResult { status : other . status . map (Into :: into) . unwrap_or_default () , sync_info : other . sync_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: Vin > for super :: types :: Vin { fn from (other : ffi :: Vin) -> Self { super :: types :: Vin { txid : other . txid . into () , vout : other . vout . into () , script_sig : Some (other . script_sig . into ()) , sequence : other . sequence . into () , txinwitness : other . txinwitness . into_iter () . map (Into :: into) . collect () , coinbase : other . coinbase . into () , } } } impl From < super :: types :: Vin > for ffi :: Vin { fn from (other : super :: types :: Vin) -> Self { ffi :: Vin { txid : other . txid . into () , vout : other . vout . into () , script_sig : other . script_sig . map (Into :: into) . unwrap_or_default () , sequence : other . sequence . into () , txinwitness : other . txinwitness . into_iter () . map (Into :: into) . collect () , coinbase : other . coinbase . into () , } } } impl From < ffi :: EthGetTransactionCountInput > for super :: types :: EthGetTransactionCountInput { fn from (other : ffi :: EthGetTransactionCountInput) -> Self { super :: types :: EthGetTransactionCountInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetTransactionCountInput > for ffi :: EthGetTransactionCountInput { fn from (other : super :: types :: EthGetTransactionCountInput) -> Self { ffi :: EthGetTransactionCountInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthGetTransactionReceiptInput > for super :: types :: EthGetTransactionReceiptInput { fn from (other : ffi :: EthGetTransactionReceiptInput) -> Self { super :: types :: EthGetTransactionReceiptInput { transaction_hash : other . transaction_hash . into () , } } } impl From < super :: types :: EthGetTransactionReceiptInput > for ffi :: EthGetTransactionReceiptInput { fn from (other : super :: types :: EthGetTransactionReceiptInput) -> Self { ffi :: EthGetTransactionReceiptInput { transaction_hash : other . transaction_hash . into () , } } } impl From < ffi :: EthHashRateResult > for super :: types :: EthHashRateResult { fn from (other : ffi :: EthHashRateResult) -> Self { super :: types :: EthHashRateResult { hash_rate : other . hash_rate . into () , } } } impl From < super :: types :: EthHashRateResult > for ffi :: EthHashRateResult { fn from (other : super :: types :: EthHashRateResult) -> Self { ffi :: EthHashRateResult { hash_rate : other . hash_rate . into () , } } } impl From < ffi :: EthGetBlockByHashResult > for super :: types :: EthGetBlockByHashResult { fn from (other : ffi :: EthGetBlockByHashResult) -> Self { super :: types :: EthGetBlockByHashResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetBlockByHashResult > for ffi :: EthGetBlockByHashResult { fn from (other : super :: types :: EthGetBlockByHashResult) -> Self { ffi :: EthGetBlockByHashResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetBalanceInput > for super :: types :: EthGetBalanceInput { fn from (other : ffi :: EthGetBalanceInput) -> Self { super :: types :: EthGetBalanceInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetBalanceInput > for ffi :: EthGetBalanceInput { fn from (other : super :: types :: EthGetBalanceInput) -> Self { ffi :: EthGetBalanceInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthSignTransactionResult > for super :: types :: EthSignTransactionResult { fn from (other : ffi :: EthSignTransactionResult) -> Self { super :: types :: EthSignTransactionResult { transaction : other . transaction . into () , } } } impl From < super :: types :: EthSignTransactionResult > for ffi :: EthSignTransactionResult { fn from (other : super :: types :: EthSignTransactionResult) -> Self { ffi :: EthSignTransactionResult { transaction : other . transaction . into () , } } } impl From < ffi :: Block > for super :: types :: Block { fn from (other : ffi :: Block) -> Self { super :: types :: Block { hash : other . hash . into () , confirmations : other . confirmations . into () , size : other . size . into () , strippedsize : other . strippedsize . into () , weight : other . weight . into () , height : other . height . into () , version : other . version . into () , version_hex : other . version_hex . into () , merkleroot : other . merkleroot . into () , tx : other . tx . into_iter () . map (Into :: into) . collect () , time : other . time . into () , mediantime : other . mediantime . into () , nonce : other . nonce . into () , bits : other . bits . into () , difficulty : other . difficulty . into () , chainwork : other . chainwork . into () , n_tx : other . n_tx . into () , previous_block_hash : other . previous_block_hash . into () , next_block_hash : other . next_block_hash . into () , masternode : other . masternode . into () , minter : other . minter . into () , minted_blocks : other . minted_blocks . into () , stake_modifier : other . stake_modifier . into () , nonutxo : other . nonutxo . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: Block > for ffi :: Block { fn from (other : super :: types :: Block) -> Self { ffi :: Block { hash : other . hash . into () , confirmations : other . confirmations . into () , size : other . size . into () , strippedsize : other . strippedsize . into () , weight : other . weight . into () , height : other . height . into () , version : other . version . into () , version_hex : other . version_hex . into () , merkleroot : other . merkleroot . into () , tx : other . tx . into_iter () . map (Into :: into) . collect () , time : other . time . into () , mediantime : other . mediantime . into () , nonce : other . nonce . into () , bits : other . bits . into () , difficulty : other . difficulty . into () , chainwork : other . chainwork . into () , n_tx : other . n_tx . into () , previous_block_hash : other . previous_block_hash . into () , next_block_hash : other . next_block_hash . into () , masternode : other . masternode . into () , minter : other . minter . into () , minted_blocks : other . minted_blocks . into () , stake_modifier : other . stake_modifier . into () , nonutxo : other . nonutxo . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthCallInput > for super :: types :: EthCallInput { fn from (other : ffi :: EthCallInput) -> Self { super :: types :: EthCallInput { transaction_info : Some (other . transaction_info . into ()) , block_number : other . block_number . into () , } } } impl From < super :: types :: EthCallInput > for ffi :: EthCallInput { fn from (other : super :: types :: EthCallInput) -> Self { ffi :: EthCallInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , block_number : other . block_number . into () , } } } impl From < ffi :: EthGasPriceResult > for super :: types :: EthGasPriceResult { fn from (other : ffi :: EthGasPriceResult) -> Self { super :: types :: EthGasPriceResult { gas_price : other . gas_price . into () , } } } impl From < super :: types :: EthGasPriceResult > for ffi :: EthGasPriceResult { fn from (other : super :: types :: EthGasPriceResult) -> Self { ffi :: EthGasPriceResult { gas_price : other . gas_price . into () , } } } impl From < ffi :: EthGetTransactionCountResult > for super :: types :: EthGetTransactionCountResult { fn from (other : ffi :: EthGetTransactionCountResult) -> Self { super :: types :: EthGetTransactionCountResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetTransactionCountResult > for ffi :: EthGetTransactionCountResult { fn from (other : super :: types :: EthGetTransactionCountResult) -> Self { ffi :: EthGetTransactionCountResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: EthGetTransactionReceiptResult > for super :: types :: EthGetTransactionReceiptResult { fn from (other : ffi :: EthGetTransactionReceiptResult) -> Self { super :: types :: EthGetTransactionReceiptResult { transaction_receipt : Some (other . transaction_receipt . into ()) , } } } impl From < super :: types :: EthGetTransactionReceiptResult > for ffi :: EthGetTransactionReceiptResult { fn from (other : super :: types :: EthGetTransactionReceiptResult) -> Self { ffi :: EthGetTransactionReceiptResult { transaction_receipt : other . transaction_receipt . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthTransactionReceipt > for super :: types :: EthTransactionReceipt { fn from (other : ffi :: EthTransactionReceipt) -> Self { super :: types :: EthTransactionReceipt { transaction_hash : other . transaction_hash . into () , transaction_index : other . transaction_index . into () , block_hash : other . block_hash . into () , block_number : other . block_number . into () , from : other . from . into () , to : other . to . into () , cumulative_gas_used : other . cumulative_gas_used . into () , effective_gas_price : other . effective_gas_price . into () , gas_used : other . gas_used . into () , contract_address : other . contract_address . into () , logs : other . logs . into_iter () . map (Into :: into) . collect () , logs_bloom : other . logs_bloom . into () , field_type : other . field_type . into () , root : Some (other . root . into ()) , status : Some (other . status . into ()) , } } } impl From < super :: types :: EthTransactionReceipt > for ffi :: EthTransactionReceipt { fn from (other : super :: types :: EthTransactionReceipt) -> Self { ffi :: EthTransactionReceipt { transaction_hash : other . transaction_hash . into () , transaction_index : other . transaction_index . into () , block_hash : other . block_hash . into () , block_number : other . block_number . into () , from : other . from . into () , to : other . to . into () , cumulative_gas_used : other . cumulative_gas_used . into () , effective_gas_price : other . effective_gas_price . into () , gas_used : other . gas_used . into () , contract_address : other . contract_address . into () , logs : other . logs . into_iter () . map (Into :: into) . collect () , logs_bloom : other . logs_bloom . into () , field_type : other . field_type . into () , root : other . root . map (Into :: into) . unwrap_or_default () , status : other . status . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetBlockTransactionCountByNumberInput > for super :: types :: EthGetBlockTransactionCountByNumberInput { fn from (other : ffi :: EthGetBlockTransactionCountByNumberInput) -> Self { super :: types :: EthGetBlockTransactionCountByNumberInput { block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByNumberInput > for ffi :: EthGetBlockTransactionCountByNumberInput { fn from (other : super :: types :: EthGetBlockTransactionCountByNumberInput) -> Self { ffi :: EthGetBlockTransactionCountByNumberInput { block_number : other . block_number . into () , } } } impl From < ffi :: EthCompileSolidityInput > for super :: types :: EthCompileSolidityInput { fn from (other : ffi :: EthCompileSolidityInput) -> Self { super :: types :: EthCompileSolidityInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileSolidityInput > for ffi :: EthCompileSolidityInput { fn from (other : super :: types :: EthCompileSolidityInput) -> Self { ffi :: EthCompileSolidityInput { code : other . code . into () , } } } impl From < ffi :: EthSubmitWorkResult > for super :: types :: EthSubmitWorkResult { fn from (other : ffi :: EthSubmitWorkResult) -> Self { super :: types :: EthSubmitWorkResult { is_valid : other . is_valid . into () , } } } impl From < super :: types :: EthSubmitWorkResult > for ffi :: EthSubmitWorkResult { fn from (other : super :: types :: EthSubmitWorkResult) -> Self { ffi :: EthSubmitWorkResult { is_valid : other . is_valid . into () , } } } impl From < ffi :: RawTransaction > for super :: types :: RawTransaction { fn from (other : ffi :: RawTransaction) -> Self { super :: types :: RawTransaction { in_active_chain : other . in_active_chain . into () , hex : other . hex . into () , txid : other . txid . into () , hash : other . hash . into () , size : other . size . into () , vsize : other . vsize . into () , weight : other . weight . into () , version : other . version . into () , locktime : other . locktime . into () , vin : other . vin . into_iter () . map (Into :: into) . collect () , vout : other . vout . into_iter () . map (Into :: into) . collect () , blockhash : other . blockhash . into () , confirmations : other . confirmations . into () , blocktime : other . blocktime . into () , } } } impl From < super :: types :: RawTransaction > for ffi :: RawTransaction { fn from (other : super :: types :: RawTransaction) -> Self { ffi :: RawTransaction { in_active_chain : other . in_active_chain . into () , hex : other . hex . into () , txid : other . txid . into () , hash : other . hash . into () , size : other . size . into () , vsize : other . vsize . into () , weight : other . weight . into () , version : other . version . into () , locktime : other . locktime . into () , vin : other . vin . into_iter () . map (Into :: into) . collect () , vout : other . vout . into_iter () . map (Into :: into) . collect () , blockhash : other . blockhash . into () , confirmations : other . confirmations . into () , blocktime : other . blocktime . into () , } } } impl From < ffi :: EthGetTransactionByBlockHashAndIndexResult > for super :: types :: EthGetTransactionByBlockHashAndIndexResult { fn from (other : ffi :: EthGetTransactionByBlockHashAndIndexResult) -> Self { super :: types :: EthGetTransactionByBlockHashAndIndexResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByBlockHashAndIndexResult > for ffi :: EthGetTransactionByBlockHashAndIndexResult { fn from (other : super :: types :: EthGetTransactionByBlockHashAndIndexResult) -> Self { ffi :: EthGetTransactionByBlockHashAndIndexResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: Vout > for super :: types :: Vout { fn from (other : ffi :: Vout) -> Self { super :: types :: Vout { value : other . value . into () , n : other . n . into () , script_pub_key : Some (other . script_pub_key . into ()) , token_id : other . token_id . into () , } } } impl From < super :: types :: Vout > for ffi :: Vout { fn from (other : super :: types :: Vout) -> Self { ffi :: Vout { value : other . value . into () , n : other . n . into () , script_pub_key : other . script_pub_key . map (Into :: into) . unwrap_or_default () , token_id : other . token_id . into () , } } } impl From < ffi :: EthBlockNumberResult > for super :: types :: EthBlockNumberResult { fn from (other : ffi :: EthBlockNumberResult) -> Self { super :: types :: EthBlockNumberResult { block_number : other . block_number . into () , } } } impl From < super :: types :: EthBlockNumberResult > for ffi :: EthBlockNumberResult { fn from (other : super :: types :: EthBlockNumberResult) -> Self { ffi :: EthBlockNumberResult { block_number : other . block_number . into () , } } } impl From < ffi :: EthSendTransactionResult > for super :: types :: EthSendTransactionResult { fn from (other : ffi :: EthSendTransactionResult) -> Self { super :: types :: EthSendTransactionResult { hash : other . hash . into () , } } } impl From < super :: types :: EthSendTransactionResult > for ffi :: EthSendTransactionResult { fn from (other : super :: types :: EthSendTransactionResult) -> Self { ffi :: EthSendTransactionResult { hash : other . hash . into () , } } } impl From < ffi :: BlockResult > for super :: types :: BlockResult { fn from (other : ffi :: BlockResult) -> Self { super :: types :: BlockResult { hash : other . hash . into () , block : Some (other . block . into ()) , } } } impl From < super :: types :: BlockResult > for ffi :: BlockResult { fn from (other : super :: types :: BlockResult) -> Self { ffi :: BlockResult { hash : other . hash . into () , block : other . block . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: Web3Sha3Input > for super :: types :: Web3Sha3Input { fn from (other : ffi :: Web3Sha3Input) -> Self { super :: types :: Web3Sha3Input { data : other . data . into () , } } } impl From < super :: types :: Web3Sha3Input > for ffi :: Web3Sha3Input { fn from (other : super :: types :: Web3Sha3Input) -> Self { ffi :: Web3Sha3Input { data : other . data . into () , } } } impl From < ffi :: EthGetCodeResult > for super :: types :: EthGetCodeResult { fn from (other : ffi :: EthGetCodeResult) -> Self { super :: types :: EthGetCodeResult { code : other . code . into () , } } } impl From < super :: types :: EthGetCodeResult > for ffi :: EthGetCodeResult { fn from (other : super :: types :: EthGetCodeResult) -> Self { ffi :: EthGetCodeResult { code : other . code . into () , } } } impl From < ffi :: Transaction > for super :: types :: Transaction { fn from (other : ffi :: Transaction) -> Self { super :: types :: Transaction { hash : other . hash . into () , raw : Some (other . raw . into ()) , } } } impl From < super :: types :: Transaction > for ffi :: Transaction { fn from (other : super :: types :: Transaction) -> Self { ffi :: Transaction { hash : other . hash . into () , raw : other . raw . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: NonUtxo > for super :: types :: NonUtxo { fn from (other : ffi :: NonUtxo) -> Self { super :: types :: NonUtxo { anchor_reward : other . anchor_reward . into () , burnt : other . burnt . into () , incentive_funding : other . incentive_funding . into () , loan : other . loan . into () , options : other . options . into () , unknown : other . unknown . into () , } } } impl From < super :: types :: NonUtxo > for ffi :: NonUtxo { fn from (other : super :: types :: NonUtxo) -> Self { ffi :: NonUtxo { anchor_reward : other . anchor_reward . into () , burnt : other . burnt . into () , incentive_funding : other . incentive_funding . into () , loan : other . loan . into () , options : other . options . into () , unknown : other . unknown . into () , } } } impl From < ffi :: EthEstimateGasResult > for super :: types :: EthEstimateGasResult { fn from (other : ffi :: EthEstimateGasResult) -> Self { super :: types :: EthEstimateGasResult { gas_used : other . gas_used . into () , } } } impl From < super :: types :: EthEstimateGasResult > for ffi :: EthEstimateGasResult { fn from (other : super :: types :: EthEstimateGasResult) -> Self { ffi :: EthEstimateGasResult { gas_used : other . gas_used . into () , } } } impl From < ffi :: EthGetUncleCountByBlockNumberInput > for super :: types :: EthGetUncleCountByBlockNumberInput { fn from (other : ffi :: EthGetUncleCountByBlockNumberInput) -> Self { super :: types :: EthGetUncleCountByBlockNumberInput { block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockNumberInput > for ffi :: EthGetUncleCountByBlockNumberInput { fn from (other : super :: types :: EthGetUncleCountByBlockNumberInput) -> Self { ffi :: EthGetUncleCountByBlockNumberInput { block_number : other . block_number . into () , } } } impl From < ffi :: EthGetBalanceResult > for super :: types :: EthGetBalanceResult { fn from (other : ffi :: EthGetBalanceResult) -> Self { super :: types :: EthGetBalanceResult { balance : other . balance . into () , } } } impl From < super :: types :: EthGetBalanceResult > for ffi :: EthGetBalanceResult { fn from (other : super :: types :: EthGetBalanceResult) -> Self { ffi :: EthGetBalanceResult { balance : other . balance . into () , } } } impl From < ffi :: EthGetStorageAtInput > for super :: types :: EthGetStorageAtInput { fn from (other : ffi :: EthGetStorageAtInput) -> Self { super :: types :: EthGetStorageAtInput { address : other . address . into () , position : other . position . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetStorageAtInput > for ffi :: EthGetStorageAtInput { fn from (other : super :: types :: EthGetStorageAtInput) -> Self { ffi :: EthGetStorageAtInput { address : other . address . into () , position : other . position . into () , block_number : other . block_number . into () , } } } impl From < ffi :: BlockInput > for super :: types :: BlockInput { fn from (other : ffi :: BlockInput) -> Self { super :: types :: BlockInput { blockhash : other . blockhash . into () , verbosity : other . verbosity . into () , } } } impl From < super :: types :: BlockInput > for ffi :: BlockInput { fn from (other : super :: types :: BlockInput) -> Self { ffi :: BlockInput { blockhash : other . blockhash . into () , verbosity : other . verbosity . into () , } } } impl From < ffi :: EthGetTransactionByBlockNumberAndIndexResult > for super :: types :: EthGetTransactionByBlockNumberAndIndexResult { fn from (other : ffi :: EthGetTransactionByBlockNumberAndIndexResult) -> Self { super :: types :: EthGetTransactionByBlockNumberAndIndexResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByBlockNumberAndIndexResult > for ffi :: EthGetTransactionByBlockNumberAndIndexResult { fn from (other : super :: types :: EthGetTransactionByBlockNumberAndIndexResult) -> Self { ffi :: EthGetTransactionByBlockNumberAndIndexResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetCompilersResult > for super :: types :: EthGetCompilersResult { fn from (other : ffi :: EthGetCompilersResult) -> Self { super :: types :: EthGetCompilersResult { compilers : other . compilers . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthGetCompilersResult > for ffi :: EthGetCompilersResult { fn from (other : super :: types :: EthGetCompilersResult) -> Self { ffi :: EthGetCompilersResult { compilers : other . compilers . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthCompileSerpentResult > for super :: types :: EthCompileSerpentResult { fn from (other : ffi :: EthCompileSerpentResult) -> Self { super :: types :: EthCompileSerpentResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileSerpentResult > for ffi :: EthCompileSerpentResult { fn from (other : super :: types :: EthCompileSerpentResult) -> Self { ffi :: EthCompileSerpentResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: NetPeerCountResult > for super :: types :: NetPeerCountResult { fn from (other : ffi :: NetPeerCountResult) -> Self { super :: types :: NetPeerCountResult { number_peer : other . number_peer . into () , } } } impl From < super :: types :: NetPeerCountResult > for ffi :: NetPeerCountResult { fn from (other : super :: types :: NetPeerCountResult) -> Self { ffi :: NetPeerCountResult { number_peer : other . number_peer . into () , } } } impl From < ffi :: EthGetUncleByBlockHashAndIndexInput > for super :: types :: EthGetUncleByBlockHashAndIndexInput { fn from (other : ffi :: EthGetUncleByBlockHashAndIndexInput) -> Self { super :: types :: EthGetUncleByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetUncleByBlockHashAndIndexInput > for ffi :: EthGetUncleByBlockHashAndIndexInput { fn from (other : super :: types :: EthGetUncleByBlockHashAndIndexInput) -> Self { ffi :: EthGetUncleByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < ffi :: NetVersionResult > for super :: types :: NetVersionResult { fn from (other : ffi :: NetVersionResult) -> Self { super :: types :: NetVersionResult { network_version : other . network_version . into () , } } } impl From < super :: types :: NetVersionResult > for ffi :: NetVersionResult { fn from (other : super :: types :: NetVersionResult) -> Self { ffi :: NetVersionResult { network_version : other . network_version . into () , } } } impl From < ffi :: BlockHashResult > for super :: types :: BlockHashResult { fn from (other : ffi :: BlockHashResult) -> Self { super :: types :: BlockHashResult { hash : other . hash . into () , } } } impl From < super :: types :: BlockHashResult > for ffi :: BlockHashResult { fn from (other : super :: types :: BlockHashResult) -> Self { ffi :: BlockHashResult { hash : other . hash . into () , } } } impl From < ffi :: Web3ClientVersionResult > for super :: types :: Web3ClientVersionResult { fn from (other : ffi :: Web3ClientVersionResult) -> Self { super :: types :: Web3ClientVersionResult { client_version : other . client_version . into () , } } } impl From < super :: types :: Web3ClientVersionResult > for ffi :: Web3ClientVersionResult { fn from (other : super :: types :: Web3ClientVersionResult) -> Self { ffi :: Web3ClientVersionResult { client_version : other . client_version . into () , } } } impl From < ffi :: EthGetUncleCountByBlockHashInput > for super :: types :: EthGetUncleCountByBlockHashInput { fn from (other : ffi :: EthGetUncleCountByBlockHashInput) -> Self { super :: types :: EthGetUncleCountByBlockHashInput { block_hash : other . block_hash . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockHashInput > for ffi :: EthGetUncleCountByBlockHashInput { fn from (other : super :: types :: EthGetUncleCountByBlockHashInput) -> Self { ffi :: EthGetUncleCountByBlockHashInput { block_hash : other . block_hash . into () , } } } impl From < ffi :: EthGetUncleByBlockHashAndIndexResult > for super :: types :: EthGetUncleByBlockHashAndIndexResult { fn from (other : ffi :: EthGetUncleByBlockHashAndIndexResult) -> Self { super :: types :: EthGetUncleByBlockHashAndIndexResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetUncleByBlockHashAndIndexResult > for ffi :: EthGetUncleByBlockHashAndIndexResult { fn from (other : super :: types :: EthGetUncleByBlockHashAndIndexResult) -> Self { ffi :: EthGetUncleByBlockHashAndIndexResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetBlockByHashInput > for super :: types :: EthGetBlockByHashInput { fn from (other : ffi :: EthGetBlockByHashInput) -> Self { super :: types :: EthGetBlockByHashInput { hash : other . hash . into () , full_transaction : other . full_transaction . into () , } } } impl From < super :: types :: EthGetBlockByHashInput > for ffi :: EthGetBlockByHashInput { fn from (other : super :: types :: EthGetBlockByHashInput) -> Self { ffi :: EthGetBlockByHashInput { hash : other . hash . into () , full_transaction : other . full_transaction . into () , } } } impl From < ffi :: EthGetWorkResult > for super :: types :: EthGetWorkResult { fn from (other : ffi :: EthGetWorkResult) -> Self { super :: types :: EthGetWorkResult { currentblock : other . currentblock . into () , seed_hash : other . seed_hash . into () , target : other . target . into () , } } } impl From < super :: types :: EthGetWorkResult > for ffi :: EthGetWorkResult { fn from (other : super :: types :: EthGetWorkResult) -> Self { ffi :: EthGetWorkResult { currentblock : other . currentblock . into () , seed_hash : other . seed_hash . into () , target : other . target . into () , } } } impl From < ffi :: EthGetTransactionByBlockHashAndIndexInput > for super :: types :: EthGetTransactionByBlockHashAndIndexInput { fn from (other : ffi :: EthGetTransactionByBlockHashAndIndexInput) -> Self { super :: types :: EthGetTransactionByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetTransactionByBlockHashAndIndexInput > for ffi :: EthGetTransactionByBlockHashAndIndexInput { fn from (other : super :: types :: EthGetTransactionByBlockHashAndIndexInput) -> Self { ffi :: EthGetTransactionByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Accounts (client : & Box < Client >) -> Result < ffi :: EthAccountsResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthAccountsResult , _ > = c . request ("eth_accounts" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Call (client : & Box < Client > , eth_call_input : EthCallInput) -> Result < ffi :: EthCallResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_call_input = super :: types :: EthCallInput :: from (eth_call_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_call_input . transaction_info , & eth_call_input . block_number] ; let resp : Result < super :: types :: EthCallResult , _ > = c . request ("eth_call" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBalance (client : & Box < Client > , eth_get_balance_input : EthGetBalanceInput) -> Result < ffi :: EthGetBalanceResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_balance_input = super :: types :: EthGetBalanceInput :: from (eth_get_balance_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_balance_input . address , & eth_get_balance_input . block_number] ; let resp : Result < super :: types :: EthGetBalanceResult , _ > = c . request ("eth_getbalance" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByHash (client : & Box < Client > , eth_get_block_by_hash_input : EthGetBlockByHashInput) -> Result < ffi :: EthBlockInfo , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_block_by_hash_input = super :: types :: EthGetBlockByHashInput :: from (eth_get_block_by_hash_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_block_by_hash_input . hash , & eth_get_block_by_hash_input . full_transaction] ; let resp : Result < super :: types :: EthBlockInfo , _ > = c . request ("eth_getblockbyhash" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_ChainId (client : & Box < Client >) -> Result < ffi :: EthChainIdResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthChainIdResult , _ > = c . request ("eth_chainid" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallNet_Version (client : & Box < Client >) -> Result < ffi :: EthChainIdResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthChainIdResult , _ > = c . request ("net_version" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_BlockNumber (client : & Box < Client >) -> Result < ffi :: EthBlockNumberResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthBlockNumberResult , _ > = c . request ("eth_blocknumber" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByNumber (client : & Box < Client > , eth_get_block_by_number_input : EthGetBlockByNumberInput) -> Result < ffi :: EthBlockInfo , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_block_by_number_input = super :: types :: EthGetBlockByNumberInput :: from (eth_get_block_by_number_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_block_by_number_input . number , & eth_get_block_by_number_input . full_transaction] ; let resp : Result < super :: types :: EthBlockInfo , _ > = c . request ("eth_getblockbynumber" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Mining (client : & Box < Client >) -> Result < ffi :: EthMiningResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthMiningResult , _ > = c . request ("eth_mining" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) }# [derive (Clone)] pub struct EthService { # [allow (dead_code)] adapter : Arc < Handlers > } impl EthService { # [inline] # [allow (dead_code)] pub fn new (adapter : Arc < Handlers >) -> EthService { EthService { adapter } } # [inline] # [allow (dead_code)] pub fn service (& self) -> eth_server :: EthServer < EthService > { eth_server :: EthServer :: new (self . clone ()) } # [inline] # [allow (unused_mut , dead_code)] pub fn module (& self) -> Result < jsonrpsee_http_server :: RpcModule < () > , jsonrpsee_core :: Error > { let mut module = jsonrpsee_http_server :: RpcModule :: new (()) ; let adapter = self . adapter . clone () ; module . register_method ("eth_accounts" , move | _params , _ | { Self :: Eth_Accounts (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_call" , move | _params , _ | { let mut eth_call_input = super :: types :: EthCallInput :: default () ; if _params . is_object () { eth_call_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_call_input . transaction_info = seq . next () . map_err (| _ | missing_param ("transaction_info")) ? ; eth_call_input . block_number = seq . next () . map_err (| _ | missing_param ("block_number")) ? ; } let mut input = eth_call_input . into () ; Self :: Eth_Call (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getbalance" , move | _params , _ | { let mut eth_get_balance_input = super :: types :: EthGetBalanceInput :: default () ; if _params . is_object () { eth_get_balance_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_balance_input . address = seq . next () . map_err (| _ | missing_param ("address")) ? ; eth_get_balance_input . block_number = seq . next () . map_err (| _ | missing_param ("block_number")) ? ; } let mut input = eth_get_balance_input . into () ; Self :: Eth_GetBalance (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getblockbyhash" , move | _params , _ | { let mut eth_get_block_by_hash_input = super :: types :: EthGetBlockByHashInput :: default () ; if _params . is_object () { eth_get_block_by_hash_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_block_by_hash_input . hash = seq . next () . map_err (| _ | missing_param ("hash")) ? ; eth_get_block_by_hash_input . full_transaction = seq . next () . map_err (| _ | missing_param ("full_transaction")) ? ; } let mut input = eth_get_block_by_hash_input . into () ; Self :: Eth_GetBlockByHash (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_chainid" , move | _params , _ | { Self :: Eth_ChainId (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("net_version" , move | _params , _ | { Self :: Net_Version (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_blocknumber" , move | _params , _ | { Self :: Eth_BlockNumber (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getblockbynumber" , move | _params , _ | { let mut eth_get_block_by_number_input = super :: types :: EthGetBlockByNumberInput :: default () ; if _params . is_object () { eth_get_block_by_number_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_block_by_number_input . number = seq . next () . map_err (| _ | missing_param ("number")) ? ; eth_get_block_by_number_input . full_transaction = seq . next () . map_err (| _ | missing_param ("full_transaction")) ? ; } let mut input = eth_get_block_by_number_input . into () ; Self :: Eth_GetBlockByNumber (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_mining" , move | _params , _ | { Self :: Eth_Mining (adapter . clone () ,) }) ? ; Ok (module) } } # [tonic :: async_trait] impl eth_server :: Eth for EthService { async fn eth_accounts (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthAccountsResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_Accounts (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_call (& self , request : tonic :: Request < super :: types :: EthCallInput >) -> Result < tonic :: Response < super :: types :: EthCallResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_Call (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_balance (& self , request : tonic :: Request < super :: types :: EthGetBalanceInput >) -> Result < tonic :: Response < super :: types :: EthGetBalanceResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBalance (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_block_by_hash (& self , request : tonic :: Request < super :: types :: EthGetBlockByHashInput >) -> Result < tonic :: Response < super :: types :: EthBlockInfo > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBlockByHash (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } # [allow (unused_variables)] async fn eth_send_transaction (& self , request : tonic :: Request < super :: types :: EthSendTransactionInput >) -> Result < tonic :: Response < super :: types :: EthSendTransactionResult > , tonic :: Status > { unimplemented ! () ; } async fn eth_chain_id (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthChainIdResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_ChainId (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn net_version (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthChainIdResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Net_Version (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_block_number (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthBlockNumberResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_BlockNumber (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_block_by_number (& self , request : tonic :: Request < super :: types :: EthGetBlockByNumberInput >) -> Result < tonic :: Response < super :: types :: EthBlockInfo > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBlockByNumber (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_mining (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthMiningResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_Mining (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } }# [derive (Clone)] pub struct BlockchainService { # [allow (dead_code)] adapter : Arc < Handlers > } impl BlockchainService { # [inline] # [allow (dead_code)] pub fn new (adapter : Arc < Handlers >) -> BlockchainService { BlockchainService { adapter } } # [inline] # [allow (dead_code)] pub fn service (& self) -> blockchain_server :: BlockchainServer < BlockchainService > { blockchain_server :: BlockchainServer :: new (self . clone ()) } # [inline] # [allow (unused_mut , dead_code)] pub fn module (& self) -> Result < jsonrpsee_http_server :: RpcModule < () > , jsonrpsee_core :: Error > { let mut module = jsonrpsee_http_server :: RpcModule :: new (()) ; Ok (module) } } # [tonic :: async_trait] impl blockchain_server :: Blockchain for BlockchainService { # [allow (unused_variables)] async fn get_best_block_hash (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: BlockHashResult > , tonic :: Status > { unimplemented ! () ; } # [allow (unused_variables)] async fn get_block (& self , request : tonic :: Request < super :: types :: BlockInput >) -> Result < tonic :: Response < super :: types :: BlockResult > , tonic :: Status > { unimplemented ! () ; } } \ No newline at end of file diff --git a/src/rust/ain-grpc/src/gen/types.rs b/src/rust/ain-grpc/src/gen/types.rs index b5aefd45ec..bd8227bae5 100644 --- a/src/rust/ain-grpc/src/gen/types.rs +++ b/src/rust/ain-grpc/src/gen/types.rs @@ -1,1167 +1 @@ -fn ignore_integer( - i: &T, -) -> bool { - T::from(-1).unwrap() == *i -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message)] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct Transaction { - #[doc = " Transaction hash"] - #[prost(string, tag = "1")] - pub hash: ::prost::alloc::string::String, - #[doc = " Raw transaction data"] - #[prost(message, optional, tag = "2")] - pub raw: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct RawTransaction { - #[doc = " Whether specified block is in the active chain or not (only present with explicit \"blockhash\" argument)"] - #[prost(bool, tag = "1")] - pub in_active_chain: bool, - #[doc = " The serialized, hex-encoded data for 'txid'"] - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hex: ::prost::alloc::string::String, - #[doc = " The transaction id (same as provided)"] - #[prost(string, tag = "3")] - #[serde(skip_serializing_if = "String::is_empty")] - pub txid: ::prost::alloc::string::String, - #[doc = " The transaction hash (differs from txid for witness transactions)"] - #[prost(string, tag = "4")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash: ::prost::alloc::string::String, - #[doc = " The serialized transaction size"] - #[prost(uint32, tag = "5")] - pub size: u32, - #[doc = " The virtual transaction size (differs from size for witness transactions)"] - #[prost(uint32, tag = "6")] - pub vsize: u32, - #[doc = " The transaction's weight (between vsize*4-3 and vsize*4)"] - #[prost(uint32, tag = "7")] - pub weight: u32, - #[doc = " The transaction version"] - #[prost(uint32, tag = "8")] - pub version: u32, - #[doc = " The lock time"] - #[prost(uint64, tag = "9")] - pub locktime: u64, - #[doc = " List of inputs"] - #[prost(message, repeated, tag = "10")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub vin: ::prost::alloc::vec::Vec, - #[doc = " List of outputs"] - #[prost(message, repeated, tag = "11")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub vout: ::prost::alloc::vec::Vec, - #[doc = " The block hash"] - #[prost(string, tag = "12")] - #[serde(skip_serializing_if = "String::is_empty")] - pub blockhash: ::prost::alloc::string::String, - #[doc = " The confirmations"] - #[prost(string, tag = "13")] - #[serde(skip_serializing_if = "String::is_empty")] - pub confirmations: ::prost::alloc::string::String, - #[doc = " The block time in seconds since UNIX epoch"] - #[prost(uint64, tag = "14")] - pub blocktime: u64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct Vin { - #[doc = " The transaction id"] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub txid: ::prost::alloc::string::String, - #[doc = " The output index"] - #[prost(uint32, tag = "2")] - pub vout: u32, - #[doc = " The script signature"] - #[prost(message, optional, tag = "3")] - pub script_sig: ::core::option::Option, - #[doc = " The script sequence number"] - #[prost(uint64, tag = "4")] - pub sequence: u64, - #[doc = " Hex-encoded witness data"] - #[prost(string, repeated, tag = "5")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub txinwitness: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[doc = " DeFiChain fields"] - #[prost(string, tag = "51")] - #[serde(skip_serializing_if = "String::is_empty")] - pub coinbase: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct ScriptSig { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - #[serde(rename = "asm")] - pub field_asm: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hex: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct Vout { - #[prost(double, tag = "1")] - pub value: f64, - #[prost(uint64, tag = "2")] - pub n: u64, - #[prost(message, optional, tag = "3")] - pub script_pub_key: ::core::option::Option, - #[prost(uint64, tag = "4")] - pub token_id: u64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct PubKey { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - #[serde(rename = "asm")] - pub field_asm: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hex: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - #[serde(skip_serializing_if = "String::is_empty")] - #[serde(rename = "type")] - pub field_type: ::prost::alloc::string::String, - #[prost(int32, tag = "4")] - #[serde(skip_serializing_if = "ignore_integer")] - pub req_sigs: i32, - #[prost(string, repeated, tag = "5")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct Block { - #[doc = " Block hash (same as input, if any)"] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash: ::prost::alloc::string::String, - #[doc = " The number of confirmations, or -1 if the block is not on the main chain"] - #[prost(int64, tag = "2")] - pub confirmations: i64, - #[doc = " Block size"] - #[prost(uint64, tag = "3")] - pub size: u64, - #[doc = " Block size without witness data"] - #[prost(uint64, tag = "4")] - pub strippedsize: u64, - #[doc = " The block weight as defined in BIP 141"] - #[prost(uint64, tag = "5")] - pub weight: u64, - #[doc = " The block height or index"] - #[prost(uint64, tag = "6")] - pub height: u64, - #[doc = " The block version"] - #[prost(uint64, tag = "7")] - pub version: u64, - #[doc = " The block version in hex"] - #[prost(string, tag = "8")] - #[serde(skip_serializing_if = "String::is_empty")] - pub version_hex: ::prost::alloc::string::String, - #[doc = " The merkle root"] - #[prost(string, tag = "9")] - #[serde(skip_serializing_if = "String::is_empty")] - pub merkleroot: ::prost::alloc::string::String, - #[doc = " List of transaction IDs"] - #[prost(message, repeated, tag = "10")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub tx: ::prost::alloc::vec::Vec, - #[doc = " The block time in seconds since UNIX epoch"] - #[prost(uint64, tag = "11")] - pub time: u64, - #[doc = " The median block time in seconds since UNIX epoch"] - #[prost(uint64, tag = "12")] - pub mediantime: u64, - #[doc = " The nonce used to generate the block (property exists only when PoW is used)"] - #[prost(uint64, tag = "13")] - pub nonce: u64, - #[doc = " The bits which represent the target difficulty"] - #[prost(string, tag = "14")] - #[serde(skip_serializing_if = "String::is_empty")] - pub bits: ::prost::alloc::string::String, - #[doc = " The difficulty of the block"] - #[prost(double, tag = "15")] - pub difficulty: f64, - #[doc = " Expected number of hashes required to produce the chain up to this block (in hex)"] - #[prost(string, tag = "16")] - #[serde(skip_serializing_if = "String::is_empty")] - pub chainwork: ::prost::alloc::string::String, - #[doc = " Number of transactions in the block"] - #[prost(uint32, tag = "17")] - pub n_tx: u32, - #[doc = " The hash of the previous block"] - #[prost(string, tag = "18")] - #[serde(skip_serializing_if = "String::is_empty")] - #[serde(rename = "previousblockhash")] - pub previous_block_hash: ::prost::alloc::string::String, - #[doc = " The hash of the next block"] - #[prost(string, tag = "19")] - #[serde(skip_serializing_if = "String::is_empty")] - #[serde(rename = "nextblockhash")] - pub next_block_hash: ::prost::alloc::string::String, - #[doc = " DeFiChain fields"] - #[prost(string, tag = "101")] - #[serde(skip_serializing_if = "String::is_empty")] - pub masternode: ::prost::alloc::string::String, - #[prost(string, tag = "102")] - #[serde(skip_serializing_if = "String::is_empty")] - pub minter: ::prost::alloc::string::String, - #[prost(uint64, tag = "103")] - pub minted_blocks: u64, - #[prost(string, tag = "104")] - #[serde(skip_serializing_if = "String::is_empty")] - pub stake_modifier: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "105")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub nonutxo: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Serialize, Deserialize)] -#[serde(rename_all = "PascalCase")] -pub struct NonUtxo { - #[prost(double, tag = "1")] - pub anchor_reward: f64, - #[prost(double, tag = "2")] - pub burnt: f64, - #[prost(double, tag = "3")] - pub incentive_funding: f64, - #[prost(double, tag = "4")] - pub loan: f64, - #[prost(double, tag = "5")] - pub options: f64, - #[prost(double, tag = "6")] - pub unknown: f64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct BlockInput { - #[doc = " Block hash"] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub blockhash: ::prost::alloc::string::String, - #[doc = " 0 for hex-encoded data, 1 for a json object, and 2 for json object with transaction data [default: 1]"] - #[prost(uint32, tag = "2")] - pub verbosity: u32, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message)] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct BlockResult { - #[doc = " Hex-encoded data for block hash (for verbosity 0)"] - #[prost(string, tag = "1")] - pub hash: ::prost::alloc::string::String, - #[doc = " Block data (for verbosity 1 and 2)"] - #[prost(message, optional, tag = "2")] - pub block: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct BlockHashResult { - #[doc = " Hex-encoded data for block hash"] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthAccountsResult { - #[doc = " Accounts"] - #[prost(string, repeated, tag = "1")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub accounts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthTransactionInfo { - #[doc = " The address from which the transaction is sent"] - #[prost(string, optional, tag = "1")] - pub from: ::core::option::Option<::prost::alloc::string::String>, - #[doc = " The address to which the transaction is addressed"] - #[prost(string, optional, tag = "2")] - pub to: ::core::option::Option<::prost::alloc::string::String>, - #[doc = " The integer of gas provided for the transaction execution"] - #[prost(uint64, optional, tag = "3")] - pub gas: ::core::option::Option, - #[doc = " The integer of gas price used for each paid gas encoded as hexadecimal"] - #[prost(uint64, optional, tag = "4")] - pub price: ::core::option::Option, - #[doc = " The integer of value sent with this transaction encoded as hexadecimal"] - #[prost(uint64, optional, tag = "5")] - pub value: ::core::option::Option, - #[doc = " The hash of the method signature and encoded parameters."] - #[prost(string, optional, tag = "6")] - pub data: ::core::option::Option<::prost::alloc::string::String>, - #[doc = " The integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce."] - #[prost(uint64, optional, tag = "7")] - pub nonce: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthChainIdResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub id: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthBlockInfo { - #[doc = " The block number. null when its pending block."] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, - #[doc = " Hash of the block. null when its pending block."] - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash: ::prost::alloc::string::String, - #[doc = " Hash of the parent block."] - #[prost(string, tag = "3")] - #[serde(skip_serializing_if = "String::is_empty")] - pub parent_hash: ::prost::alloc::string::String, - #[doc = " Hash of the generated proof-of-work. null when its pending block."] - #[prost(string, tag = "4")] - #[serde(skip_serializing_if = "String::is_empty")] - pub nonce: ::prost::alloc::string::String, - #[doc = " SHA3 of the uncles data in the block."] - #[prost(string, tag = "5")] - #[serde(skip_serializing_if = "String::is_empty")] - pub sha3_uncles: ::prost::alloc::string::String, - #[doc = " The bloom filter for the logs of the block. null when its pending block."] - #[prost(string, tag = "6")] - #[serde(skip_serializing_if = "String::is_empty")] - pub logs_bloom: ::prost::alloc::string::String, - #[doc = " The root of the transaction trie of the block."] - #[prost(string, tag = "7")] - #[serde(skip_serializing_if = "String::is_empty")] - pub transactions_root: ::prost::alloc::string::String, - #[doc = " The root of the final state trie of the block."] - #[prost(string, tag = "8")] - #[serde(skip_serializing_if = "String::is_empty")] - pub state_root: ::prost::alloc::string::String, - #[doc = " The root of the receipts trie of the block."] - #[prost(string, tag = "9")] - #[serde(skip_serializing_if = "String::is_empty")] - pub receipt_root: ::prost::alloc::string::String, - #[doc = " The address of the beneficiary to whom the mining rewards were given."] - #[prost(string, tag = "10")] - #[serde(skip_serializing_if = "String::is_empty")] - pub miner: ::prost::alloc::string::String, - #[doc = " Integer of the difficulty for this block."] - #[prost(string, tag = "11")] - #[serde(skip_serializing_if = "String::is_empty")] - pub difficulty: ::prost::alloc::string::String, - #[doc = " Integer of the total difficulty of the chain until this block."] - #[prost(string, tag = "12")] - #[serde(skip_serializing_if = "String::is_empty")] - pub total_difficulty: ::prost::alloc::string::String, - #[doc = " The \"extra data\" field of this block."] - #[prost(string, tag = "13")] - #[serde(skip_serializing_if = "String::is_empty")] - pub extra_data: ::prost::alloc::string::String, - #[doc = " Integer the size of this block in bytes."] - #[prost(string, tag = "14")] - #[serde(skip_serializing_if = "String::is_empty")] - pub size: ::prost::alloc::string::String, - #[doc = " The maximum gas allowed in this block."] - #[prost(string, tag = "15")] - #[serde(skip_serializing_if = "String::is_empty")] - pub gas_limit: ::prost::alloc::string::String, - #[doc = " The total used gas by all transactions in this block."] - #[prost(string, tag = "16")] - #[serde(skip_serializing_if = "String::is_empty")] - pub gas_used: ::prost::alloc::string::String, - #[doc = " The unix timestamp for when the block was collated."] - #[prost(string, tag = "17")] - #[serde(skip_serializing_if = "String::is_empty")] - pub timestamps: ::prost::alloc::string::String, - #[doc = " Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter."] - #[prost(string, repeated, tag = "18")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub transactions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[doc = " Array of uncle hashes."] - #[prost(string, repeated, tag = "19")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub uncles: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthTransactionReceipt { - #[doc = " Hash of the transaction."] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub transaction_hash: ::prost::alloc::string::String, - #[doc = " Integer of the transactions index position in the block."] - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub transaction_index: ::prost::alloc::string::String, - #[doc = " Hash of the block where this transaction was in."] - #[prost(string, tag = "3")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_hash: ::prost::alloc::string::String, - #[doc = " Block number where this transaction was in."] - #[prost(string, tag = "4")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, - #[doc = " Address of the sender."] - #[prost(string, tag = "5")] - #[serde(skip_serializing_if = "String::is_empty")] - pub from: ::prost::alloc::string::String, - #[doc = " Address of the receiver. null when its a contract creation transaction."] - #[prost(string, tag = "6")] - #[serde(skip_serializing_if = "String::is_empty")] - pub to: ::prost::alloc::string::String, - #[doc = " The total amount of gas used when this transaction was executed in the block."] - #[prost(string, tag = "7")] - #[serde(skip_serializing_if = "String::is_empty")] - pub cumulative_gas_used: ::prost::alloc::string::String, - #[doc = " The sum of the base fee and tip paid per unit of gas."] - #[prost(string, tag = "8")] - #[serde(skip_serializing_if = "String::is_empty")] - pub effective_gas_price: ::prost::alloc::string::String, - #[doc = " The amount of gas used by this specific transaction alone."] - #[prost(string, tag = "9")] - #[serde(skip_serializing_if = "String::is_empty")] - pub gas_used: ::prost::alloc::string::String, - #[doc = " The contract address created, if the transaction was a contract creation, otherwise null."] - #[prost(string, tag = "10")] - #[serde(skip_serializing_if = "String::is_empty")] - pub contract_address: ::prost::alloc::string::String, - #[doc = " Array of log objects, which this transaction generated."] - #[prost(string, repeated, tag = "11")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub logs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[doc = " Bloom filter for light clients to quickly retrieve related logs."] - #[prost(string, tag = "12")] - #[serde(skip_serializing_if = "String::is_empty")] - pub logs_bloom: ::prost::alloc::string::String, - #[doc = " Integer of the transaction type, 0x00 for legacy transactions, 0x01 for access list types, 0x02 for dynamic fees. It also returns either :"] - #[prost(string, tag = "13")] - #[serde(skip_serializing_if = "String::is_empty")] - #[serde(rename = "type")] - pub field_type: ::prost::alloc::string::String, - #[doc = " 32 bytes of post-transaction stateroot (pre Byzantium)"] - #[prost(string, optional, tag = "14")] - pub root: ::core::option::Option<::prost::alloc::string::String>, - #[doc = " Either 1 (success) or 0 (failure)"] - #[prost(string, optional, tag = "15")] - pub status: ::core::option::Option<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthCallInput { - #[doc = " Transaction info"] - #[prost(message, optional, tag = "1")] - pub transaction_info: ::core::option::Option, - #[doc = " Block number in hexadecimal format or the string latest, earliest, pending, safe or finalized"] - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthCallResult { - #[doc = " The return value of the executed contract method"] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub data: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSignInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub message: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSignResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub signature: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBalanceInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBalanceResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub balance: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSendTransactionInput { - #[prost(message, optional, tag = "1")] - pub transaction_info: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSendTransactionResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthCoinBaseResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub address: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthMiningResult { - #[prost(bool, tag = "1")] - pub is_mining: bool, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthHashRateResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash_rate: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGasPriceResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub gas_price: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthBlockNumberResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionCountInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionCountResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub number_transaction: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBlockTransactionCountByHashInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_hash: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBlockTransactionCountByHashResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub number_transaction: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBlockTransactionCountByNumberInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBlockTransactionCountByNumberResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub number_transaction: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetUncleCountByBlockHashInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_hash: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetUncleCountByBlockHashResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub number_uncles: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetUncleCountByBlockNumberInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetUncleCountByBlockNumberResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub number_uncles: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetCodeInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetCodeResult { - #[doc = " The code from the given address."] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub code: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSignTransactionInput { - #[prost(message, optional, tag = "1")] - pub transaction_info: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSignTransactionResult { - #[doc = " The signed transaction object."] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub transaction: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSendRawTransactionInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub transaction: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSendRawTransactionResult { - #[doc = " The transaction hash, or the zero hash if the transaction is not yet available."] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthEstimateGasInput { - #[doc = " Transaction info"] - #[prost(message, optional, tag = "1")] - pub transaction_info: ::core::option::Option, - #[doc = " Block number in hexadecimal format or the string latest, earliest, pending, safe or finalized"] - #[prost(string, optional, tag = "2")] - pub block_number: ::core::option::Option<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthEstimateGasResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub gas_used: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBlockByHashInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash: ::prost::alloc::string::String, - #[prost(bool, tag = "2")] - pub full_transaction: bool, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBlockByHashResult { - #[prost(message, optional, tag = "1")] - pub block_info: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBlockByNumberInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub number: ::prost::alloc::string::String, - #[prost(bool, tag = "2")] - pub full_transaction: bool, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetBlockByNumberResult { - #[prost(message, optional, tag = "1")] - pub block_info: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionByHashInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionByHashResult { - #[prost(message, optional, tag = "1")] - pub transaction: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionByBlockHashAndIndexInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_hash: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub index: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionByBlockHashAndIndexResult { - #[prost(message, optional, tag = "1")] - pub transaction: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionByBlockNumberAndIndexInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub index: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionByBlockNumberAndIndexResult { - #[prost(message, optional, tag = "1")] - pub transaction: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetUncleByBlockHashAndIndexInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_hash: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub index: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetUncleByBlockHashAndIndexResult { - #[prost(message, optional, tag = "1")] - pub block_info: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetUncleByBlockNumberAndIndexInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub index: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetUncleByBlockNumberAndIndexResult { - #[prost(message, optional, tag = "1")] - pub block_info: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetCompilersResult { - #[prost(string, repeated, tag = "1")] - #[serde(skip_serializing_if = "Vec::is_empty")] - pub compilers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthCompileSolidityInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub code: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthCompileSolidityResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub compiled_code: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthCompileLllInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub code: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthCompileLllResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub compiled_code: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthCompileSerpentInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub code: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthCompileSerpentResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub compiled_code: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthProtocolVersionResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub protocol_version: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct Web3Sha3Input { - #[doc = " The data to convert into a SHA3 hash"] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub data: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct Web3Sha3Result { - #[doc = " The SHA3 result of the given string."] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub data: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct NetPeerCountResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub number_peer: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct NetVersionResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub network_version: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct Web3ClientVersionResult { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub client_version: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetWorkResult { - #[doc = " Current block header pow-hash"] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub currentblock: ::prost::alloc::string::String, - #[doc = " The seed hash used for the DAG."] - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub seed_hash: ::prost::alloc::string::String, - #[doc = " The boundary condition (\"target\"), 2^256 / difficulty."] - #[prost(string, tag = "3")] - #[serde(skip_serializing_if = "String::is_empty")] - pub target: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSubmitWorkInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub nounce: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub pow_hash: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - #[serde(skip_serializing_if = "String::is_empty")] - pub mix_digest: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSubmitWorkResult { - #[prost(bool, tag = "1")] - pub is_valid: bool, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSubmitHashrateInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub hash_rate: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub id: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSubmitHashrateResult { - #[prost(bool, tag = "1")] - pub is_valid: bool, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetStorageAtInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub position: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - #[serde(skip_serializing_if = "String::is_empty")] - pub block_number: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetStorageAtResult { - #[doc = " The value at this storage position."] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub value: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionReceiptInput { - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub transaction_hash: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthGetTransactionReceiptResult { - #[prost(message, optional, tag = "1")] - pub transaction_receipt: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSyncingInfo { - #[doc = " The block at which the import started (will only be reset, after the sync reached his head)"] - #[prost(string, tag = "1")] - #[serde(skip_serializing_if = "String::is_empty")] - pub starting_block: ::prost::alloc::string::String, - #[doc = " The current block, same as eth_blockNumber"] - #[prost(string, tag = "2")] - #[serde(skip_serializing_if = "String::is_empty")] - pub current_block: ::prost::alloc::string::String, - #[doc = " The estimated highest block"] - #[prost(string, tag = "3")] - #[serde(skip_serializing_if = "String::is_empty")] - pub highest_block: ::prost::alloc::string::String, -} -#[doc = " TODO make it oneof"] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, :: prost :: Message, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -#[allow(clippy::derive_partial_eq_without_eq)] -pub struct EthSyncingResult { - #[prost(bool, optional, tag = "1")] - pub status: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub sync_info: ::core::option::Option, -} +fn ignore_integer < T : num_traits :: PrimInt + num_traits :: Signed + num_traits :: NumCast > (i : & T) -> bool { T :: from (- 1) . unwrap () == * i } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Transaction { # [doc = " Transaction hash"] # [prost (string , tag = "1")] pub hash : :: prost :: alloc :: string :: String , # [doc = " Raw transaction data"] # [prost (message , optional , tag = "2")] pub raw : :: core :: option :: Option < RawTransaction > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct RawTransaction { # [doc = " Whether specified block is in the active chain or not (only present with explicit \"blockhash\" argument)"] # [prost (bool , tag = "1")] pub in_active_chain : bool , # [doc = " The serialized, hex-encoded data for 'txid'"] # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub hex : :: prost :: alloc :: string :: String , # [doc = " The transaction id (same as provided)"] # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub txid : :: prost :: alloc :: string :: String , # [doc = " The transaction hash (differs from txid for witness transactions)"] # [prost (string , tag = "4")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , # [doc = " The serialized transaction size"] # [prost (uint32 , tag = "5")] pub size : u32 , # [doc = " The virtual transaction size (differs from size for witness transactions)"] # [prost (uint32 , tag = "6")] pub vsize : u32 , # [doc = " The transaction's weight (between vsize*4-3 and vsize*4)"] # [prost (uint32 , tag = "7")] pub weight : u32 , # [doc = " The transaction version"] # [prost (uint32 , tag = "8")] pub version : u32 , # [doc = " The lock time"] # [prost (uint64 , tag = "9")] pub locktime : u64 , # [doc = " List of inputs"] # [prost (message , repeated , tag = "10")] # [serde (skip_serializing_if = "Vec::is_empty")] pub vin : :: prost :: alloc :: vec :: Vec < Vin > , # [doc = " List of outputs"] # [prost (message , repeated , tag = "11")] # [serde (skip_serializing_if = "Vec::is_empty")] pub vout : :: prost :: alloc :: vec :: Vec < Vout > , # [doc = " The block hash"] # [prost (string , tag = "12")] # [serde (skip_serializing_if = "String::is_empty")] pub blockhash : :: prost :: alloc :: string :: String , # [doc = " The confirmations"] # [prost (string , tag = "13")] # [serde (skip_serializing_if = "String::is_empty")] pub confirmations : :: prost :: alloc :: string :: String , # [doc = " The block time in seconds since UNIX epoch"] # [prost (uint64 , tag = "14")] pub blocktime : u64 , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Vin { # [doc = " The transaction id"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub txid : :: prost :: alloc :: string :: String , # [doc = " The output index"] # [prost (uint32 , tag = "2")] pub vout : u32 , # [doc = " The script signature"] # [prost (message , optional , tag = "3")] pub script_sig : :: core :: option :: Option < ScriptSig > , # [doc = " The script sequence number"] # [prost (uint64 , tag = "4")] pub sequence : u64 , # [doc = " Hex-encoded witness data"] # [prost (string , repeated , tag = "5")] # [serde (skip_serializing_if = "Vec::is_empty")] pub txinwitness : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , # [doc = " DeFiChain fields"] # [prost (string , tag = "51")] # [serde (skip_serializing_if = "String::is_empty")] pub coinbase : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct ScriptSig { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] # [serde (rename = "asm")] pub field_asm : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub hex : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Vout { # [prost (double , tag = "1")] pub value : f64 , # [prost (uint64 , tag = "2")] pub n : u64 , # [prost (message , optional , tag = "3")] pub script_pub_key : :: core :: option :: Option < PubKey > , # [prost (uint64 , tag = "4")] pub token_id : u64 , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct PubKey { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] # [serde (rename = "asm")] pub field_asm : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub hex : :: prost :: alloc :: string :: String , # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] # [serde (rename = "type")] pub field_type : :: prost :: alloc :: string :: String , # [prost (int32 , tag = "4")] # [serde (skip_serializing_if = "ignore_integer")] pub req_sigs : i32 , # [prost (string , repeated , tag = "5")] # [serde (skip_serializing_if = "Vec::is_empty")] pub addresses : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Block { # [doc = " Block hash (same as input, if any)"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , # [doc = " The number of confirmations, or -1 if the block is not on the main chain"] # [prost (int64 , tag = "2")] pub confirmations : i64 , # [doc = " Block size"] # [prost (uint64 , tag = "3")] pub size : u64 , # [doc = " Block size without witness data"] # [prost (uint64 , tag = "4")] pub strippedsize : u64 , # [doc = " The block weight as defined in BIP 141"] # [prost (uint64 , tag = "5")] pub weight : u64 , # [doc = " The block height or index"] # [prost (uint64 , tag = "6")] pub height : u64 , # [doc = " The block version"] # [prost (uint64 , tag = "7")] pub version : u64 , # [doc = " The block version in hex"] # [prost (string , tag = "8")] # [serde (skip_serializing_if = "String::is_empty")] pub version_hex : :: prost :: alloc :: string :: String , # [doc = " The merkle root"] # [prost (string , tag = "9")] # [serde (skip_serializing_if = "String::is_empty")] pub merkleroot : :: prost :: alloc :: string :: String , # [doc = " List of transaction IDs"] # [prost (message , repeated , tag = "10")] # [serde (skip_serializing_if = "Vec::is_empty")] pub tx : :: prost :: alloc :: vec :: Vec < Transaction > , # [doc = " The block time in seconds since UNIX epoch"] # [prost (uint64 , tag = "11")] pub time : u64 , # [doc = " The median block time in seconds since UNIX epoch"] # [prost (uint64 , tag = "12")] pub mediantime : u64 , # [doc = " The nonce used to generate the block (property exists only when PoW is used)"] # [prost (uint64 , tag = "13")] pub nonce : u64 , # [doc = " The bits which represent the target difficulty"] # [prost (string , tag = "14")] # [serde (skip_serializing_if = "String::is_empty")] pub bits : :: prost :: alloc :: string :: String , # [doc = " The difficulty of the block"] # [prost (double , tag = "15")] pub difficulty : f64 , # [doc = " Expected number of hashes required to produce the chain up to this block (in hex)"] # [prost (string , tag = "16")] # [serde (skip_serializing_if = "String::is_empty")] pub chainwork : :: prost :: alloc :: string :: String , # [doc = " Number of transactions in the block"] # [prost (uint32 , tag = "17")] pub n_tx : u32 , # [doc = " The hash of the previous block"] # [prost (string , tag = "18")] # [serde (skip_serializing_if = "String::is_empty")] # [serde (rename = "previousblockhash")] pub previous_block_hash : :: prost :: alloc :: string :: String , # [doc = " The hash of the next block"] # [prost (string , tag = "19")] # [serde (skip_serializing_if = "String::is_empty")] # [serde (rename = "nextblockhash")] pub next_block_hash : :: prost :: alloc :: string :: String , # [doc = " DeFiChain fields"] # [prost (string , tag = "101")] # [serde (skip_serializing_if = "String::is_empty")] pub masternode : :: prost :: alloc :: string :: String , # [prost (string , tag = "102")] # [serde (skip_serializing_if = "String::is_empty")] pub minter : :: prost :: alloc :: string :: String , # [prost (uint64 , tag = "103")] pub minted_blocks : u64 , # [prost (string , tag = "104")] # [serde (skip_serializing_if = "String::is_empty")] pub stake_modifier : :: prost :: alloc :: string :: String , # [prost (message , repeated , tag = "105")] # [serde (skip_serializing_if = "Vec::is_empty")] pub nonutxo : :: prost :: alloc :: vec :: Vec < NonUtxo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "PascalCase")] pub struct NonUtxo { # [prost (double , tag = "1")] pub anchor_reward : f64 , # [prost (double , tag = "2")] pub burnt : f64 , # [prost (double , tag = "3")] pub incentive_funding : f64 , # [prost (double , tag = "4")] pub loan : f64 , # [prost (double , tag = "5")] pub options : f64 , # [prost (double , tag = "6")] pub unknown : f64 , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct BlockInput { # [doc = " Block hash"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub blockhash : :: prost :: alloc :: string :: String , # [doc = " 0 for hex-encoded data, 1 for a json object, and 2 for json object with transaction data [default: 1]"] # [prost (uint32 , tag = "2")] pub verbosity : u32 , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct BlockResult { # [doc = " Hex-encoded data for block hash (for verbosity 0)"] # [prost (string , tag = "1")] pub hash : :: prost :: alloc :: string :: String , # [doc = " Block data (for verbosity 1 and 2)"] # [prost (message , optional , tag = "2")] pub block : :: core :: option :: Option < Block > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct BlockHashResult { # [doc = " Hex-encoded data for block hash"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthAccountsResult { # [doc = " Accounts"] # [prost (string , repeated , tag = "1")] # [serde (skip_serializing_if = "Vec::is_empty")] pub accounts : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthTransactionInfo { # [doc = " The address from which the transaction is sent"] # [prost (string , optional , tag = "1")] pub from : :: core :: option :: Option < :: prost :: alloc :: string :: String > , # [doc = " The address to which the transaction is addressed"] # [prost (string , optional , tag = "2")] pub to : :: core :: option :: Option < :: prost :: alloc :: string :: String > , # [doc = " The integer of gas provided for the transaction execution"] # [prost (uint64 , optional , tag = "3")] pub gas : :: core :: option :: Option < u64 > , # [doc = " The integer of gas price used for each paid gas encoded as hexadecimal"] # [prost (uint64 , optional , tag = "4")] pub price : :: core :: option :: Option < u64 > , # [doc = " The integer of value sent with this transaction encoded as hexadecimal"] # [prost (uint64 , optional , tag = "5")] pub value : :: core :: option :: Option < u64 > , # [doc = " The hash of the method signature and encoded parameters."] # [prost (string , optional , tag = "6")] pub data : :: core :: option :: Option < :: prost :: alloc :: string :: String > , # [doc = " The integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce."] # [prost (uint64 , optional , tag = "7")] pub nonce : :: core :: option :: Option < u64 > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthChainIdResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub id : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthBlockInfo { # [doc = " The block number. null when its pending block."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , # [doc = " Hash of the block. null when its pending block."] # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , # [doc = " Hash of the parent block."] # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub parent_hash : :: prost :: alloc :: string :: String , # [doc = " Hash of the generated proof-of-work. null when its pending block."] # [prost (string , tag = "4")] # [serde (skip_serializing_if = "String::is_empty")] pub nonce : :: prost :: alloc :: string :: String , # [doc = " SHA3 of the uncles data in the block."] # [prost (string , tag = "5")] # [serde (skip_serializing_if = "String::is_empty")] pub sha3_uncles : :: prost :: alloc :: string :: String , # [doc = " The bloom filter for the logs of the block. null when its pending block."] # [prost (string , tag = "6")] # [serde (skip_serializing_if = "String::is_empty")] pub logs_bloom : :: prost :: alloc :: string :: String , # [doc = " The root of the transaction trie of the block."] # [prost (string , tag = "7")] # [serde (skip_serializing_if = "String::is_empty")] pub transactions_root : :: prost :: alloc :: string :: String , # [doc = " The root of the final state trie of the block."] # [prost (string , tag = "8")] # [serde (skip_serializing_if = "String::is_empty")] pub state_root : :: prost :: alloc :: string :: String , # [doc = " The root of the receipts trie of the block."] # [prost (string , tag = "9")] # [serde (skip_serializing_if = "String::is_empty")] pub receipt_root : :: prost :: alloc :: string :: String , # [doc = " The address of the beneficiary to whom the mining rewards were given."] # [prost (string , tag = "10")] # [serde (skip_serializing_if = "String::is_empty")] pub miner : :: prost :: alloc :: string :: String , # [doc = " Integer of the difficulty for this block."] # [prost (string , tag = "11")] # [serde (skip_serializing_if = "String::is_empty")] pub difficulty : :: prost :: alloc :: string :: String , # [doc = " Integer of the total difficulty of the chain until this block."] # [prost (string , tag = "12")] # [serde (skip_serializing_if = "String::is_empty")] pub total_difficulty : :: prost :: alloc :: string :: String , # [doc = " The \"extra data\" field of this block."] # [prost (string , tag = "13")] # [serde (skip_serializing_if = "String::is_empty")] pub extra_data : :: prost :: alloc :: string :: String , # [doc = " Integer the size of this block in bytes."] # [prost (string , tag = "14")] # [serde (skip_serializing_if = "String::is_empty")] pub size : :: prost :: alloc :: string :: String , # [doc = " The maximum gas allowed in this block."] # [prost (string , tag = "15")] # [serde (skip_serializing_if = "String::is_empty")] pub gas_limit : :: prost :: alloc :: string :: String , # [doc = " The total used gas by all transactions in this block."] # [prost (string , tag = "16")] # [serde (skip_serializing_if = "String::is_empty")] pub gas_used : :: prost :: alloc :: string :: String , # [doc = " The unix timestamp for when the block was collated."] # [prost (string , tag = "17")] # [serde (skip_serializing_if = "String::is_empty")] pub timestamps : :: prost :: alloc :: string :: String , # [doc = " Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter."] # [prost (string , repeated , tag = "18")] # [serde (skip_serializing_if = "Vec::is_empty")] pub transactions : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , # [doc = " Array of uncle hashes."] # [prost (string , repeated , tag = "19")] # [serde (skip_serializing_if = "Vec::is_empty")] pub uncles : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthTransactionReceipt { # [doc = " Hash of the transaction."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub transaction_hash : :: prost :: alloc :: string :: String , # [doc = " Integer of the transactions index position in the block."] # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub transaction_index : :: prost :: alloc :: string :: String , # [doc = " Hash of the block where this transaction was in."] # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub block_hash : :: prost :: alloc :: string :: String , # [doc = " Block number where this transaction was in."] # [prost (string , tag = "4")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , # [doc = " Address of the sender."] # [prost (string , tag = "5")] # [serde (skip_serializing_if = "String::is_empty")] pub from : :: prost :: alloc :: string :: String , # [doc = " Address of the receiver. null when its a contract creation transaction."] # [prost (string , tag = "6")] # [serde (skip_serializing_if = "String::is_empty")] pub to : :: prost :: alloc :: string :: String , # [doc = " The total amount of gas used when this transaction was executed in the block."] # [prost (string , tag = "7")] # [serde (skip_serializing_if = "String::is_empty")] pub cumulative_gas_used : :: prost :: alloc :: string :: String , # [doc = " The sum of the base fee and tip paid per unit of gas."] # [prost (string , tag = "8")] # [serde (skip_serializing_if = "String::is_empty")] pub effective_gas_price : :: prost :: alloc :: string :: String , # [doc = " The amount of gas used by this specific transaction alone."] # [prost (string , tag = "9")] # [serde (skip_serializing_if = "String::is_empty")] pub gas_used : :: prost :: alloc :: string :: String , # [doc = " The contract address created, if the transaction was a contract creation, otherwise null."] # [prost (string , tag = "10")] # [serde (skip_serializing_if = "String::is_empty")] pub contract_address : :: prost :: alloc :: string :: String , # [doc = " Array of log objects, which this transaction generated."] # [prost (string , repeated , tag = "11")] # [serde (skip_serializing_if = "Vec::is_empty")] pub logs : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , # [doc = " Bloom filter for light clients to quickly retrieve related logs."] # [prost (string , tag = "12")] # [serde (skip_serializing_if = "String::is_empty")] pub logs_bloom : :: prost :: alloc :: string :: String , # [doc = " Integer of the transaction type, 0x00 for legacy transactions, 0x01 for access list types, 0x02 for dynamic fees. It also returns either :"] # [prost (string , tag = "13")] # [serde (skip_serializing_if = "String::is_empty")] # [serde (rename = "type")] pub field_type : :: prost :: alloc :: string :: String , # [doc = " 32 bytes of post-transaction stateroot (pre Byzantium)"] # [prost (string , optional , tag = "14")] pub root : :: core :: option :: Option < :: prost :: alloc :: string :: String > , # [doc = " Either 1 (success) or 0 (failure)"] # [prost (string , optional , tag = "15")] pub status : :: core :: option :: Option < :: prost :: alloc :: string :: String > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCallInput { # [doc = " Transaction info"] # [prost (message , optional , tag = "1")] pub transaction_info : :: core :: option :: Option < EthTransactionInfo > , # [doc = " Block number in hexadecimal format or the string latest, earliest, pending, safe or finalized"] # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCallResult { # [doc = " The return value of the executed contract method"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub data : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSignInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub address : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub message : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSignResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub signature : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBalanceInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub address : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBalanceResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub balance : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSendTransactionInput { # [prost (message , optional , tag = "1")] pub transaction_info : :: core :: option :: Option < EthTransactionInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSendTransactionResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCoinBaseResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub address : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthMiningResult { # [prost (bool , tag = "1")] pub is_mining : bool , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthHashRateResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash_rate : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGasPriceResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub gas_price : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthBlockNumberResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionCountInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub address : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionCountResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number_transaction : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockTransactionCountByHashInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockTransactionCountByHashResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number_transaction : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockTransactionCountByNumberInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockTransactionCountByNumberResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number_transaction : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleCountByBlockHashInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleCountByBlockHashResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number_uncles : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleCountByBlockNumberInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleCountByBlockNumberResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number_uncles : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetCodeInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub address : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetCodeResult { # [doc = " The code from the given address."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSignTransactionInput { # [prost (message , optional , tag = "1")] pub transaction_info : :: core :: option :: Option < EthTransactionInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSignTransactionResult { # [doc = " The signed transaction object."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub transaction : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSendRawTransactionInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub transaction : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSendRawTransactionResult { # [doc = " The transaction hash, or the zero hash if the transaction is not yet available."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthEstimateGasInput { # [doc = " Transaction info"] # [prost (message , optional , tag = "1")] pub transaction_info : :: core :: option :: Option < EthTransactionInfo > , # [doc = " Block number in hexadecimal format or the string latest, earliest, pending, safe or finalized"] # [prost (string , optional , tag = "2")] pub block_number : :: core :: option :: Option < :: prost :: alloc :: string :: String > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthEstimateGasResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub gas_used : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockByHashInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , # [prost (bool , tag = "2")] pub full_transaction : bool , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockByHashResult { # [prost (message , optional , tag = "1")] pub block_info : :: core :: option :: Option < EthBlockInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockByNumberInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number : :: prost :: alloc :: string :: String , # [prost (bool , tag = "2")] pub full_transaction : bool , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetBlockByNumberResult { # [prost (message , optional , tag = "1")] pub block_info : :: core :: option :: Option < EthBlockInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionByHashInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionByHashResult { # [prost (message , optional , tag = "1")] pub transaction : :: core :: option :: Option < EthTransactionInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionByBlockHashAndIndexInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_hash : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub index : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionByBlockHashAndIndexResult { # [prost (message , optional , tag = "1")] pub transaction : :: core :: option :: Option < EthTransactionInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionByBlockNumberAndIndexInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub index : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionByBlockNumberAndIndexResult { # [prost (message , optional , tag = "1")] pub transaction : :: core :: option :: Option < EthTransactionInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleByBlockHashAndIndexInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_hash : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub index : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleByBlockHashAndIndexResult { # [prost (message , optional , tag = "1")] pub block_info : :: core :: option :: Option < EthBlockInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleByBlockNumberAndIndexInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub index : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetUncleByBlockNumberAndIndexResult { # [prost (message , optional , tag = "1")] pub block_info : :: core :: option :: Option < EthBlockInfo > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetCompilersResult { # [prost (string , repeated , tag = "1")] # [serde (skip_serializing_if = "Vec::is_empty")] pub compilers : :: prost :: alloc :: vec :: Vec < :: prost :: alloc :: string :: String > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCompileSolidityInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCompileSolidityResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub compiled_code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCompileLllInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCompileLllResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub compiled_code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCompileSerpentInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthCompileSerpentResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub compiled_code : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthProtocolVersionResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub protocol_version : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Web3Sha3Input { # [doc = " The data to convert into a SHA3 hash"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub data : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Web3Sha3Result { # [doc = " The SHA3 result of the given string."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub data : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct NetPeerCountResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub number_peer : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct NetVersionResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub network_version : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct Web3ClientVersionResult { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub client_version : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetWorkResult { # [doc = " Current block header pow-hash"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub currentblock : :: prost :: alloc :: string :: String , # [doc = " The seed hash used for the DAG."] # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub seed_hash : :: prost :: alloc :: string :: String , # [doc = " The boundary condition (\"target\"), 2^256 / difficulty."] # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub target : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSubmitWorkInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub nounce : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub pow_hash : :: prost :: alloc :: string :: String , # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub mix_digest : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSubmitWorkResult { # [prost (bool , tag = "1")] pub is_valid : bool , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSubmitHashrateInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub hash_rate : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub id : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSubmitHashrateResult { # [prost (bool , tag = "1")] pub is_valid : bool , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetStorageAtInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub address : :: prost :: alloc :: string :: String , # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub position : :: prost :: alloc :: string :: String , # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub block_number : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetStorageAtResult { # [doc = " The value at this storage position."] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub value : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionReceiptInput { # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub transaction_hash : :: prost :: alloc :: string :: String , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthGetTransactionReceiptResult { # [prost (message , optional , tag = "1")] pub transaction_receipt : :: core :: option :: Option < EthTransactionReceipt > , } # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSyncingInfo { # [doc = " The block at which the import started (will only be reset, after the sync reached his head)"] # [prost (string , tag = "1")] # [serde (skip_serializing_if = "String::is_empty")] pub starting_block : :: prost :: alloc :: string :: String , # [doc = " The current block, same as eth_blockNumber"] # [prost (string , tag = "2")] # [serde (skip_serializing_if = "String::is_empty")] pub current_block : :: prost :: alloc :: string :: String , # [doc = " The estimated highest block"] # [prost (string , tag = "3")] # [serde (skip_serializing_if = "String::is_empty")] pub highest_block : :: prost :: alloc :: string :: String , } # [doc = " TODO make it oneof"] # [allow (clippy :: derive_partial_eq_without_eq)] # [derive (Clone , PartialEq , :: prost :: Message)] # [derive (Serialize , Deserialize)] # [serde (rename_all = "camelCase")] # [allow (clippy :: derive_partial_eq_without_eq)] pub struct EthSyncingResult { # [prost (bool , optional , tag = "1")] pub status : :: core :: option :: Option < bool > , # [prost (message , optional , tag = "2")] pub sync_info : :: core :: option :: Option < EthSyncingInfo > , } \ No newline at end of file diff --git a/src/rust/ain-grpc/src/rpc.rs b/src/rust/ain-grpc/src/rpc.rs index d63d5c9e69..aa8e7a9c77 100644 --- a/src/rust/ain-grpc/src/rpc.rs +++ b/src/rust/ain-grpc/src/rpc.rs @@ -141,7 +141,7 @@ impl EthServiceApi for EthService { } fn Eth_ChainId(_handler: Arc) -> Result { - let chain_id = ain_cpp_exports::get_chain_id().unwrap(); + let chain_id = ain_cpp_imports::get_chain_id().unwrap(); Ok(EthChainIdResult { id: format!("{:#x}", chain_id), @@ -149,7 +149,7 @@ impl EthServiceApi for EthService { } fn Net_Version(_handler: Arc) -> Result { - let chain_id = ain_cpp_exports::get_chain_id().unwrap(); + let chain_id = ain_cpp_imports::get_chain_id().unwrap(); Ok(EthChainIdResult { id: format!("{}", chain_id), @@ -207,7 +207,7 @@ impl EthServiceApi for EthService { } fn Eth_Mining(_handler: Arc) -> Result { - let mining = ain_cpp_exports::is_mining().unwrap(); + let mining = ain_cpp_imports::is_mining().unwrap(); Ok(EthMiningResult { is_mining: mining }) } diff --git a/src/rust/ain-rs-exports/build.rs b/src/rust/ain-rs-exports/build.rs index cd7f6c5548..75ab6dcd9b 100644 --- a/src/rust/ain-rs-exports/build.rs +++ b/src/rust/ain-rs-exports/build.rs @@ -35,18 +35,18 @@ fn main() { let tt: TokenStream = content.parse().unwrap(); let mut opt = cxx_gen::Opt::default(); opt.include.push(cxx_gen::Include { - path: "libain_evm.h".to_string(), + path: "libain_rs_exports.h".to_string(), kind: cxx_gen::IncludeKind::Bracketed, }); let codegen = cxx_gen::generate_header_and_cc(tt, &opt).unwrap(); let cpp_stuff = String::from_utf8(codegen.implementation).unwrap(); - File::create(target_dir.join("libain_evm.h")) + File::create(target_dir.join("libain_rs_exports.h")) .unwrap() .write_all(&codegen.header) .unwrap(); - File::create(target_dir.join("libain_evm.cpp")) + File::create(target_dir.join("libain_rs_exports.cpp")) .unwrap() .write_all(cpp_stuff.as_bytes()) .unwrap(); From 543b1d6ba4c5fc4ed60a7b793ed3ca729cac3f14 Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Thu, 13 Apr 2023 16:30:05 +0800 Subject: [PATCH 4/6] Resolve warnings, rename to cpp-exports --- src/Makefile.am | 6 +++--- src/defid.cpp | 2 +- src/init.cpp | 2 +- src/masternodes/mn_checks.cpp | 2 +- src/masternodes/rpc_evm.cpp | 2 +- src/miner.cpp | 2 +- src/rust/Makefile.am | 6 ++++-- src/rust/ain-grpc/src/gen/rpc.rs | 2 +- src/rust/ain-rs-exports/build.rs | 16 +++++++++------- src/test/transaction_tests.cpp | 2 +- src/validation.cpp | 2 +- 11 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index aaea5871cf..2f639234bd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -27,9 +27,9 @@ LIBDEFI_SPV_INCLUDES = \ -I$(srcdir)/spv/bcash LIBAIN_RS_INCLUDES = -I$(builddir)/rust/include -LIBAIN_RS_LIB = -L$(builddir)/rust/lib -lain_evm_ffi -LIBAIN_RS_SRC = $(builddir)/rust/src/libain_evm.cpp -LIBAIN_RS_H = libain_evm.h +LIBAIN_RS_LIB = -L$(builddir)/rust/lib -lain_rs_exports +LIBAIN_RS_SRC = $(builddir)/rust/src/ain_rs_exports.cpp +LIBAIN_RS_H = ain_rs_exports.h $(LIBAIN_RS_SRC): $(LIBAIN_RS_H): diff --git a/src/defid.cpp b/src/defid.cpp index 796d6f9f6d..3dbd10ab2b 100644 --- a/src/defid.cpp +++ b/src/defid.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include diff --git a/src/init.cpp b/src/init.cpp index 93723e9be8..4fb472d2d8 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/masternodes/mn_checks.cpp b/src/masternodes/mn_checks.cpp index 717dab652a..eb6aa5a01a 100644 --- a/src/masternodes/mn_checks.cpp +++ b/src/masternodes/mn_checks.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/masternodes/rpc_evm.cpp b/src/masternodes/rpc_evm.cpp index fed5bc3c22..d137be0796 100644 --- a/src/masternodes/rpc_evm.cpp +++ b/src/masternodes/rpc_evm.cpp @@ -1,6 +1,6 @@ #include -#include +#include #include UniValue evmtx(const JSONRPCRequest& request) { diff --git a/src/miner.cpp b/src/miner.cpp index ab7a85cc7f..e9914a606a 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/rust/Makefile.am b/src/rust/Makefile.am index 6178bfe461..26d1649dd2 100644 --- a/src/rust/Makefile.am +++ b/src/rust/Makefile.am @@ -6,6 +6,8 @@ RUST_TARGET ?= x86_64-unknown-linux-gnu .PHONY: all: build-evm-pkg build-grpc-pkg + +# TODO: assumes release builds atm .PHONY: build-evm-pkg: build-grpc-pkg @cd $(abs_srcdir) && \ @@ -13,8 +15,8 @@ build-evm-pkg: build-grpc-pkg --release $(if $(RUST_TARGET),--target $(RUST_TARGET),) --target-dir $(abs_builddir)/target && \ mkdir -p $(abs_builddir)/{include,lib,src} && \ cp $(abs_builddir)/target/$(RUST_TARGET)/release/libain_rs_exports.a $(abs_builddir)/lib/ && \ - cp $(abs_builddir)/libain_rs_exports.h $(abs_builddir)/include/ && \ - cp $(abs_builddir)/libain_rs_exports.cpp $(abs_builddir)/src/libain_evm.cpp + cp $(abs_builddir)/ain_rs_exports.h $(abs_builddir)/include/ && \ + cp $(abs_builddir)/ain_rs_exports.cpp $(abs_builddir)/src/ .PHONY: build-grpc-pkg: diff --git a/src/rust/ain-grpc/src/gen/rpc.rs b/src/rust/ain-grpc/src/gen/rpc.rs index a8a86730d4..dabe73fc51 100644 --- a/src/rust/ain-grpc/src/gen/rpc.rs +++ b/src/rust/ain-grpc/src/gen/rpc.rs @@ -745,4 +745,4 @@ pub mod eth_server { pub mod ffi { # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Transaction { pub hash : String , pub raw : RawTransaction , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct RawTransaction { pub in_active_chain : bool , pub hex : String , pub txid : String , pub hash : String , pub size : u32 , pub vsize : u32 , pub weight : u32 , pub version : u32 , pub locktime : u64 , pub vin : Vec < Vin > , pub vout : Vec < Vout > , pub blockhash : String , pub confirmations : String , pub blocktime : u64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Vin { pub txid : String , pub vout : u32 , pub script_sig : ScriptSig , pub sequence : u64 , pub txinwitness : Vec < String > , pub coinbase : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct ScriptSig { pub field_asm : String , pub hex : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Vout { pub value : f64 , pub n : u64 , pub script_pub_key : PubKey , pub token_id : u64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct PubKey { pub field_asm : String , pub hex : String , pub field_type : String , pub req_sigs : i32 , pub addresses : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Block { pub hash : String , pub confirmations : i64 , pub size : u64 , pub strippedsize : u64 , pub weight : u64 , pub height : u64 , pub version : u64 , pub version_hex : String , pub merkleroot : String , pub tx : Vec < Transaction > , pub time : u64 , pub mediantime : u64 , pub nonce : u64 , pub bits : String , pub difficulty : f64 , pub chainwork : String , pub n_tx : u32 , pub previous_block_hash : String , pub next_block_hash : String , pub masternode : String , pub minter : String , pub minted_blocks : u64 , pub stake_modifier : String , pub nonutxo : Vec < NonUtxo > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct NonUtxo { pub anchor_reward : f64 , pub burnt : f64 , pub incentive_funding : f64 , pub loan : f64 , pub options : f64 , pub unknown : f64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct BlockInput { pub blockhash : String , pub verbosity : u32 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct BlockResult { pub hash : String , pub block : Block , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct BlockHashResult { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthAccountsResult { pub accounts : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthTransactionInfo { pub from : String , pub to : String , pub gas : u64 , pub price : u64 , pub value : u64 , pub data : String , pub nonce : u64 , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthChainIdResult { pub id : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthBlockInfo { pub block_number : String , pub hash : String , pub parent_hash : String , pub nonce : String , pub sha3_uncles : String , pub logs_bloom : String , pub transactions_root : String , pub state_root : String , pub receipt_root : String , pub miner : String , pub difficulty : String , pub total_difficulty : String , pub extra_data : String , pub size : String , pub gas_limit : String , pub gas_used : String , pub timestamps : String , pub transactions : Vec < String > , pub uncles : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthTransactionReceipt { pub transaction_hash : String , pub transaction_index : String , pub block_hash : String , pub block_number : String , pub from : String , pub to : String , pub cumulative_gas_used : String , pub effective_gas_price : String , pub gas_used : String , pub contract_address : String , pub logs : Vec < String > , pub logs_bloom : String , pub field_type : String , pub root : String , pub status : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCallInput { pub transaction_info : EthTransactionInfo , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCallResult { pub data : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignInput { pub address : String , pub message : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignResult { pub signature : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBalanceInput { pub address : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBalanceResult { pub balance : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendTransactionInput { pub transaction_info : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendTransactionResult { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCoinBaseResult { pub address : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthMiningResult { pub is_mining : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthHashRateResult { pub hash_rate : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGasPriceResult { pub gas_price : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthBlockNumberResult { pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionCountInput { pub address : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionCountResult { pub number_transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByHashInput { pub block_hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByHashResult { pub number_transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByNumberInput { pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockTransactionCountByNumberResult { pub number_transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockHashInput { pub block_hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockHashResult { pub number_uncles : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockNumberInput { pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleCountByBlockNumberResult { pub number_uncles : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetCodeInput { pub address : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetCodeResult { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignTransactionInput { pub transaction_info : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSignTransactionResult { pub transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendRawTransactionInput { pub transaction : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSendRawTransactionResult { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthEstimateGasInput { pub transaction_info : EthTransactionInfo , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthEstimateGasResult { pub gas_used : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByHashInput { pub hash : String , pub full_transaction : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByHashResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByNumberInput { pub number : String , pub full_transaction : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetBlockByNumberResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByHashInput { pub hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByHashResult { pub transaction : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockHashAndIndexInput { pub block_hash : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockHashAndIndexResult { pub transaction : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockNumberAndIndexInput { pub block_number : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionByBlockNumberAndIndexResult { pub transaction : EthTransactionInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockHashAndIndexInput { pub block_hash : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockHashAndIndexResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockNumberAndIndexInput { pub block_number : String , pub index : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetUncleByBlockNumberAndIndexResult { pub block_info : EthBlockInfo , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetCompilersResult { pub compilers : Vec < String > , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSolidityInput { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSolidityResult { pub compiled_code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileLllInput { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileLllResult { pub compiled_code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSerpentInput { pub code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthCompileSerpentResult { pub compiled_code : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthProtocolVersionResult { pub protocol_version : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Web3Sha3Input { pub data : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Web3Sha3Result { pub data : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct NetPeerCountResult { pub number_peer : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct NetVersionResult { pub network_version : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct Web3ClientVersionResult { pub client_version : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetWorkResult { pub currentblock : String , pub seed_hash : String , pub target : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitWorkInput { pub nounce : String , pub pow_hash : String , pub mix_digest : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitWorkResult { pub is_valid : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitHashrateInput { pub hash_rate : String , pub id : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSubmitHashrateResult { pub is_valid : bool , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetStorageAtInput { pub address : String , pub position : String , pub block_number : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetStorageAtResult { pub value : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionReceiptInput { pub transaction_hash : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthGetTransactionReceiptResult { pub transaction_receipt : EthTransactionReceipt , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSyncingInfo { pub starting_block : String , pub current_block : String , pub highest_block : String , } # [derive (Debug , Default , Serialize , Deserialize , PartialEq)] pub struct EthSyncingResult { pub status : bool , pub sync_info : EthSyncingInfo , } extern "Rust" { type Client ; fn NewClient (addr : & str) -> Result < Box < Client >> ; # [allow (clippy :: borrowed_box)] fn CallEth_Accounts (client : & Box < Client >) -> Result < EthAccountsResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_Call (client : & Box < Client > , eth_call_input : EthCallInput) -> Result < EthCallResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_GetBalance (client : & Box < Client > , eth_get_balance_input : EthGetBalanceInput) -> Result < EthGetBalanceResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByHash (client : & Box < Client > , eth_get_block_by_hash_input : EthGetBlockByHashInput) -> Result < EthBlockInfo > ; # [allow (clippy :: borrowed_box)] fn CallEth_ChainId (client : & Box < Client >) -> Result < EthChainIdResult > ; # [allow (clippy :: borrowed_box)] fn CallNet_Version (client : & Box < Client >) -> Result < EthChainIdResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_BlockNumber (client : & Box < Client >) -> Result < EthBlockNumberResult > ; # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByNumber (client : & Box < Client > , eth_get_block_by_number_input : EthGetBlockByNumberInput) -> Result < EthBlockInfo > ; # [allow (clippy :: borrowed_box)] fn CallEth_Mining (client : & Box < Client >) -> Result < EthMiningResult > ; } } -use jsonrpsee_core :: client :: ClientT ; use jsonrpsee_http_client :: { HttpClient , HttpClientBuilder } ; use std :: sync :: Arc ; use crate :: { CLIENTS } ; use ain_evm :: runtime :: RUNTIME ; use crate :: rpc :: * ; # [allow (unused_imports)] use self :: ffi :: * ; use ain_evm :: handler :: Handlers ; # [derive (Clone)] pub struct Client { inner : Arc < HttpClient > , handle : tokio :: runtime :: Handle , } # [allow (non_snake_case)] fn NewClient (addr : & str) -> Result < Box < Client > , Box < dyn std :: error :: Error >> { if CLIENTS . read () . unwrap () . get (addr) . is_none () { log :: info ! ("Initializing RPC client for {}" , addr) ; let c = Client { inner : Arc :: new (HttpClientBuilder :: default () . build (addr) ?) , handle : RUNTIME . rt_handle . clone () , } ; CLIENTS . write () . unwrap () . insert (addr . into () , c) ; } Ok (Box :: new (CLIENTS . read () . unwrap () . get (addr) . unwrap () . clone ())) } # [allow (dead_code)] fn missing_param (field : & str) -> jsonrpsee_core :: Error { jsonrpsee_core :: Error :: Call (jsonrpsee_types :: error :: CallError :: Custom (jsonrpsee_types :: ErrorObject :: borrowed (- 1 , & format ! ("Missing required parameter '{field}'") , None) . into_owned ())) } impl From < ffi :: EthTransactionInfo > for super :: types :: EthTransactionInfo { fn from (other : ffi :: EthTransactionInfo) -> Self { super :: types :: EthTransactionInfo { from : Some (other . from . into ()) , to : Some (other . to . into ()) , gas : Some (other . gas . into ()) , price : Some (other . price . into ()) , value : Some (other . value . into ()) , data : Some (other . data . into ()) , nonce : Some (other . nonce . into ()) , } } } impl From < super :: types :: EthTransactionInfo > for ffi :: EthTransactionInfo { fn from (other : super :: types :: EthTransactionInfo) -> Self { ffi :: EthTransactionInfo { from : other . from . map (Into :: into) . unwrap_or_default () , to : other . to . map (Into :: into) . unwrap_or_default () , gas : other . gas . map (Into :: into) . unwrap_or_default () , price : other . price . map (Into :: into) . unwrap_or_default () , value : other . value . map (Into :: into) . unwrap_or_default () , data : other . data . map (Into :: into) . unwrap_or_default () , nonce : other . nonce . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetBlockTransactionCountByHashInput > for super :: types :: EthGetBlockTransactionCountByHashInput { fn from (other : ffi :: EthGetBlockTransactionCountByHashInput) -> Self { super :: types :: EthGetBlockTransactionCountByHashInput { block_hash : other . block_hash . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByHashInput > for ffi :: EthGetBlockTransactionCountByHashInput { fn from (other : super :: types :: EthGetBlockTransactionCountByHashInput) -> Self { ffi :: EthGetBlockTransactionCountByHashInput { block_hash : other . block_hash . into () , } } } impl From < ffi :: EthGetUncleCountByBlockNumberResult > for super :: types :: EthGetUncleCountByBlockNumberResult { fn from (other : ffi :: EthGetUncleCountByBlockNumberResult) -> Self { super :: types :: EthGetUncleCountByBlockNumberResult { number_uncles : other . number_uncles . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockNumberResult > for ffi :: EthGetUncleCountByBlockNumberResult { fn from (other : super :: types :: EthGetUncleCountByBlockNumberResult) -> Self { ffi :: EthGetUncleCountByBlockNumberResult { number_uncles : other . number_uncles . into () , } } } impl From < ffi :: EthSyncingInfo > for super :: types :: EthSyncingInfo { fn from (other : ffi :: EthSyncingInfo) -> Self { super :: types :: EthSyncingInfo { starting_block : other . starting_block . into () , current_block : other . current_block . into () , highest_block : other . highest_block . into () , } } } impl From < super :: types :: EthSyncingInfo > for ffi :: EthSyncingInfo { fn from (other : super :: types :: EthSyncingInfo) -> Self { ffi :: EthSyncingInfo { starting_block : other . starting_block . into () , current_block : other . current_block . into () , highest_block : other . highest_block . into () , } } } impl From < ffi :: EthSignTransactionInput > for super :: types :: EthSignTransactionInput { fn from (other : ffi :: EthSignTransactionInput) -> Self { super :: types :: EthSignTransactionInput { transaction_info : Some (other . transaction_info . into ()) , } } } impl From < super :: types :: EthSignTransactionInput > for ffi :: EthSignTransactionInput { fn from (other : super :: types :: EthSignTransactionInput) -> Self { ffi :: EthSignTransactionInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthCoinBaseResult > for super :: types :: EthCoinBaseResult { fn from (other : ffi :: EthCoinBaseResult) -> Self { super :: types :: EthCoinBaseResult { address : other . address . into () , } } } impl From < super :: types :: EthCoinBaseResult > for ffi :: EthCoinBaseResult { fn from (other : super :: types :: EthCoinBaseResult) -> Self { ffi :: EthCoinBaseResult { address : other . address . into () , } } } impl From < ffi :: EthGetBlockByNumberResult > for super :: types :: EthGetBlockByNumberResult { fn from (other : ffi :: EthGetBlockByNumberResult) -> Self { super :: types :: EthGetBlockByNumberResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetBlockByNumberResult > for ffi :: EthGetBlockByNumberResult { fn from (other : super :: types :: EthGetBlockByNumberResult) -> Self { ffi :: EthGetBlockByNumberResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthCompileLllResult > for super :: types :: EthCompileLllResult { fn from (other : ffi :: EthCompileLllResult) -> Self { super :: types :: EthCompileLllResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileLllResult > for ffi :: EthCompileLllResult { fn from (other : super :: types :: EthCompileLllResult) -> Self { ffi :: EthCompileLllResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: EthGetUncleCountByBlockHashResult > for super :: types :: EthGetUncleCountByBlockHashResult { fn from (other : ffi :: EthGetUncleCountByBlockHashResult) -> Self { super :: types :: EthGetUncleCountByBlockHashResult { number_uncles : other . number_uncles . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockHashResult > for ffi :: EthGetUncleCountByBlockHashResult { fn from (other : super :: types :: EthGetUncleCountByBlockHashResult) -> Self { ffi :: EthGetUncleCountByBlockHashResult { number_uncles : other . number_uncles . into () , } } } impl From < ffi :: EthSignResult > for super :: types :: EthSignResult { fn from (other : ffi :: EthSignResult) -> Self { super :: types :: EthSignResult { signature : other . signature . into () , } } } impl From < super :: types :: EthSignResult > for ffi :: EthSignResult { fn from (other : super :: types :: EthSignResult) -> Self { ffi :: EthSignResult { signature : other . signature . into () , } } } impl From < ffi :: EthSendRawTransactionResult > for super :: types :: EthSendRawTransactionResult { fn from (other : ffi :: EthSendRawTransactionResult) -> Self { super :: types :: EthSendRawTransactionResult { hash : other . hash . into () , } } } impl From < super :: types :: EthSendRawTransactionResult > for ffi :: EthSendRawTransactionResult { fn from (other : super :: types :: EthSendRawTransactionResult) -> Self { ffi :: EthSendRawTransactionResult { hash : other . hash . into () , } } } impl From < ffi :: EthCallResult > for super :: types :: EthCallResult { fn from (other : ffi :: EthCallResult) -> Self { super :: types :: EthCallResult { data : other . data . into () , } } } impl From < super :: types :: EthCallResult > for ffi :: EthCallResult { fn from (other : super :: types :: EthCallResult) -> Self { ffi :: EthCallResult { data : other . data . into () , } } } impl From < ffi :: EthGetBlockByNumberInput > for super :: types :: EthGetBlockByNumberInput { fn from (other : ffi :: EthGetBlockByNumberInput) -> Self { super :: types :: EthGetBlockByNumberInput { number : other . number . into () , full_transaction : other . full_transaction . into () , } } } impl From < super :: types :: EthGetBlockByNumberInput > for ffi :: EthGetBlockByNumberInput { fn from (other : super :: types :: EthGetBlockByNumberInput) -> Self { ffi :: EthGetBlockByNumberInput { number : other . number . into () , full_transaction : other . full_transaction . into () , } } } impl From < ffi :: EthGetUncleByBlockNumberAndIndexResult > for super :: types :: EthGetUncleByBlockNumberAndIndexResult { fn from (other : ffi :: EthGetUncleByBlockNumberAndIndexResult) -> Self { super :: types :: EthGetUncleByBlockNumberAndIndexResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetUncleByBlockNumberAndIndexResult > for ffi :: EthGetUncleByBlockNumberAndIndexResult { fn from (other : super :: types :: EthGetUncleByBlockNumberAndIndexResult) -> Self { ffi :: EthGetUncleByBlockNumberAndIndexResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthSignInput > for super :: types :: EthSignInput { fn from (other : ffi :: EthSignInput) -> Self { super :: types :: EthSignInput { address : other . address . into () , message : other . message . into () , } } } impl From < super :: types :: EthSignInput > for ffi :: EthSignInput { fn from (other : super :: types :: EthSignInput) -> Self { ffi :: EthSignInput { address : other . address . into () , message : other . message . into () , } } } impl From < ffi :: EthCompileSolidityResult > for super :: types :: EthCompileSolidityResult { fn from (other : ffi :: EthCompileSolidityResult) -> Self { super :: types :: EthCompileSolidityResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileSolidityResult > for ffi :: EthCompileSolidityResult { fn from (other : super :: types :: EthCompileSolidityResult) -> Self { ffi :: EthCompileSolidityResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: EthGetTransactionByHashInput > for super :: types :: EthGetTransactionByHashInput { fn from (other : ffi :: EthGetTransactionByHashInput) -> Self { super :: types :: EthGetTransactionByHashInput { hash : other . hash . into () , } } } impl From < super :: types :: EthGetTransactionByHashInput > for ffi :: EthGetTransactionByHashInput { fn from (other : super :: types :: EthGetTransactionByHashInput) -> Self { ffi :: EthGetTransactionByHashInput { hash : other . hash . into () , } } } impl From < ffi :: ScriptSig > for super :: types :: ScriptSig { fn from (other : ffi :: ScriptSig) -> Self { super :: types :: ScriptSig { field_asm : other . field_asm . into () , hex : other . hex . into () , } } } impl From < super :: types :: ScriptSig > for ffi :: ScriptSig { fn from (other : super :: types :: ScriptSig) -> Self { ffi :: ScriptSig { field_asm : other . field_asm . into () , hex : other . hex . into () , } } } impl From < ffi :: Web3Sha3Result > for super :: types :: Web3Sha3Result { fn from (other : ffi :: Web3Sha3Result) -> Self { super :: types :: Web3Sha3Result { data : other . data . into () , } } } impl From < super :: types :: Web3Sha3Result > for ffi :: Web3Sha3Result { fn from (other : super :: types :: Web3Sha3Result) -> Self { ffi :: Web3Sha3Result { data : other . data . into () , } } } impl From < ffi :: EthGetBlockTransactionCountByHashResult > for super :: types :: EthGetBlockTransactionCountByHashResult { fn from (other : ffi :: EthGetBlockTransactionCountByHashResult) -> Self { super :: types :: EthGetBlockTransactionCountByHashResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByHashResult > for ffi :: EthGetBlockTransactionCountByHashResult { fn from (other : super :: types :: EthGetBlockTransactionCountByHashResult) -> Self { ffi :: EthGetBlockTransactionCountByHashResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: EthEstimateGasInput > for super :: types :: EthEstimateGasInput { fn from (other : ffi :: EthEstimateGasInput) -> Self { super :: types :: EthEstimateGasInput { transaction_info : Some (other . transaction_info . into ()) , block_number : Some (other . block_number . into ()) , } } } impl From < super :: types :: EthEstimateGasInput > for ffi :: EthEstimateGasInput { fn from (other : super :: types :: EthEstimateGasInput) -> Self { ffi :: EthEstimateGasInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , block_number : other . block_number . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthCompileLllInput > for super :: types :: EthCompileLllInput { fn from (other : ffi :: EthCompileLllInput) -> Self { super :: types :: EthCompileLllInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileLllInput > for ffi :: EthCompileLllInput { fn from (other : super :: types :: EthCompileLllInput) -> Self { ffi :: EthCompileLllInput { code : other . code . into () , } } } impl From < ffi :: EthMiningResult > for super :: types :: EthMiningResult { fn from (other : ffi :: EthMiningResult) -> Self { super :: types :: EthMiningResult { is_mining : other . is_mining . into () , } } } impl From < super :: types :: EthMiningResult > for ffi :: EthMiningResult { fn from (other : super :: types :: EthMiningResult) -> Self { ffi :: EthMiningResult { is_mining : other . is_mining . into () , } } } impl From < ffi :: EthSubmitHashrateInput > for super :: types :: EthSubmitHashrateInput { fn from (other : ffi :: EthSubmitHashrateInput) -> Self { super :: types :: EthSubmitHashrateInput { hash_rate : other . hash_rate . into () , id : other . id . into () , } } } impl From < super :: types :: EthSubmitHashrateInput > for ffi :: EthSubmitHashrateInput { fn from (other : super :: types :: EthSubmitHashrateInput) -> Self { ffi :: EthSubmitHashrateInput { hash_rate : other . hash_rate . into () , id : other . id . into () , } } } impl From < ffi :: PubKey > for super :: types :: PubKey { fn from (other : ffi :: PubKey) -> Self { super :: types :: PubKey { field_asm : other . field_asm . into () , hex : other . hex . into () , field_type : other . field_type . into () , req_sigs : other . req_sigs . into () , addresses : other . addresses . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: PubKey > for ffi :: PubKey { fn from (other : super :: types :: PubKey) -> Self { ffi :: PubKey { field_asm : other . field_asm . into () , hex : other . hex . into () , field_type : other . field_type . into () , req_sigs : other . req_sigs . into () , addresses : other . addresses . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthCompileSerpentInput > for super :: types :: EthCompileSerpentInput { fn from (other : ffi :: EthCompileSerpentInput) -> Self { super :: types :: EthCompileSerpentInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileSerpentInput > for ffi :: EthCompileSerpentInput { fn from (other : super :: types :: EthCompileSerpentInput) -> Self { ffi :: EthCompileSerpentInput { code : other . code . into () , } } } impl From < ffi :: EthGetCodeInput > for super :: types :: EthGetCodeInput { fn from (other : ffi :: EthGetCodeInput) -> Self { super :: types :: EthGetCodeInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetCodeInput > for ffi :: EthGetCodeInput { fn from (other : super :: types :: EthGetCodeInput) -> Self { ffi :: EthGetCodeInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthAccountsResult > for super :: types :: EthAccountsResult { fn from (other : ffi :: EthAccountsResult) -> Self { super :: types :: EthAccountsResult { accounts : other . accounts . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthAccountsResult > for ffi :: EthAccountsResult { fn from (other : super :: types :: EthAccountsResult) -> Self { ffi :: EthAccountsResult { accounts : other . accounts . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetUncleByBlockNumberAndIndexInput > for super :: types :: EthGetUncleByBlockNumberAndIndexInput { fn from (other : ffi :: EthGetUncleByBlockNumberAndIndexInput) -> Self { super :: types :: EthGetUncleByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetUncleByBlockNumberAndIndexInput > for ffi :: EthGetUncleByBlockNumberAndIndexInput { fn from (other : super :: types :: EthGetUncleByBlockNumberAndIndexInput) -> Self { ffi :: EthGetUncleByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < ffi :: EthGetStorageAtResult > for super :: types :: EthGetStorageAtResult { fn from (other : ffi :: EthGetStorageAtResult) -> Self { super :: types :: EthGetStorageAtResult { value : other . value . into () , } } } impl From < super :: types :: EthGetStorageAtResult > for ffi :: EthGetStorageAtResult { fn from (other : super :: types :: EthGetStorageAtResult) -> Self { ffi :: EthGetStorageAtResult { value : other . value . into () , } } } impl From < ffi :: EthSubmitWorkInput > for super :: types :: EthSubmitWorkInput { fn from (other : ffi :: EthSubmitWorkInput) -> Self { super :: types :: EthSubmitWorkInput { nounce : other . nounce . into () , pow_hash : other . pow_hash . into () , mix_digest : other . mix_digest . into () , } } } impl From < super :: types :: EthSubmitWorkInput > for ffi :: EthSubmitWorkInput { fn from (other : super :: types :: EthSubmitWorkInput) -> Self { ffi :: EthSubmitWorkInput { nounce : other . nounce . into () , pow_hash : other . pow_hash . into () , mix_digest : other . mix_digest . into () , } } } impl From < ffi :: EthChainIdResult > for super :: types :: EthChainIdResult { fn from (other : ffi :: EthChainIdResult) -> Self { super :: types :: EthChainIdResult { id : other . id . into () , } } } impl From < super :: types :: EthChainIdResult > for ffi :: EthChainIdResult { fn from (other : super :: types :: EthChainIdResult) -> Self { ffi :: EthChainIdResult { id : other . id . into () , } } } impl From < ffi :: EthSubmitHashrateResult > for super :: types :: EthSubmitHashrateResult { fn from (other : ffi :: EthSubmitHashrateResult) -> Self { super :: types :: EthSubmitHashrateResult { is_valid : other . is_valid . into () , } } } impl From < super :: types :: EthSubmitHashrateResult > for ffi :: EthSubmitHashrateResult { fn from (other : super :: types :: EthSubmitHashrateResult) -> Self { ffi :: EthSubmitHashrateResult { is_valid : other . is_valid . into () , } } } impl From < ffi :: EthSendTransactionInput > for super :: types :: EthSendTransactionInput { fn from (other : ffi :: EthSendTransactionInput) -> Self { super :: types :: EthSendTransactionInput { transaction_info : Some (other . transaction_info . into ()) , } } } impl From < super :: types :: EthSendTransactionInput > for ffi :: EthSendTransactionInput { fn from (other : super :: types :: EthSendTransactionInput) -> Self { ffi :: EthSendTransactionInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetTransactionByHashResult > for super :: types :: EthGetTransactionByHashResult { fn from (other : ffi :: EthGetTransactionByHashResult) -> Self { super :: types :: EthGetTransactionByHashResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByHashResult > for ffi :: EthGetTransactionByHashResult { fn from (other : super :: types :: EthGetTransactionByHashResult) -> Self { ffi :: EthGetTransactionByHashResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetTransactionByBlockNumberAndIndexInput > for super :: types :: EthGetTransactionByBlockNumberAndIndexInput { fn from (other : ffi :: EthGetTransactionByBlockNumberAndIndexInput) -> Self { super :: types :: EthGetTransactionByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetTransactionByBlockNumberAndIndexInput > for ffi :: EthGetTransactionByBlockNumberAndIndexInput { fn from (other : super :: types :: EthGetTransactionByBlockNumberAndIndexInput) -> Self { ffi :: EthGetTransactionByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < ffi :: EthSendRawTransactionInput > for super :: types :: EthSendRawTransactionInput { fn from (other : ffi :: EthSendRawTransactionInput) -> Self { super :: types :: EthSendRawTransactionInput { transaction : other . transaction . into () , } } } impl From < super :: types :: EthSendRawTransactionInput > for ffi :: EthSendRawTransactionInput { fn from (other : super :: types :: EthSendRawTransactionInput) -> Self { ffi :: EthSendRawTransactionInput { transaction : other . transaction . into () , } } } impl From < ffi :: EthBlockInfo > for super :: types :: EthBlockInfo { fn from (other : ffi :: EthBlockInfo) -> Self { super :: types :: EthBlockInfo { block_number : other . block_number . into () , hash : other . hash . into () , parent_hash : other . parent_hash . into () , nonce : other . nonce . into () , sha3_uncles : other . sha3_uncles . into () , logs_bloom : other . logs_bloom . into () , transactions_root : other . transactions_root . into () , state_root : other . state_root . into () , receipt_root : other . receipt_root . into () , miner : other . miner . into () , difficulty : other . difficulty . into () , total_difficulty : other . total_difficulty . into () , extra_data : other . extra_data . into () , size : other . size . into () , gas_limit : other . gas_limit . into () , gas_used : other . gas_used . into () , timestamps : other . timestamps . into () , transactions : other . transactions . into_iter () . map (Into :: into) . collect () , uncles : other . uncles . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthBlockInfo > for ffi :: EthBlockInfo { fn from (other : super :: types :: EthBlockInfo) -> Self { ffi :: EthBlockInfo { block_number : other . block_number . into () , hash : other . hash . into () , parent_hash : other . parent_hash . into () , nonce : other . nonce . into () , sha3_uncles : other . sha3_uncles . into () , logs_bloom : other . logs_bloom . into () , transactions_root : other . transactions_root . into () , state_root : other . state_root . into () , receipt_root : other . receipt_root . into () , miner : other . miner . into () , difficulty : other . difficulty . into () , total_difficulty : other . total_difficulty . into () , extra_data : other . extra_data . into () , size : other . size . into () , gas_limit : other . gas_limit . into () , gas_used : other . gas_used . into () , timestamps : other . timestamps . into () , transactions : other . transactions . into_iter () . map (Into :: into) . collect () , uncles : other . uncles . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetBlockTransactionCountByNumberResult > for super :: types :: EthGetBlockTransactionCountByNumberResult { fn from (other : ffi :: EthGetBlockTransactionCountByNumberResult) -> Self { super :: types :: EthGetBlockTransactionCountByNumberResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByNumberResult > for ffi :: EthGetBlockTransactionCountByNumberResult { fn from (other : super :: types :: EthGetBlockTransactionCountByNumberResult) -> Self { ffi :: EthGetBlockTransactionCountByNumberResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: EthProtocolVersionResult > for super :: types :: EthProtocolVersionResult { fn from (other : ffi :: EthProtocolVersionResult) -> Self { super :: types :: EthProtocolVersionResult { protocol_version : other . protocol_version . into () , } } } impl From < super :: types :: EthProtocolVersionResult > for ffi :: EthProtocolVersionResult { fn from (other : super :: types :: EthProtocolVersionResult) -> Self { ffi :: EthProtocolVersionResult { protocol_version : other . protocol_version . into () , } } } impl From < ffi :: EthSyncingResult > for super :: types :: EthSyncingResult { fn from (other : ffi :: EthSyncingResult) -> Self { super :: types :: EthSyncingResult { status : Some (other . status . into ()) , sync_info : Some (other . sync_info . into ()) , } } } impl From < super :: types :: EthSyncingResult > for ffi :: EthSyncingResult { fn from (other : super :: types :: EthSyncingResult) -> Self { ffi :: EthSyncingResult { status : other . status . map (Into :: into) . unwrap_or_default () , sync_info : other . sync_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: Vin > for super :: types :: Vin { fn from (other : ffi :: Vin) -> Self { super :: types :: Vin { txid : other . txid . into () , vout : other . vout . into () , script_sig : Some (other . script_sig . into ()) , sequence : other . sequence . into () , txinwitness : other . txinwitness . into_iter () . map (Into :: into) . collect () , coinbase : other . coinbase . into () , } } } impl From < super :: types :: Vin > for ffi :: Vin { fn from (other : super :: types :: Vin) -> Self { ffi :: Vin { txid : other . txid . into () , vout : other . vout . into () , script_sig : other . script_sig . map (Into :: into) . unwrap_or_default () , sequence : other . sequence . into () , txinwitness : other . txinwitness . into_iter () . map (Into :: into) . collect () , coinbase : other . coinbase . into () , } } } impl From < ffi :: EthGetTransactionCountInput > for super :: types :: EthGetTransactionCountInput { fn from (other : ffi :: EthGetTransactionCountInput) -> Self { super :: types :: EthGetTransactionCountInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetTransactionCountInput > for ffi :: EthGetTransactionCountInput { fn from (other : super :: types :: EthGetTransactionCountInput) -> Self { ffi :: EthGetTransactionCountInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthGetTransactionReceiptInput > for super :: types :: EthGetTransactionReceiptInput { fn from (other : ffi :: EthGetTransactionReceiptInput) -> Self { super :: types :: EthGetTransactionReceiptInput { transaction_hash : other . transaction_hash . into () , } } } impl From < super :: types :: EthGetTransactionReceiptInput > for ffi :: EthGetTransactionReceiptInput { fn from (other : super :: types :: EthGetTransactionReceiptInput) -> Self { ffi :: EthGetTransactionReceiptInput { transaction_hash : other . transaction_hash . into () , } } } impl From < ffi :: EthHashRateResult > for super :: types :: EthHashRateResult { fn from (other : ffi :: EthHashRateResult) -> Self { super :: types :: EthHashRateResult { hash_rate : other . hash_rate . into () , } } } impl From < super :: types :: EthHashRateResult > for ffi :: EthHashRateResult { fn from (other : super :: types :: EthHashRateResult) -> Self { ffi :: EthHashRateResult { hash_rate : other . hash_rate . into () , } } } impl From < ffi :: EthGetBlockByHashResult > for super :: types :: EthGetBlockByHashResult { fn from (other : ffi :: EthGetBlockByHashResult) -> Self { super :: types :: EthGetBlockByHashResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetBlockByHashResult > for ffi :: EthGetBlockByHashResult { fn from (other : super :: types :: EthGetBlockByHashResult) -> Self { ffi :: EthGetBlockByHashResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetBalanceInput > for super :: types :: EthGetBalanceInput { fn from (other : ffi :: EthGetBalanceInput) -> Self { super :: types :: EthGetBalanceInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetBalanceInput > for ffi :: EthGetBalanceInput { fn from (other : super :: types :: EthGetBalanceInput) -> Self { ffi :: EthGetBalanceInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthSignTransactionResult > for super :: types :: EthSignTransactionResult { fn from (other : ffi :: EthSignTransactionResult) -> Self { super :: types :: EthSignTransactionResult { transaction : other . transaction . into () , } } } impl From < super :: types :: EthSignTransactionResult > for ffi :: EthSignTransactionResult { fn from (other : super :: types :: EthSignTransactionResult) -> Self { ffi :: EthSignTransactionResult { transaction : other . transaction . into () , } } } impl From < ffi :: Block > for super :: types :: Block { fn from (other : ffi :: Block) -> Self { super :: types :: Block { hash : other . hash . into () , confirmations : other . confirmations . into () , size : other . size . into () , strippedsize : other . strippedsize . into () , weight : other . weight . into () , height : other . height . into () , version : other . version . into () , version_hex : other . version_hex . into () , merkleroot : other . merkleroot . into () , tx : other . tx . into_iter () . map (Into :: into) . collect () , time : other . time . into () , mediantime : other . mediantime . into () , nonce : other . nonce . into () , bits : other . bits . into () , difficulty : other . difficulty . into () , chainwork : other . chainwork . into () , n_tx : other . n_tx . into () , previous_block_hash : other . previous_block_hash . into () , next_block_hash : other . next_block_hash . into () , masternode : other . masternode . into () , minter : other . minter . into () , minted_blocks : other . minted_blocks . into () , stake_modifier : other . stake_modifier . into () , nonutxo : other . nonutxo . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: Block > for ffi :: Block { fn from (other : super :: types :: Block) -> Self { ffi :: Block { hash : other . hash . into () , confirmations : other . confirmations . into () , size : other . size . into () , strippedsize : other . strippedsize . into () , weight : other . weight . into () , height : other . height . into () , version : other . version . into () , version_hex : other . version_hex . into () , merkleroot : other . merkleroot . into () , tx : other . tx . into_iter () . map (Into :: into) . collect () , time : other . time . into () , mediantime : other . mediantime . into () , nonce : other . nonce . into () , bits : other . bits . into () , difficulty : other . difficulty . into () , chainwork : other . chainwork . into () , n_tx : other . n_tx . into () , previous_block_hash : other . previous_block_hash . into () , next_block_hash : other . next_block_hash . into () , masternode : other . masternode . into () , minter : other . minter . into () , minted_blocks : other . minted_blocks . into () , stake_modifier : other . stake_modifier . into () , nonutxo : other . nonutxo . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthCallInput > for super :: types :: EthCallInput { fn from (other : ffi :: EthCallInput) -> Self { super :: types :: EthCallInput { transaction_info : Some (other . transaction_info . into ()) , block_number : other . block_number . into () , } } } impl From < super :: types :: EthCallInput > for ffi :: EthCallInput { fn from (other : super :: types :: EthCallInput) -> Self { ffi :: EthCallInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , block_number : other . block_number . into () , } } } impl From < ffi :: EthGasPriceResult > for super :: types :: EthGasPriceResult { fn from (other : ffi :: EthGasPriceResult) -> Self { super :: types :: EthGasPriceResult { gas_price : other . gas_price . into () , } } } impl From < super :: types :: EthGasPriceResult > for ffi :: EthGasPriceResult { fn from (other : super :: types :: EthGasPriceResult) -> Self { ffi :: EthGasPriceResult { gas_price : other . gas_price . into () , } } } impl From < ffi :: EthGetTransactionCountResult > for super :: types :: EthGetTransactionCountResult { fn from (other : ffi :: EthGetTransactionCountResult) -> Self { super :: types :: EthGetTransactionCountResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetTransactionCountResult > for ffi :: EthGetTransactionCountResult { fn from (other : super :: types :: EthGetTransactionCountResult) -> Self { ffi :: EthGetTransactionCountResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: EthGetTransactionReceiptResult > for super :: types :: EthGetTransactionReceiptResult { fn from (other : ffi :: EthGetTransactionReceiptResult) -> Self { super :: types :: EthGetTransactionReceiptResult { transaction_receipt : Some (other . transaction_receipt . into ()) , } } } impl From < super :: types :: EthGetTransactionReceiptResult > for ffi :: EthGetTransactionReceiptResult { fn from (other : super :: types :: EthGetTransactionReceiptResult) -> Self { ffi :: EthGetTransactionReceiptResult { transaction_receipt : other . transaction_receipt . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthTransactionReceipt > for super :: types :: EthTransactionReceipt { fn from (other : ffi :: EthTransactionReceipt) -> Self { super :: types :: EthTransactionReceipt { transaction_hash : other . transaction_hash . into () , transaction_index : other . transaction_index . into () , block_hash : other . block_hash . into () , block_number : other . block_number . into () , from : other . from . into () , to : other . to . into () , cumulative_gas_used : other . cumulative_gas_used . into () , effective_gas_price : other . effective_gas_price . into () , gas_used : other . gas_used . into () , contract_address : other . contract_address . into () , logs : other . logs . into_iter () . map (Into :: into) . collect () , logs_bloom : other . logs_bloom . into () , field_type : other . field_type . into () , root : Some (other . root . into ()) , status : Some (other . status . into ()) , } } } impl From < super :: types :: EthTransactionReceipt > for ffi :: EthTransactionReceipt { fn from (other : super :: types :: EthTransactionReceipt) -> Self { ffi :: EthTransactionReceipt { transaction_hash : other . transaction_hash . into () , transaction_index : other . transaction_index . into () , block_hash : other . block_hash . into () , block_number : other . block_number . into () , from : other . from . into () , to : other . to . into () , cumulative_gas_used : other . cumulative_gas_used . into () , effective_gas_price : other . effective_gas_price . into () , gas_used : other . gas_used . into () , contract_address : other . contract_address . into () , logs : other . logs . into_iter () . map (Into :: into) . collect () , logs_bloom : other . logs_bloom . into () , field_type : other . field_type . into () , root : other . root . map (Into :: into) . unwrap_or_default () , status : other . status . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetBlockTransactionCountByNumberInput > for super :: types :: EthGetBlockTransactionCountByNumberInput { fn from (other : ffi :: EthGetBlockTransactionCountByNumberInput) -> Self { super :: types :: EthGetBlockTransactionCountByNumberInput { block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByNumberInput > for ffi :: EthGetBlockTransactionCountByNumberInput { fn from (other : super :: types :: EthGetBlockTransactionCountByNumberInput) -> Self { ffi :: EthGetBlockTransactionCountByNumberInput { block_number : other . block_number . into () , } } } impl From < ffi :: EthCompileSolidityInput > for super :: types :: EthCompileSolidityInput { fn from (other : ffi :: EthCompileSolidityInput) -> Self { super :: types :: EthCompileSolidityInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileSolidityInput > for ffi :: EthCompileSolidityInput { fn from (other : super :: types :: EthCompileSolidityInput) -> Self { ffi :: EthCompileSolidityInput { code : other . code . into () , } } } impl From < ffi :: EthSubmitWorkResult > for super :: types :: EthSubmitWorkResult { fn from (other : ffi :: EthSubmitWorkResult) -> Self { super :: types :: EthSubmitWorkResult { is_valid : other . is_valid . into () , } } } impl From < super :: types :: EthSubmitWorkResult > for ffi :: EthSubmitWorkResult { fn from (other : super :: types :: EthSubmitWorkResult) -> Self { ffi :: EthSubmitWorkResult { is_valid : other . is_valid . into () , } } } impl From < ffi :: RawTransaction > for super :: types :: RawTransaction { fn from (other : ffi :: RawTransaction) -> Self { super :: types :: RawTransaction { in_active_chain : other . in_active_chain . into () , hex : other . hex . into () , txid : other . txid . into () , hash : other . hash . into () , size : other . size . into () , vsize : other . vsize . into () , weight : other . weight . into () , version : other . version . into () , locktime : other . locktime . into () , vin : other . vin . into_iter () . map (Into :: into) . collect () , vout : other . vout . into_iter () . map (Into :: into) . collect () , blockhash : other . blockhash . into () , confirmations : other . confirmations . into () , blocktime : other . blocktime . into () , } } } impl From < super :: types :: RawTransaction > for ffi :: RawTransaction { fn from (other : super :: types :: RawTransaction) -> Self { ffi :: RawTransaction { in_active_chain : other . in_active_chain . into () , hex : other . hex . into () , txid : other . txid . into () , hash : other . hash . into () , size : other . size . into () , vsize : other . vsize . into () , weight : other . weight . into () , version : other . version . into () , locktime : other . locktime . into () , vin : other . vin . into_iter () . map (Into :: into) . collect () , vout : other . vout . into_iter () . map (Into :: into) . collect () , blockhash : other . blockhash . into () , confirmations : other . confirmations . into () , blocktime : other . blocktime . into () , } } } impl From < ffi :: EthGetTransactionByBlockHashAndIndexResult > for super :: types :: EthGetTransactionByBlockHashAndIndexResult { fn from (other : ffi :: EthGetTransactionByBlockHashAndIndexResult) -> Self { super :: types :: EthGetTransactionByBlockHashAndIndexResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByBlockHashAndIndexResult > for ffi :: EthGetTransactionByBlockHashAndIndexResult { fn from (other : super :: types :: EthGetTransactionByBlockHashAndIndexResult) -> Self { ffi :: EthGetTransactionByBlockHashAndIndexResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: Vout > for super :: types :: Vout { fn from (other : ffi :: Vout) -> Self { super :: types :: Vout { value : other . value . into () , n : other . n . into () , script_pub_key : Some (other . script_pub_key . into ()) , token_id : other . token_id . into () , } } } impl From < super :: types :: Vout > for ffi :: Vout { fn from (other : super :: types :: Vout) -> Self { ffi :: Vout { value : other . value . into () , n : other . n . into () , script_pub_key : other . script_pub_key . map (Into :: into) . unwrap_or_default () , token_id : other . token_id . into () , } } } impl From < ffi :: EthBlockNumberResult > for super :: types :: EthBlockNumberResult { fn from (other : ffi :: EthBlockNumberResult) -> Self { super :: types :: EthBlockNumberResult { block_number : other . block_number . into () , } } } impl From < super :: types :: EthBlockNumberResult > for ffi :: EthBlockNumberResult { fn from (other : super :: types :: EthBlockNumberResult) -> Self { ffi :: EthBlockNumberResult { block_number : other . block_number . into () , } } } impl From < ffi :: EthSendTransactionResult > for super :: types :: EthSendTransactionResult { fn from (other : ffi :: EthSendTransactionResult) -> Self { super :: types :: EthSendTransactionResult { hash : other . hash . into () , } } } impl From < super :: types :: EthSendTransactionResult > for ffi :: EthSendTransactionResult { fn from (other : super :: types :: EthSendTransactionResult) -> Self { ffi :: EthSendTransactionResult { hash : other . hash . into () , } } } impl From < ffi :: BlockResult > for super :: types :: BlockResult { fn from (other : ffi :: BlockResult) -> Self { super :: types :: BlockResult { hash : other . hash . into () , block : Some (other . block . into ()) , } } } impl From < super :: types :: BlockResult > for ffi :: BlockResult { fn from (other : super :: types :: BlockResult) -> Self { ffi :: BlockResult { hash : other . hash . into () , block : other . block . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: Web3Sha3Input > for super :: types :: Web3Sha3Input { fn from (other : ffi :: Web3Sha3Input) -> Self { super :: types :: Web3Sha3Input { data : other . data . into () , } } } impl From < super :: types :: Web3Sha3Input > for ffi :: Web3Sha3Input { fn from (other : super :: types :: Web3Sha3Input) -> Self { ffi :: Web3Sha3Input { data : other . data . into () , } } } impl From < ffi :: EthGetCodeResult > for super :: types :: EthGetCodeResult { fn from (other : ffi :: EthGetCodeResult) -> Self { super :: types :: EthGetCodeResult { code : other . code . into () , } } } impl From < super :: types :: EthGetCodeResult > for ffi :: EthGetCodeResult { fn from (other : super :: types :: EthGetCodeResult) -> Self { ffi :: EthGetCodeResult { code : other . code . into () , } } } impl From < ffi :: Transaction > for super :: types :: Transaction { fn from (other : ffi :: Transaction) -> Self { super :: types :: Transaction { hash : other . hash . into () , raw : Some (other . raw . into ()) , } } } impl From < super :: types :: Transaction > for ffi :: Transaction { fn from (other : super :: types :: Transaction) -> Self { ffi :: Transaction { hash : other . hash . into () , raw : other . raw . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: NonUtxo > for super :: types :: NonUtxo { fn from (other : ffi :: NonUtxo) -> Self { super :: types :: NonUtxo { anchor_reward : other . anchor_reward . into () , burnt : other . burnt . into () , incentive_funding : other . incentive_funding . into () , loan : other . loan . into () , options : other . options . into () , unknown : other . unknown . into () , } } } impl From < super :: types :: NonUtxo > for ffi :: NonUtxo { fn from (other : super :: types :: NonUtxo) -> Self { ffi :: NonUtxo { anchor_reward : other . anchor_reward . into () , burnt : other . burnt . into () , incentive_funding : other . incentive_funding . into () , loan : other . loan . into () , options : other . options . into () , unknown : other . unknown . into () , } } } impl From < ffi :: EthEstimateGasResult > for super :: types :: EthEstimateGasResult { fn from (other : ffi :: EthEstimateGasResult) -> Self { super :: types :: EthEstimateGasResult { gas_used : other . gas_used . into () , } } } impl From < super :: types :: EthEstimateGasResult > for ffi :: EthEstimateGasResult { fn from (other : super :: types :: EthEstimateGasResult) -> Self { ffi :: EthEstimateGasResult { gas_used : other . gas_used . into () , } } } impl From < ffi :: EthGetUncleCountByBlockNumberInput > for super :: types :: EthGetUncleCountByBlockNumberInput { fn from (other : ffi :: EthGetUncleCountByBlockNumberInput) -> Self { super :: types :: EthGetUncleCountByBlockNumberInput { block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockNumberInput > for ffi :: EthGetUncleCountByBlockNumberInput { fn from (other : super :: types :: EthGetUncleCountByBlockNumberInput) -> Self { ffi :: EthGetUncleCountByBlockNumberInput { block_number : other . block_number . into () , } } } impl From < ffi :: EthGetBalanceResult > for super :: types :: EthGetBalanceResult { fn from (other : ffi :: EthGetBalanceResult) -> Self { super :: types :: EthGetBalanceResult { balance : other . balance . into () , } } } impl From < super :: types :: EthGetBalanceResult > for ffi :: EthGetBalanceResult { fn from (other : super :: types :: EthGetBalanceResult) -> Self { ffi :: EthGetBalanceResult { balance : other . balance . into () , } } } impl From < ffi :: EthGetStorageAtInput > for super :: types :: EthGetStorageAtInput { fn from (other : ffi :: EthGetStorageAtInput) -> Self { super :: types :: EthGetStorageAtInput { address : other . address . into () , position : other . position . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetStorageAtInput > for ffi :: EthGetStorageAtInput { fn from (other : super :: types :: EthGetStorageAtInput) -> Self { ffi :: EthGetStorageAtInput { address : other . address . into () , position : other . position . into () , block_number : other . block_number . into () , } } } impl From < ffi :: BlockInput > for super :: types :: BlockInput { fn from (other : ffi :: BlockInput) -> Self { super :: types :: BlockInput { blockhash : other . blockhash . into () , verbosity : other . verbosity . into () , } } } impl From < super :: types :: BlockInput > for ffi :: BlockInput { fn from (other : super :: types :: BlockInput) -> Self { ffi :: BlockInput { blockhash : other . blockhash . into () , verbosity : other . verbosity . into () , } } } impl From < ffi :: EthGetTransactionByBlockNumberAndIndexResult > for super :: types :: EthGetTransactionByBlockNumberAndIndexResult { fn from (other : ffi :: EthGetTransactionByBlockNumberAndIndexResult) -> Self { super :: types :: EthGetTransactionByBlockNumberAndIndexResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByBlockNumberAndIndexResult > for ffi :: EthGetTransactionByBlockNumberAndIndexResult { fn from (other : super :: types :: EthGetTransactionByBlockNumberAndIndexResult) -> Self { ffi :: EthGetTransactionByBlockNumberAndIndexResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetCompilersResult > for super :: types :: EthGetCompilersResult { fn from (other : ffi :: EthGetCompilersResult) -> Self { super :: types :: EthGetCompilersResult { compilers : other . compilers . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthGetCompilersResult > for ffi :: EthGetCompilersResult { fn from (other : super :: types :: EthGetCompilersResult) -> Self { ffi :: EthGetCompilersResult { compilers : other . compilers . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthCompileSerpentResult > for super :: types :: EthCompileSerpentResult { fn from (other : ffi :: EthCompileSerpentResult) -> Self { super :: types :: EthCompileSerpentResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileSerpentResult > for ffi :: EthCompileSerpentResult { fn from (other : super :: types :: EthCompileSerpentResult) -> Self { ffi :: EthCompileSerpentResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: NetPeerCountResult > for super :: types :: NetPeerCountResult { fn from (other : ffi :: NetPeerCountResult) -> Self { super :: types :: NetPeerCountResult { number_peer : other . number_peer . into () , } } } impl From < super :: types :: NetPeerCountResult > for ffi :: NetPeerCountResult { fn from (other : super :: types :: NetPeerCountResult) -> Self { ffi :: NetPeerCountResult { number_peer : other . number_peer . into () , } } } impl From < ffi :: EthGetUncleByBlockHashAndIndexInput > for super :: types :: EthGetUncleByBlockHashAndIndexInput { fn from (other : ffi :: EthGetUncleByBlockHashAndIndexInput) -> Self { super :: types :: EthGetUncleByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetUncleByBlockHashAndIndexInput > for ffi :: EthGetUncleByBlockHashAndIndexInput { fn from (other : super :: types :: EthGetUncleByBlockHashAndIndexInput) -> Self { ffi :: EthGetUncleByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < ffi :: NetVersionResult > for super :: types :: NetVersionResult { fn from (other : ffi :: NetVersionResult) -> Self { super :: types :: NetVersionResult { network_version : other . network_version . into () , } } } impl From < super :: types :: NetVersionResult > for ffi :: NetVersionResult { fn from (other : super :: types :: NetVersionResult) -> Self { ffi :: NetVersionResult { network_version : other . network_version . into () , } } } impl From < ffi :: BlockHashResult > for super :: types :: BlockHashResult { fn from (other : ffi :: BlockHashResult) -> Self { super :: types :: BlockHashResult { hash : other . hash . into () , } } } impl From < super :: types :: BlockHashResult > for ffi :: BlockHashResult { fn from (other : super :: types :: BlockHashResult) -> Self { ffi :: BlockHashResult { hash : other . hash . into () , } } } impl From < ffi :: Web3ClientVersionResult > for super :: types :: Web3ClientVersionResult { fn from (other : ffi :: Web3ClientVersionResult) -> Self { super :: types :: Web3ClientVersionResult { client_version : other . client_version . into () , } } } impl From < super :: types :: Web3ClientVersionResult > for ffi :: Web3ClientVersionResult { fn from (other : super :: types :: Web3ClientVersionResult) -> Self { ffi :: Web3ClientVersionResult { client_version : other . client_version . into () , } } } impl From < ffi :: EthGetUncleCountByBlockHashInput > for super :: types :: EthGetUncleCountByBlockHashInput { fn from (other : ffi :: EthGetUncleCountByBlockHashInput) -> Self { super :: types :: EthGetUncleCountByBlockHashInput { block_hash : other . block_hash . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockHashInput > for ffi :: EthGetUncleCountByBlockHashInput { fn from (other : super :: types :: EthGetUncleCountByBlockHashInput) -> Self { ffi :: EthGetUncleCountByBlockHashInput { block_hash : other . block_hash . into () , } } } impl From < ffi :: EthGetUncleByBlockHashAndIndexResult > for super :: types :: EthGetUncleByBlockHashAndIndexResult { fn from (other : ffi :: EthGetUncleByBlockHashAndIndexResult) -> Self { super :: types :: EthGetUncleByBlockHashAndIndexResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetUncleByBlockHashAndIndexResult > for ffi :: EthGetUncleByBlockHashAndIndexResult { fn from (other : super :: types :: EthGetUncleByBlockHashAndIndexResult) -> Self { ffi :: EthGetUncleByBlockHashAndIndexResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetBlockByHashInput > for super :: types :: EthGetBlockByHashInput { fn from (other : ffi :: EthGetBlockByHashInput) -> Self { super :: types :: EthGetBlockByHashInput { hash : other . hash . into () , full_transaction : other . full_transaction . into () , } } } impl From < super :: types :: EthGetBlockByHashInput > for ffi :: EthGetBlockByHashInput { fn from (other : super :: types :: EthGetBlockByHashInput) -> Self { ffi :: EthGetBlockByHashInput { hash : other . hash . into () , full_transaction : other . full_transaction . into () , } } } impl From < ffi :: EthGetWorkResult > for super :: types :: EthGetWorkResult { fn from (other : ffi :: EthGetWorkResult) -> Self { super :: types :: EthGetWorkResult { currentblock : other . currentblock . into () , seed_hash : other . seed_hash . into () , target : other . target . into () , } } } impl From < super :: types :: EthGetWorkResult > for ffi :: EthGetWorkResult { fn from (other : super :: types :: EthGetWorkResult) -> Self { ffi :: EthGetWorkResult { currentblock : other . currentblock . into () , seed_hash : other . seed_hash . into () , target : other . target . into () , } } } impl From < ffi :: EthGetTransactionByBlockHashAndIndexInput > for super :: types :: EthGetTransactionByBlockHashAndIndexInput { fn from (other : ffi :: EthGetTransactionByBlockHashAndIndexInput) -> Self { super :: types :: EthGetTransactionByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetTransactionByBlockHashAndIndexInput > for ffi :: EthGetTransactionByBlockHashAndIndexInput { fn from (other : super :: types :: EthGetTransactionByBlockHashAndIndexInput) -> Self { ffi :: EthGetTransactionByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Accounts (client : & Box < Client >) -> Result < ffi :: EthAccountsResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthAccountsResult , _ > = c . request ("eth_accounts" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Call (client : & Box < Client > , eth_call_input : EthCallInput) -> Result < ffi :: EthCallResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_call_input = super :: types :: EthCallInput :: from (eth_call_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_call_input . transaction_info , & eth_call_input . block_number] ; let resp : Result < super :: types :: EthCallResult , _ > = c . request ("eth_call" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBalance (client : & Box < Client > , eth_get_balance_input : EthGetBalanceInput) -> Result < ffi :: EthGetBalanceResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_balance_input = super :: types :: EthGetBalanceInput :: from (eth_get_balance_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_balance_input . address , & eth_get_balance_input . block_number] ; let resp : Result < super :: types :: EthGetBalanceResult , _ > = c . request ("eth_getbalance" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByHash (client : & Box < Client > , eth_get_block_by_hash_input : EthGetBlockByHashInput) -> Result < ffi :: EthBlockInfo , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_block_by_hash_input = super :: types :: EthGetBlockByHashInput :: from (eth_get_block_by_hash_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_block_by_hash_input . hash , & eth_get_block_by_hash_input . full_transaction] ; let resp : Result < super :: types :: EthBlockInfo , _ > = c . request ("eth_getblockbyhash" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_ChainId (client : & Box < Client >) -> Result < ffi :: EthChainIdResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthChainIdResult , _ > = c . request ("eth_chainid" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallNet_Version (client : & Box < Client >) -> Result < ffi :: EthChainIdResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthChainIdResult , _ > = c . request ("net_version" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_BlockNumber (client : & Box < Client >) -> Result < ffi :: EthBlockNumberResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthBlockNumberResult , _ > = c . request ("eth_blocknumber" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByNumber (client : & Box < Client > , eth_get_block_by_number_input : EthGetBlockByNumberInput) -> Result < ffi :: EthBlockInfo , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_block_by_number_input = super :: types :: EthGetBlockByNumberInput :: from (eth_get_block_by_number_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_block_by_number_input . number , & eth_get_block_by_number_input . full_transaction] ; let resp : Result < super :: types :: EthBlockInfo , _ > = c . request ("eth_getblockbynumber" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Mining (client : & Box < Client >) -> Result < ffi :: EthMiningResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthMiningResult , _ > = c . request ("eth_mining" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) }# [derive (Clone)] pub struct EthService { # [allow (dead_code)] adapter : Arc < Handlers > } impl EthService { # [inline] # [allow (dead_code)] pub fn new (adapter : Arc < Handlers >) -> EthService { EthService { adapter } } # [inline] # [allow (dead_code)] pub fn service (& self) -> eth_server :: EthServer < EthService > { eth_server :: EthServer :: new (self . clone ()) } # [inline] # [allow (unused_mut , dead_code)] pub fn module (& self) -> Result < jsonrpsee_http_server :: RpcModule < () > , jsonrpsee_core :: Error > { let mut module = jsonrpsee_http_server :: RpcModule :: new (()) ; let adapter = self . adapter . clone () ; module . register_method ("eth_accounts" , move | _params , _ | { Self :: Eth_Accounts (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_call" , move | _params , _ | { let mut eth_call_input = super :: types :: EthCallInput :: default () ; if _params . is_object () { eth_call_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_call_input . transaction_info = seq . next () . map_err (| _ | missing_param ("transaction_info")) ? ; eth_call_input . block_number = seq . next () . map_err (| _ | missing_param ("block_number")) ? ; } let mut input = eth_call_input . into () ; Self :: Eth_Call (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getbalance" , move | _params , _ | { let mut eth_get_balance_input = super :: types :: EthGetBalanceInput :: default () ; if _params . is_object () { eth_get_balance_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_balance_input . address = seq . next () . map_err (| _ | missing_param ("address")) ? ; eth_get_balance_input . block_number = seq . next () . map_err (| _ | missing_param ("block_number")) ? ; } let mut input = eth_get_balance_input . into () ; Self :: Eth_GetBalance (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getblockbyhash" , move | _params , _ | { let mut eth_get_block_by_hash_input = super :: types :: EthGetBlockByHashInput :: default () ; if _params . is_object () { eth_get_block_by_hash_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_block_by_hash_input . hash = seq . next () . map_err (| _ | missing_param ("hash")) ? ; eth_get_block_by_hash_input . full_transaction = seq . next () . map_err (| _ | missing_param ("full_transaction")) ? ; } let mut input = eth_get_block_by_hash_input . into () ; Self :: Eth_GetBlockByHash (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_chainid" , move | _params , _ | { Self :: Eth_ChainId (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("net_version" , move | _params , _ | { Self :: Net_Version (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_blocknumber" , move | _params , _ | { Self :: Eth_BlockNumber (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getblockbynumber" , move | _params , _ | { let mut eth_get_block_by_number_input = super :: types :: EthGetBlockByNumberInput :: default () ; if _params . is_object () { eth_get_block_by_number_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_block_by_number_input . number = seq . next () . map_err (| _ | missing_param ("number")) ? ; eth_get_block_by_number_input . full_transaction = seq . next () . map_err (| _ | missing_param ("full_transaction")) ? ; } let mut input = eth_get_block_by_number_input . into () ; Self :: Eth_GetBlockByNumber (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_mining" , move | _params , _ | { Self :: Eth_Mining (adapter . clone () ,) }) ? ; Ok (module) } } # [tonic :: async_trait] impl eth_server :: Eth for EthService { async fn eth_accounts (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthAccountsResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_Accounts (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_call (& self , request : tonic :: Request < super :: types :: EthCallInput >) -> Result < tonic :: Response < super :: types :: EthCallResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_Call (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_balance (& self , request : tonic :: Request < super :: types :: EthGetBalanceInput >) -> Result < tonic :: Response < super :: types :: EthGetBalanceResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBalance (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_block_by_hash (& self , request : tonic :: Request < super :: types :: EthGetBlockByHashInput >) -> Result < tonic :: Response < super :: types :: EthBlockInfo > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBlockByHash (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } # [allow (unused_variables)] async fn eth_send_transaction (& self , request : tonic :: Request < super :: types :: EthSendTransactionInput >) -> Result < tonic :: Response < super :: types :: EthSendTransactionResult > , tonic :: Status > { unimplemented ! () ; } async fn eth_chain_id (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthChainIdResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_ChainId (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn net_version (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthChainIdResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Net_Version (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_block_number (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthBlockNumberResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_BlockNumber (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_block_by_number (& self , request : tonic :: Request < super :: types :: EthGetBlockByNumberInput >) -> Result < tonic :: Response < super :: types :: EthBlockInfo > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBlockByNumber (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_mining (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthMiningResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_Mining (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } }# [derive (Clone)] pub struct BlockchainService { # [allow (dead_code)] adapter : Arc < Handlers > } impl BlockchainService { # [inline] # [allow (dead_code)] pub fn new (adapter : Arc < Handlers >) -> BlockchainService { BlockchainService { adapter } } # [inline] # [allow (dead_code)] pub fn service (& self) -> blockchain_server :: BlockchainServer < BlockchainService > { blockchain_server :: BlockchainServer :: new (self . clone ()) } # [inline] # [allow (unused_mut , dead_code)] pub fn module (& self) -> Result < jsonrpsee_http_server :: RpcModule < () > , jsonrpsee_core :: Error > { let mut module = jsonrpsee_http_server :: RpcModule :: new (()) ; Ok (module) } } # [tonic :: async_trait] impl blockchain_server :: Blockchain for BlockchainService { # [allow (unused_variables)] async fn get_best_block_hash (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: BlockHashResult > , tonic :: Status > { unimplemented ! () ; } # [allow (unused_variables)] async fn get_block (& self , request : tonic :: Request < super :: types :: BlockInput >) -> Result < tonic :: Response < super :: types :: BlockResult > , tonic :: Status > { unimplemented ! () ; } } \ No newline at end of file +use jsonrpsee_core :: client :: ClientT ; use jsonrpsee_http_client :: { HttpClient , HttpClientBuilder } ; use std :: sync :: Arc ; use crate :: { CLIENTS } ; use ain_evm :: runtime :: RUNTIME ; use crate :: rpc :: * ; # [allow (unused_imports)] use self :: ffi :: * ; use ain_evm :: handler :: Handlers ; # [derive (Clone)] pub struct Client { inner : Arc < HttpClient > , handle : tokio :: runtime :: Handle , } # [allow (non_snake_case)] fn NewClient (addr : & str) -> Result < Box < Client > , Box < dyn std :: error :: Error >> { if CLIENTS . read () . unwrap () . get (addr) . is_none () { log :: info ! ("Initializing RPC client for {}" , addr) ; let c = Client { inner : Arc :: new (HttpClientBuilder :: default () . build (addr) ?) , handle : RUNTIME . rt_handle . clone () , } ; CLIENTS . write () . unwrap () . insert (addr . into () , c) ; } Ok (Box :: new (CLIENTS . read () . unwrap () . get (addr) . unwrap () . clone ())) } # [allow (dead_code)] fn missing_param (field : & str) -> jsonrpsee_core :: Error { jsonrpsee_core :: Error :: Call (jsonrpsee_types :: error :: CallError :: Custom (jsonrpsee_types :: ErrorObject :: borrowed (- 1 , & format ! ("Missing required parameter '{field}'") , None) . into_owned ())) } impl From < ffi :: EthCompileLllInput > for super :: types :: EthCompileLllInput { fn from (other : ffi :: EthCompileLllInput) -> Self { super :: types :: EthCompileLllInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileLllInput > for ffi :: EthCompileLllInput { fn from (other : super :: types :: EthCompileLllInput) -> Self { ffi :: EthCompileLllInput { code : other . code . into () , } } } impl From < ffi :: EthSubmitHashrateResult > for super :: types :: EthSubmitHashrateResult { fn from (other : ffi :: EthSubmitHashrateResult) -> Self { super :: types :: EthSubmitHashrateResult { is_valid : other . is_valid . into () , } } } impl From < super :: types :: EthSubmitHashrateResult > for ffi :: EthSubmitHashrateResult { fn from (other : super :: types :: EthSubmitHashrateResult) -> Self { ffi :: EthSubmitHashrateResult { is_valid : other . is_valid . into () , } } } impl From < ffi :: EthCoinBaseResult > for super :: types :: EthCoinBaseResult { fn from (other : ffi :: EthCoinBaseResult) -> Self { super :: types :: EthCoinBaseResult { address : other . address . into () , } } } impl From < super :: types :: EthCoinBaseResult > for ffi :: EthCoinBaseResult { fn from (other : super :: types :: EthCoinBaseResult) -> Self { ffi :: EthCoinBaseResult { address : other . address . into () , } } } impl From < ffi :: EthGetTransactionByBlockNumberAndIndexResult > for super :: types :: EthGetTransactionByBlockNumberAndIndexResult { fn from (other : ffi :: EthGetTransactionByBlockNumberAndIndexResult) -> Self { super :: types :: EthGetTransactionByBlockNumberAndIndexResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByBlockNumberAndIndexResult > for ffi :: EthGetTransactionByBlockNumberAndIndexResult { fn from (other : super :: types :: EthGetTransactionByBlockNumberAndIndexResult) -> Self { ffi :: EthGetTransactionByBlockNumberAndIndexResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetUncleCountByBlockHashResult > for super :: types :: EthGetUncleCountByBlockHashResult { fn from (other : ffi :: EthGetUncleCountByBlockHashResult) -> Self { super :: types :: EthGetUncleCountByBlockHashResult { number_uncles : other . number_uncles . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockHashResult > for ffi :: EthGetUncleCountByBlockHashResult { fn from (other : super :: types :: EthGetUncleCountByBlockHashResult) -> Self { ffi :: EthGetUncleCountByBlockHashResult { number_uncles : other . number_uncles . into () , } } } impl From < ffi :: EthGetBlockTransactionCountByHashInput > for super :: types :: EthGetBlockTransactionCountByHashInput { fn from (other : ffi :: EthGetBlockTransactionCountByHashInput) -> Self { super :: types :: EthGetBlockTransactionCountByHashInput { block_hash : other . block_hash . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByHashInput > for ffi :: EthGetBlockTransactionCountByHashInput { fn from (other : super :: types :: EthGetBlockTransactionCountByHashInput) -> Self { ffi :: EthGetBlockTransactionCountByHashInput { block_hash : other . block_hash . into () , } } } impl From < ffi :: NetPeerCountResult > for super :: types :: NetPeerCountResult { fn from (other : ffi :: NetPeerCountResult) -> Self { super :: types :: NetPeerCountResult { number_peer : other . number_peer . into () , } } } impl From < super :: types :: NetPeerCountResult > for ffi :: NetPeerCountResult { fn from (other : super :: types :: NetPeerCountResult) -> Self { ffi :: NetPeerCountResult { number_peer : other . number_peer . into () , } } } impl From < ffi :: EthGetUncleCountByBlockHashInput > for super :: types :: EthGetUncleCountByBlockHashInput { fn from (other : ffi :: EthGetUncleCountByBlockHashInput) -> Self { super :: types :: EthGetUncleCountByBlockHashInput { block_hash : other . block_hash . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockHashInput > for ffi :: EthGetUncleCountByBlockHashInput { fn from (other : super :: types :: EthGetUncleCountByBlockHashInput) -> Self { ffi :: EthGetUncleCountByBlockHashInput { block_hash : other . block_hash . into () , } } } impl From < ffi :: EthGetCodeInput > for super :: types :: EthGetCodeInput { fn from (other : ffi :: EthGetCodeInput) -> Self { super :: types :: EthGetCodeInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetCodeInput > for ffi :: EthGetCodeInput { fn from (other : super :: types :: EthGetCodeInput) -> Self { ffi :: EthGetCodeInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthCompileLllResult > for super :: types :: EthCompileLllResult { fn from (other : ffi :: EthCompileLllResult) -> Self { super :: types :: EthCompileLllResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileLllResult > for ffi :: EthCompileLllResult { fn from (other : super :: types :: EthCompileLllResult) -> Self { ffi :: EthCompileLllResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: Transaction > for super :: types :: Transaction { fn from (other : ffi :: Transaction) -> Self { super :: types :: Transaction { hash : other . hash . into () , raw : Some (other . raw . into ()) , } } } impl From < super :: types :: Transaction > for ffi :: Transaction { fn from (other : super :: types :: Transaction) -> Self { ffi :: Transaction { hash : other . hash . into () , raw : other . raw . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthProtocolVersionResult > for super :: types :: EthProtocolVersionResult { fn from (other : ffi :: EthProtocolVersionResult) -> Self { super :: types :: EthProtocolVersionResult { protocol_version : other . protocol_version . into () , } } } impl From < super :: types :: EthProtocolVersionResult > for ffi :: EthProtocolVersionResult { fn from (other : super :: types :: EthProtocolVersionResult) -> Self { ffi :: EthProtocolVersionResult { protocol_version : other . protocol_version . into () , } } } impl From < ffi :: NetVersionResult > for super :: types :: NetVersionResult { fn from (other : ffi :: NetVersionResult) -> Self { super :: types :: NetVersionResult { network_version : other . network_version . into () , } } } impl From < super :: types :: NetVersionResult > for ffi :: NetVersionResult { fn from (other : super :: types :: NetVersionResult) -> Self { ffi :: NetVersionResult { network_version : other . network_version . into () , } } } impl From < ffi :: EthSubmitWorkInput > for super :: types :: EthSubmitWorkInput { fn from (other : ffi :: EthSubmitWorkInput) -> Self { super :: types :: EthSubmitWorkInput { nounce : other . nounce . into () , pow_hash : other . pow_hash . into () , mix_digest : other . mix_digest . into () , } } } impl From < super :: types :: EthSubmitWorkInput > for ffi :: EthSubmitWorkInput { fn from (other : super :: types :: EthSubmitWorkInput) -> Self { ffi :: EthSubmitWorkInput { nounce : other . nounce . into () , pow_hash : other . pow_hash . into () , mix_digest : other . mix_digest . into () , } } } impl From < ffi :: EthEstimateGasResult > for super :: types :: EthEstimateGasResult { fn from (other : ffi :: EthEstimateGasResult) -> Self { super :: types :: EthEstimateGasResult { gas_used : other . gas_used . into () , } } } impl From < super :: types :: EthEstimateGasResult > for ffi :: EthEstimateGasResult { fn from (other : super :: types :: EthEstimateGasResult) -> Self { ffi :: EthEstimateGasResult { gas_used : other . gas_used . into () , } } } impl From < ffi :: EthSendRawTransactionInput > for super :: types :: EthSendRawTransactionInput { fn from (other : ffi :: EthSendRawTransactionInput) -> Self { super :: types :: EthSendRawTransactionInput { transaction : other . transaction . into () , } } } impl From < super :: types :: EthSendRawTransactionInput > for ffi :: EthSendRawTransactionInput { fn from (other : super :: types :: EthSendRawTransactionInput) -> Self { ffi :: EthSendRawTransactionInput { transaction : other . transaction . into () , } } } impl From < ffi :: EthCallResult > for super :: types :: EthCallResult { fn from (other : ffi :: EthCallResult) -> Self { super :: types :: EthCallResult { data : other . data . into () , } } } impl From < super :: types :: EthCallResult > for ffi :: EthCallResult { fn from (other : super :: types :: EthCallResult) -> Self { ffi :: EthCallResult { data : other . data . into () , } } } impl From < ffi :: EthGetTransactionByBlockNumberAndIndexInput > for super :: types :: EthGetTransactionByBlockNumberAndIndexInput { fn from (other : ffi :: EthGetTransactionByBlockNumberAndIndexInput) -> Self { super :: types :: EthGetTransactionByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetTransactionByBlockNumberAndIndexInput > for ffi :: EthGetTransactionByBlockNumberAndIndexInput { fn from (other : super :: types :: EthGetTransactionByBlockNumberAndIndexInput) -> Self { ffi :: EthGetTransactionByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < ffi :: NonUtxo > for super :: types :: NonUtxo { fn from (other : ffi :: NonUtxo) -> Self { super :: types :: NonUtxo { anchor_reward : other . anchor_reward . into () , burnt : other . burnt . into () , incentive_funding : other . incentive_funding . into () , loan : other . loan . into () , options : other . options . into () , unknown : other . unknown . into () , } } } impl From < super :: types :: NonUtxo > for ffi :: NonUtxo { fn from (other : super :: types :: NonUtxo) -> Self { ffi :: NonUtxo { anchor_reward : other . anchor_reward . into () , burnt : other . burnt . into () , incentive_funding : other . incentive_funding . into () , loan : other . loan . into () , options : other . options . into () , unknown : other . unknown . into () , } } } impl From < ffi :: Vout > for super :: types :: Vout { fn from (other : ffi :: Vout) -> Self { super :: types :: Vout { value : other . value . into () , n : other . n . into () , script_pub_key : Some (other . script_pub_key . into ()) , token_id : other . token_id . into () , } } } impl From < super :: types :: Vout > for ffi :: Vout { fn from (other : super :: types :: Vout) -> Self { ffi :: Vout { value : other . value . into () , n : other . n . into () , script_pub_key : other . script_pub_key . map (Into :: into) . unwrap_or_default () , token_id : other . token_id . into () , } } } impl From < ffi :: EthSubmitHashrateInput > for super :: types :: EthSubmitHashrateInput { fn from (other : ffi :: EthSubmitHashrateInput) -> Self { super :: types :: EthSubmitHashrateInput { hash_rate : other . hash_rate . into () , id : other . id . into () , } } } impl From < super :: types :: EthSubmitHashrateInput > for ffi :: EthSubmitHashrateInput { fn from (other : super :: types :: EthSubmitHashrateInput) -> Self { ffi :: EthSubmitHashrateInput { hash_rate : other . hash_rate . into () , id : other . id . into () , } } } impl From < ffi :: EthTransactionReceipt > for super :: types :: EthTransactionReceipt { fn from (other : ffi :: EthTransactionReceipt) -> Self { super :: types :: EthTransactionReceipt { transaction_hash : other . transaction_hash . into () , transaction_index : other . transaction_index . into () , block_hash : other . block_hash . into () , block_number : other . block_number . into () , from : other . from . into () , to : other . to . into () , cumulative_gas_used : other . cumulative_gas_used . into () , effective_gas_price : other . effective_gas_price . into () , gas_used : other . gas_used . into () , contract_address : other . contract_address . into () , logs : other . logs . into_iter () . map (Into :: into) . collect () , logs_bloom : other . logs_bloom . into () , field_type : other . field_type . into () , root : Some (other . root . into ()) , status : Some (other . status . into ()) , } } } impl From < super :: types :: EthTransactionReceipt > for ffi :: EthTransactionReceipt { fn from (other : super :: types :: EthTransactionReceipt) -> Self { ffi :: EthTransactionReceipt { transaction_hash : other . transaction_hash . into () , transaction_index : other . transaction_index . into () , block_hash : other . block_hash . into () , block_number : other . block_number . into () , from : other . from . into () , to : other . to . into () , cumulative_gas_used : other . cumulative_gas_used . into () , effective_gas_price : other . effective_gas_price . into () , gas_used : other . gas_used . into () , contract_address : other . contract_address . into () , logs : other . logs . into_iter () . map (Into :: into) . collect () , logs_bloom : other . logs_bloom . into () , field_type : other . field_type . into () , root : other . root . map (Into :: into) . unwrap_or_default () , status : other . status . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: RawTransaction > for super :: types :: RawTransaction { fn from (other : ffi :: RawTransaction) -> Self { super :: types :: RawTransaction { in_active_chain : other . in_active_chain . into () , hex : other . hex . into () , txid : other . txid . into () , hash : other . hash . into () , size : other . size . into () , vsize : other . vsize . into () , weight : other . weight . into () , version : other . version . into () , locktime : other . locktime . into () , vin : other . vin . into_iter () . map (Into :: into) . collect () , vout : other . vout . into_iter () . map (Into :: into) . collect () , blockhash : other . blockhash . into () , confirmations : other . confirmations . into () , blocktime : other . blocktime . into () , } } } impl From < super :: types :: RawTransaction > for ffi :: RawTransaction { fn from (other : super :: types :: RawTransaction) -> Self { ffi :: RawTransaction { in_active_chain : other . in_active_chain . into () , hex : other . hex . into () , txid : other . txid . into () , hash : other . hash . into () , size : other . size . into () , vsize : other . vsize . into () , weight : other . weight . into () , version : other . version . into () , locktime : other . locktime . into () , vin : other . vin . into_iter () . map (Into :: into) . collect () , vout : other . vout . into_iter () . map (Into :: into) . collect () , blockhash : other . blockhash . into () , confirmations : other . confirmations . into () , blocktime : other . blocktime . into () , } } } impl From < ffi :: EthGetBalanceInput > for super :: types :: EthGetBalanceInput { fn from (other : ffi :: EthGetBalanceInput) -> Self { super :: types :: EthGetBalanceInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetBalanceInput > for ffi :: EthGetBalanceInput { fn from (other : super :: types :: EthGetBalanceInput) -> Self { ffi :: EthGetBalanceInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthGetBlockTransactionCountByNumberInput > for super :: types :: EthGetBlockTransactionCountByNumberInput { fn from (other : ffi :: EthGetBlockTransactionCountByNumberInput) -> Self { super :: types :: EthGetBlockTransactionCountByNumberInput { block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByNumberInput > for ffi :: EthGetBlockTransactionCountByNumberInput { fn from (other : super :: types :: EthGetBlockTransactionCountByNumberInput) -> Self { ffi :: EthGetBlockTransactionCountByNumberInput { block_number : other . block_number . into () , } } } impl From < ffi :: Web3Sha3Input > for super :: types :: Web3Sha3Input { fn from (other : ffi :: Web3Sha3Input) -> Self { super :: types :: Web3Sha3Input { data : other . data . into () , } } } impl From < super :: types :: Web3Sha3Input > for ffi :: Web3Sha3Input { fn from (other : super :: types :: Web3Sha3Input) -> Self { ffi :: Web3Sha3Input { data : other . data . into () , } } } impl From < ffi :: EthGetStorageAtResult > for super :: types :: EthGetStorageAtResult { fn from (other : ffi :: EthGetStorageAtResult) -> Self { super :: types :: EthGetStorageAtResult { value : other . value . into () , } } } impl From < super :: types :: EthGetStorageAtResult > for ffi :: EthGetStorageAtResult { fn from (other : super :: types :: EthGetStorageAtResult) -> Self { ffi :: EthGetStorageAtResult { value : other . value . into () , } } } impl From < ffi :: EthGetUncleByBlockNumberAndIndexInput > for super :: types :: EthGetUncleByBlockNumberAndIndexInput { fn from (other : ffi :: EthGetUncleByBlockNumberAndIndexInput) -> Self { super :: types :: EthGetUncleByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetUncleByBlockNumberAndIndexInput > for ffi :: EthGetUncleByBlockNumberAndIndexInput { fn from (other : super :: types :: EthGetUncleByBlockNumberAndIndexInput) -> Self { ffi :: EthGetUncleByBlockNumberAndIndexInput { block_number : other . block_number . into () , index : other . index . into () , } } } impl From < ffi :: EthAccountsResult > for super :: types :: EthAccountsResult { fn from (other : ffi :: EthAccountsResult) -> Self { super :: types :: EthAccountsResult { accounts : other . accounts . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthAccountsResult > for ffi :: EthAccountsResult { fn from (other : super :: types :: EthAccountsResult) -> Self { ffi :: EthAccountsResult { accounts : other . accounts . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetUncleCountByBlockNumberInput > for super :: types :: EthGetUncleCountByBlockNumberInput { fn from (other : ffi :: EthGetUncleCountByBlockNumberInput) -> Self { super :: types :: EthGetUncleCountByBlockNumberInput { block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockNumberInput > for ffi :: EthGetUncleCountByBlockNumberInput { fn from (other : super :: types :: EthGetUncleCountByBlockNumberInput) -> Self { ffi :: EthGetUncleCountByBlockNumberInput { block_number : other . block_number . into () , } } } impl From < ffi :: EthSendTransactionResult > for super :: types :: EthSendTransactionResult { fn from (other : ffi :: EthSendTransactionResult) -> Self { super :: types :: EthSendTransactionResult { hash : other . hash . into () , } } } impl From < super :: types :: EthSendTransactionResult > for ffi :: EthSendTransactionResult { fn from (other : super :: types :: EthSendTransactionResult) -> Self { ffi :: EthSendTransactionResult { hash : other . hash . into () , } } } impl From < ffi :: EthGetTransactionByHashInput > for super :: types :: EthGetTransactionByHashInput { fn from (other : ffi :: EthGetTransactionByHashInput) -> Self { super :: types :: EthGetTransactionByHashInput { hash : other . hash . into () , } } } impl From < super :: types :: EthGetTransactionByHashInput > for ffi :: EthGetTransactionByHashInput { fn from (other : super :: types :: EthGetTransactionByHashInput) -> Self { ffi :: EthGetTransactionByHashInput { hash : other . hash . into () , } } } impl From < ffi :: EthGetTransactionReceiptInput > for super :: types :: EthGetTransactionReceiptInput { fn from (other : ffi :: EthGetTransactionReceiptInput) -> Self { super :: types :: EthGetTransactionReceiptInput { transaction_hash : other . transaction_hash . into () , } } } impl From < super :: types :: EthGetTransactionReceiptInput > for ffi :: EthGetTransactionReceiptInput { fn from (other : super :: types :: EthGetTransactionReceiptInput) -> Self { ffi :: EthGetTransactionReceiptInput { transaction_hash : other . transaction_hash . into () , } } } impl From < ffi :: EthSignTransactionInput > for super :: types :: EthSignTransactionInput { fn from (other : ffi :: EthSignTransactionInput) -> Self { super :: types :: EthSignTransactionInput { transaction_info : Some (other . transaction_info . into ()) , } } } impl From < super :: types :: EthSignTransactionInput > for ffi :: EthSignTransactionInput { fn from (other : super :: types :: EthSignTransactionInput) -> Self { ffi :: EthSignTransactionInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGasPriceResult > for super :: types :: EthGasPriceResult { fn from (other : ffi :: EthGasPriceResult) -> Self { super :: types :: EthGasPriceResult { gas_price : other . gas_price . into () , } } } impl From < super :: types :: EthGasPriceResult > for ffi :: EthGasPriceResult { fn from (other : super :: types :: EthGasPriceResult) -> Self { ffi :: EthGasPriceResult { gas_price : other . gas_price . into () , } } } impl From < ffi :: EthChainIdResult > for super :: types :: EthChainIdResult { fn from (other : ffi :: EthChainIdResult) -> Self { super :: types :: EthChainIdResult { id : other . id . into () , } } } impl From < super :: types :: EthChainIdResult > for ffi :: EthChainIdResult { fn from (other : super :: types :: EthChainIdResult) -> Self { ffi :: EthChainIdResult { id : other . id . into () , } } } impl From < ffi :: EthGetTransactionCountResult > for super :: types :: EthGetTransactionCountResult { fn from (other : ffi :: EthGetTransactionCountResult) -> Self { super :: types :: EthGetTransactionCountResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetTransactionCountResult > for ffi :: EthGetTransactionCountResult { fn from (other : super :: types :: EthGetTransactionCountResult) -> Self { ffi :: EthGetTransactionCountResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: EthBlockNumberResult > for super :: types :: EthBlockNumberResult { fn from (other : ffi :: EthBlockNumberResult) -> Self { super :: types :: EthBlockNumberResult { block_number : other . block_number . into () , } } } impl From < super :: types :: EthBlockNumberResult > for ffi :: EthBlockNumberResult { fn from (other : super :: types :: EthBlockNumberResult) -> Self { ffi :: EthBlockNumberResult { block_number : other . block_number . into () , } } } impl From < ffi :: EthGetUncleByBlockNumberAndIndexResult > for super :: types :: EthGetUncleByBlockNumberAndIndexResult { fn from (other : ffi :: EthGetUncleByBlockNumberAndIndexResult) -> Self { super :: types :: EthGetUncleByBlockNumberAndIndexResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetUncleByBlockNumberAndIndexResult > for ffi :: EthGetUncleByBlockNumberAndIndexResult { fn from (other : super :: types :: EthGetUncleByBlockNumberAndIndexResult) -> Self { ffi :: EthGetUncleByBlockNumberAndIndexResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthCompileSolidityInput > for super :: types :: EthCompileSolidityInput { fn from (other : ffi :: EthCompileSolidityInput) -> Self { super :: types :: EthCompileSolidityInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileSolidityInput > for ffi :: EthCompileSolidityInput { fn from (other : super :: types :: EthCompileSolidityInput) -> Self { ffi :: EthCompileSolidityInput { code : other . code . into () , } } } impl From < ffi :: EthGetWorkResult > for super :: types :: EthGetWorkResult { fn from (other : ffi :: EthGetWorkResult) -> Self { super :: types :: EthGetWorkResult { currentblock : other . currentblock . into () , seed_hash : other . seed_hash . into () , target : other . target . into () , } } } impl From < super :: types :: EthGetWorkResult > for ffi :: EthGetWorkResult { fn from (other : super :: types :: EthGetWorkResult) -> Self { ffi :: EthGetWorkResult { currentblock : other . currentblock . into () , seed_hash : other . seed_hash . into () , target : other . target . into () , } } } impl From < ffi :: EthGetBlockTransactionCountByHashResult > for super :: types :: EthGetBlockTransactionCountByHashResult { fn from (other : ffi :: EthGetBlockTransactionCountByHashResult) -> Self { super :: types :: EthGetBlockTransactionCountByHashResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByHashResult > for ffi :: EthGetBlockTransactionCountByHashResult { fn from (other : super :: types :: EthGetBlockTransactionCountByHashResult) -> Self { ffi :: EthGetBlockTransactionCountByHashResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: Block > for super :: types :: Block { fn from (other : ffi :: Block) -> Self { super :: types :: Block { hash : other . hash . into () , confirmations : other . confirmations . into () , size : other . size . into () , strippedsize : other . strippedsize . into () , weight : other . weight . into () , height : other . height . into () , version : other . version . into () , version_hex : other . version_hex . into () , merkleroot : other . merkleroot . into () , tx : other . tx . into_iter () . map (Into :: into) . collect () , time : other . time . into () , mediantime : other . mediantime . into () , nonce : other . nonce . into () , bits : other . bits . into () , difficulty : other . difficulty . into () , chainwork : other . chainwork . into () , n_tx : other . n_tx . into () , previous_block_hash : other . previous_block_hash . into () , next_block_hash : other . next_block_hash . into () , masternode : other . masternode . into () , minter : other . minter . into () , minted_blocks : other . minted_blocks . into () , stake_modifier : other . stake_modifier . into () , nonutxo : other . nonutxo . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: Block > for ffi :: Block { fn from (other : super :: types :: Block) -> Self { ffi :: Block { hash : other . hash . into () , confirmations : other . confirmations . into () , size : other . size . into () , strippedsize : other . strippedsize . into () , weight : other . weight . into () , height : other . height . into () , version : other . version . into () , version_hex : other . version_hex . into () , merkleroot : other . merkleroot . into () , tx : other . tx . into_iter () . map (Into :: into) . collect () , time : other . time . into () , mediantime : other . mediantime . into () , nonce : other . nonce . into () , bits : other . bits . into () , difficulty : other . difficulty . into () , chainwork : other . chainwork . into () , n_tx : other . n_tx . into () , previous_block_hash : other . previous_block_hash . into () , next_block_hash : other . next_block_hash . into () , masternode : other . masternode . into () , minter : other . minter . into () , minted_blocks : other . minted_blocks . into () , stake_modifier : other . stake_modifier . into () , nonutxo : other . nonutxo . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthEstimateGasInput > for super :: types :: EthEstimateGasInput { fn from (other : ffi :: EthEstimateGasInput) -> Self { super :: types :: EthEstimateGasInput { transaction_info : Some (other . transaction_info . into ()) , block_number : Some (other . block_number . into ()) , } } } impl From < super :: types :: EthEstimateGasInput > for ffi :: EthEstimateGasInput { fn from (other : super :: types :: EthEstimateGasInput) -> Self { ffi :: EthEstimateGasInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , block_number : other . block_number . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetTransactionByBlockHashAndIndexResult > for super :: types :: EthGetTransactionByBlockHashAndIndexResult { fn from (other : ffi :: EthGetTransactionByBlockHashAndIndexResult) -> Self { super :: types :: EthGetTransactionByBlockHashAndIndexResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByBlockHashAndIndexResult > for ffi :: EthGetTransactionByBlockHashAndIndexResult { fn from (other : super :: types :: EthGetTransactionByBlockHashAndIndexResult) -> Self { ffi :: EthGetTransactionByBlockHashAndIndexResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthSignInput > for super :: types :: EthSignInput { fn from (other : ffi :: EthSignInput) -> Self { super :: types :: EthSignInput { address : other . address . into () , message : other . message . into () , } } } impl From < super :: types :: EthSignInput > for ffi :: EthSignInput { fn from (other : super :: types :: EthSignInput) -> Self { ffi :: EthSignInput { address : other . address . into () , message : other . message . into () , } } } impl From < ffi :: EthGetUncleByBlockHashAndIndexResult > for super :: types :: EthGetUncleByBlockHashAndIndexResult { fn from (other : ffi :: EthGetUncleByBlockHashAndIndexResult) -> Self { super :: types :: EthGetUncleByBlockHashAndIndexResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetUncleByBlockHashAndIndexResult > for ffi :: EthGetUncleByBlockHashAndIndexResult { fn from (other : super :: types :: EthGetUncleByBlockHashAndIndexResult) -> Self { ffi :: EthGetUncleByBlockHashAndIndexResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthCompileSerpentInput > for super :: types :: EthCompileSerpentInput { fn from (other : ffi :: EthCompileSerpentInput) -> Self { super :: types :: EthCompileSerpentInput { code : other . code . into () , } } } impl From < super :: types :: EthCompileSerpentInput > for ffi :: EthCompileSerpentInput { fn from (other : super :: types :: EthCompileSerpentInput) -> Self { ffi :: EthCompileSerpentInput { code : other . code . into () , } } } impl From < ffi :: EthMiningResult > for super :: types :: EthMiningResult { fn from (other : ffi :: EthMiningResult) -> Self { super :: types :: EthMiningResult { is_mining : other . is_mining . into () , } } } impl From < super :: types :: EthMiningResult > for ffi :: EthMiningResult { fn from (other : super :: types :: EthMiningResult) -> Self { ffi :: EthMiningResult { is_mining : other . is_mining . into () , } } } impl From < ffi :: EthSyncingResult > for super :: types :: EthSyncingResult { fn from (other : ffi :: EthSyncingResult) -> Self { super :: types :: EthSyncingResult { status : Some (other . status . into ()) , sync_info : Some (other . sync_info . into ()) , } } } impl From < super :: types :: EthSyncingResult > for ffi :: EthSyncingResult { fn from (other : super :: types :: EthSyncingResult) -> Self { ffi :: EthSyncingResult { status : other . status . map (Into :: into) . unwrap_or_default () , sync_info : other . sync_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: BlockInput > for super :: types :: BlockInput { fn from (other : ffi :: BlockInput) -> Self { super :: types :: BlockInput { blockhash : other . blockhash . into () , verbosity : other . verbosity . into () , } } } impl From < super :: types :: BlockInput > for ffi :: BlockInput { fn from (other : super :: types :: BlockInput) -> Self { ffi :: BlockInput { blockhash : other . blockhash . into () , verbosity : other . verbosity . into () , } } } impl From < ffi :: EthGetCodeResult > for super :: types :: EthGetCodeResult { fn from (other : ffi :: EthGetCodeResult) -> Self { super :: types :: EthGetCodeResult { code : other . code . into () , } } } impl From < super :: types :: EthGetCodeResult > for ffi :: EthGetCodeResult { fn from (other : super :: types :: EthGetCodeResult) -> Self { ffi :: EthGetCodeResult { code : other . code . into () , } } } impl From < ffi :: EthCompileSerpentResult > for super :: types :: EthCompileSerpentResult { fn from (other : ffi :: EthCompileSerpentResult) -> Self { super :: types :: EthCompileSerpentResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileSerpentResult > for ffi :: EthCompileSerpentResult { fn from (other : super :: types :: EthCompileSerpentResult) -> Self { ffi :: EthCompileSerpentResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: EthGetTransactionCountInput > for super :: types :: EthGetTransactionCountInput { fn from (other : ffi :: EthGetTransactionCountInput) -> Self { super :: types :: EthGetTransactionCountInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetTransactionCountInput > for ffi :: EthGetTransactionCountInput { fn from (other : super :: types :: EthGetTransactionCountInput) -> Self { ffi :: EthGetTransactionCountInput { address : other . address . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthHashRateResult > for super :: types :: EthHashRateResult { fn from (other : ffi :: EthHashRateResult) -> Self { super :: types :: EthHashRateResult { hash_rate : other . hash_rate . into () , } } } impl From < super :: types :: EthHashRateResult > for ffi :: EthHashRateResult { fn from (other : super :: types :: EthHashRateResult) -> Self { ffi :: EthHashRateResult { hash_rate : other . hash_rate . into () , } } } impl From < ffi :: EthGetBlockTransactionCountByNumberResult > for super :: types :: EthGetBlockTransactionCountByNumberResult { fn from (other : ffi :: EthGetBlockTransactionCountByNumberResult) -> Self { super :: types :: EthGetBlockTransactionCountByNumberResult { number_transaction : other . number_transaction . into () , } } } impl From < super :: types :: EthGetBlockTransactionCountByNumberResult > for ffi :: EthGetBlockTransactionCountByNumberResult { fn from (other : super :: types :: EthGetBlockTransactionCountByNumberResult) -> Self { ffi :: EthGetBlockTransactionCountByNumberResult { number_transaction : other . number_transaction . into () , } } } impl From < ffi :: EthGetTransactionByHashResult > for super :: types :: EthGetTransactionByHashResult { fn from (other : ffi :: EthGetTransactionByHashResult) -> Self { super :: types :: EthGetTransactionByHashResult { transaction : Some (other . transaction . into ()) , } } } impl From < super :: types :: EthGetTransactionByHashResult > for ffi :: EthGetTransactionByHashResult { fn from (other : super :: types :: EthGetTransactionByHashResult) -> Self { ffi :: EthGetTransactionByHashResult { transaction : other . transaction . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthCompileSolidityResult > for super :: types :: EthCompileSolidityResult { fn from (other : ffi :: EthCompileSolidityResult) -> Self { super :: types :: EthCompileSolidityResult { compiled_code : other . compiled_code . into () , } } } impl From < super :: types :: EthCompileSolidityResult > for ffi :: EthCompileSolidityResult { fn from (other : super :: types :: EthCompileSolidityResult) -> Self { ffi :: EthCompileSolidityResult { compiled_code : other . compiled_code . into () , } } } impl From < ffi :: Web3Sha3Result > for super :: types :: Web3Sha3Result { fn from (other : ffi :: Web3Sha3Result) -> Self { super :: types :: Web3Sha3Result { data : other . data . into () , } } } impl From < super :: types :: Web3Sha3Result > for ffi :: Web3Sha3Result { fn from (other : super :: types :: Web3Sha3Result) -> Self { ffi :: Web3Sha3Result { data : other . data . into () , } } } impl From < ffi :: EthSubmitWorkResult > for super :: types :: EthSubmitWorkResult { fn from (other : ffi :: EthSubmitWorkResult) -> Self { super :: types :: EthSubmitWorkResult { is_valid : other . is_valid . into () , } } } impl From < super :: types :: EthSubmitWorkResult > for ffi :: EthSubmitWorkResult { fn from (other : super :: types :: EthSubmitWorkResult) -> Self { ffi :: EthSubmitWorkResult { is_valid : other . is_valid . into () , } } } impl From < ffi :: EthSendRawTransactionResult > for super :: types :: EthSendRawTransactionResult { fn from (other : ffi :: EthSendRawTransactionResult) -> Self { super :: types :: EthSendRawTransactionResult { hash : other . hash . into () , } } } impl From < super :: types :: EthSendRawTransactionResult > for ffi :: EthSendRawTransactionResult { fn from (other : super :: types :: EthSendRawTransactionResult) -> Self { ffi :: EthSendRawTransactionResult { hash : other . hash . into () , } } } impl From < ffi :: EthSendTransactionInput > for super :: types :: EthSendTransactionInput { fn from (other : ffi :: EthSendTransactionInput) -> Self { super :: types :: EthSendTransactionInput { transaction_info : Some (other . transaction_info . into ()) , } } } impl From < super :: types :: EthSendTransactionInput > for ffi :: EthSendTransactionInput { fn from (other : super :: types :: EthSendTransactionInput) -> Self { ffi :: EthSendTransactionInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetBlockByHashInput > for super :: types :: EthGetBlockByHashInput { fn from (other : ffi :: EthGetBlockByHashInput) -> Self { super :: types :: EthGetBlockByHashInput { hash : other . hash . into () , full_transaction : other . full_transaction . into () , } } } impl From < super :: types :: EthGetBlockByHashInput > for ffi :: EthGetBlockByHashInput { fn from (other : super :: types :: EthGetBlockByHashInput) -> Self { ffi :: EthGetBlockByHashInput { hash : other . hash . into () , full_transaction : other . full_transaction . into () , } } } impl From < ffi :: BlockHashResult > for super :: types :: BlockHashResult { fn from (other : ffi :: BlockHashResult) -> Self { super :: types :: BlockHashResult { hash : other . hash . into () , } } } impl From < super :: types :: BlockHashResult > for ffi :: BlockHashResult { fn from (other : super :: types :: BlockHashResult) -> Self { ffi :: BlockHashResult { hash : other . hash . into () , } } } impl From < ffi :: EthGetUncleCountByBlockNumberResult > for super :: types :: EthGetUncleCountByBlockNumberResult { fn from (other : ffi :: EthGetUncleCountByBlockNumberResult) -> Self { super :: types :: EthGetUncleCountByBlockNumberResult { number_uncles : other . number_uncles . into () , } } } impl From < super :: types :: EthGetUncleCountByBlockNumberResult > for ffi :: EthGetUncleCountByBlockNumberResult { fn from (other : super :: types :: EthGetUncleCountByBlockNumberResult) -> Self { ffi :: EthGetUncleCountByBlockNumberResult { number_uncles : other . number_uncles . into () , } } } impl From < ffi :: EthGetTransactionByBlockHashAndIndexInput > for super :: types :: EthGetTransactionByBlockHashAndIndexInput { fn from (other : ffi :: EthGetTransactionByBlockHashAndIndexInput) -> Self { super :: types :: EthGetTransactionByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetTransactionByBlockHashAndIndexInput > for ffi :: EthGetTransactionByBlockHashAndIndexInput { fn from (other : super :: types :: EthGetTransactionByBlockHashAndIndexInput) -> Self { ffi :: EthGetTransactionByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < ffi :: EthGetBlockByHashResult > for super :: types :: EthGetBlockByHashResult { fn from (other : ffi :: EthGetBlockByHashResult) -> Self { super :: types :: EthGetBlockByHashResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetBlockByHashResult > for ffi :: EthGetBlockByHashResult { fn from (other : super :: types :: EthGetBlockByHashResult) -> Self { ffi :: EthGetBlockByHashResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: PubKey > for super :: types :: PubKey { fn from (other : ffi :: PubKey) -> Self { super :: types :: PubKey { field_asm : other . field_asm . into () , hex : other . hex . into () , field_type : other . field_type . into () , req_sigs : other . req_sigs . into () , addresses : other . addresses . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: PubKey > for ffi :: PubKey { fn from (other : super :: types :: PubKey) -> Self { ffi :: PubKey { field_asm : other . field_asm . into () , hex : other . hex . into () , field_type : other . field_type . into () , req_sigs : other . req_sigs . into () , addresses : other . addresses . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthSignResult > for super :: types :: EthSignResult { fn from (other : ffi :: EthSignResult) -> Self { super :: types :: EthSignResult { signature : other . signature . into () , } } } impl From < super :: types :: EthSignResult > for ffi :: EthSignResult { fn from (other : super :: types :: EthSignResult) -> Self { ffi :: EthSignResult { signature : other . signature . into () , } } } impl From < ffi :: EthGetBlockByNumberInput > for super :: types :: EthGetBlockByNumberInput { fn from (other : ffi :: EthGetBlockByNumberInput) -> Self { super :: types :: EthGetBlockByNumberInput { number : other . number . into () , full_transaction : other . full_transaction . into () , } } } impl From < super :: types :: EthGetBlockByNumberInput > for ffi :: EthGetBlockByNumberInput { fn from (other : super :: types :: EthGetBlockByNumberInput) -> Self { ffi :: EthGetBlockByNumberInput { number : other . number . into () , full_transaction : other . full_transaction . into () , } } } impl From < ffi :: BlockResult > for super :: types :: BlockResult { fn from (other : ffi :: BlockResult) -> Self { super :: types :: BlockResult { hash : other . hash . into () , block : Some (other . block . into ()) , } } } impl From < super :: types :: BlockResult > for ffi :: BlockResult { fn from (other : super :: types :: BlockResult) -> Self { ffi :: BlockResult { hash : other . hash . into () , block : other . block . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: ScriptSig > for super :: types :: ScriptSig { fn from (other : ffi :: ScriptSig) -> Self { super :: types :: ScriptSig { field_asm : other . field_asm . into () , hex : other . hex . into () , } } } impl From < super :: types :: ScriptSig > for ffi :: ScriptSig { fn from (other : super :: types :: ScriptSig) -> Self { ffi :: ScriptSig { field_asm : other . field_asm . into () , hex : other . hex . into () , } } } impl From < ffi :: EthGetBlockByNumberResult > for super :: types :: EthGetBlockByNumberResult { fn from (other : ffi :: EthGetBlockByNumberResult) -> Self { super :: types :: EthGetBlockByNumberResult { block_info : Some (other . block_info . into ()) , } } } impl From < super :: types :: EthGetBlockByNumberResult > for ffi :: EthGetBlockByNumberResult { fn from (other : super :: types :: EthGetBlockByNumberResult) -> Self { ffi :: EthGetBlockByNumberResult { block_info : other . block_info . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: Web3ClientVersionResult > for super :: types :: Web3ClientVersionResult { fn from (other : ffi :: Web3ClientVersionResult) -> Self { super :: types :: Web3ClientVersionResult { client_version : other . client_version . into () , } } } impl From < super :: types :: Web3ClientVersionResult > for ffi :: Web3ClientVersionResult { fn from (other : super :: types :: Web3ClientVersionResult) -> Self { ffi :: Web3ClientVersionResult { client_version : other . client_version . into () , } } } impl From < ffi :: EthTransactionInfo > for super :: types :: EthTransactionInfo { fn from (other : ffi :: EthTransactionInfo) -> Self { super :: types :: EthTransactionInfo { from : Some (other . from . into ()) , to : Some (other . to . into ()) , gas : Some (other . gas . into ()) , price : Some (other . price . into ()) , value : Some (other . value . into ()) , data : Some (other . data . into ()) , nonce : Some (other . nonce . into ()) , } } } impl From < super :: types :: EthTransactionInfo > for ffi :: EthTransactionInfo { fn from (other : super :: types :: EthTransactionInfo) -> Self { ffi :: EthTransactionInfo { from : other . from . map (Into :: into) . unwrap_or_default () , to : other . to . map (Into :: into) . unwrap_or_default () , gas : other . gas . map (Into :: into) . unwrap_or_default () , price : other . price . map (Into :: into) . unwrap_or_default () , value : other . value . map (Into :: into) . unwrap_or_default () , data : other . data . map (Into :: into) . unwrap_or_default () , nonce : other . nonce . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthGetStorageAtInput > for super :: types :: EthGetStorageAtInput { fn from (other : ffi :: EthGetStorageAtInput) -> Self { super :: types :: EthGetStorageAtInput { address : other . address . into () , position : other . position . into () , block_number : other . block_number . into () , } } } impl From < super :: types :: EthGetStorageAtInput > for ffi :: EthGetStorageAtInput { fn from (other : super :: types :: EthGetStorageAtInput) -> Self { ffi :: EthGetStorageAtInput { address : other . address . into () , position : other . position . into () , block_number : other . block_number . into () , } } } impl From < ffi :: EthSyncingInfo > for super :: types :: EthSyncingInfo { fn from (other : ffi :: EthSyncingInfo) -> Self { super :: types :: EthSyncingInfo { starting_block : other . starting_block . into () , current_block : other . current_block . into () , highest_block : other . highest_block . into () , } } } impl From < super :: types :: EthSyncingInfo > for ffi :: EthSyncingInfo { fn from (other : super :: types :: EthSyncingInfo) -> Self { ffi :: EthSyncingInfo { starting_block : other . starting_block . into () , current_block : other . current_block . into () , highest_block : other . highest_block . into () , } } } impl From < ffi :: EthSignTransactionResult > for super :: types :: EthSignTransactionResult { fn from (other : ffi :: EthSignTransactionResult) -> Self { super :: types :: EthSignTransactionResult { transaction : other . transaction . into () , } } } impl From < super :: types :: EthSignTransactionResult > for ffi :: EthSignTransactionResult { fn from (other : super :: types :: EthSignTransactionResult) -> Self { ffi :: EthSignTransactionResult { transaction : other . transaction . into () , } } } impl From < ffi :: EthGetUncleByBlockHashAndIndexInput > for super :: types :: EthGetUncleByBlockHashAndIndexInput { fn from (other : ffi :: EthGetUncleByBlockHashAndIndexInput) -> Self { super :: types :: EthGetUncleByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < super :: types :: EthGetUncleByBlockHashAndIndexInput > for ffi :: EthGetUncleByBlockHashAndIndexInput { fn from (other : super :: types :: EthGetUncleByBlockHashAndIndexInput) -> Self { ffi :: EthGetUncleByBlockHashAndIndexInput { block_hash : other . block_hash . into () , index : other . index . into () , } } } impl From < ffi :: EthGetCompilersResult > for super :: types :: EthGetCompilersResult { fn from (other : ffi :: EthGetCompilersResult) -> Self { super :: types :: EthGetCompilersResult { compilers : other . compilers . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthGetCompilersResult > for ffi :: EthGetCompilersResult { fn from (other : super :: types :: EthGetCompilersResult) -> Self { ffi :: EthGetCompilersResult { compilers : other . compilers . into_iter () . map (Into :: into) . collect () , } } } impl From < ffi :: EthGetTransactionReceiptResult > for super :: types :: EthGetTransactionReceiptResult { fn from (other : ffi :: EthGetTransactionReceiptResult) -> Self { super :: types :: EthGetTransactionReceiptResult { transaction_receipt : Some (other . transaction_receipt . into ()) , } } } impl From < super :: types :: EthGetTransactionReceiptResult > for ffi :: EthGetTransactionReceiptResult { fn from (other : super :: types :: EthGetTransactionReceiptResult) -> Self { ffi :: EthGetTransactionReceiptResult { transaction_receipt : other . transaction_receipt . map (Into :: into) . unwrap_or_default () , } } } impl From < ffi :: EthCallInput > for super :: types :: EthCallInput { fn from (other : ffi :: EthCallInput) -> Self { super :: types :: EthCallInput { transaction_info : Some (other . transaction_info . into ()) , block_number : other . block_number . into () , } } } impl From < super :: types :: EthCallInput > for ffi :: EthCallInput { fn from (other : super :: types :: EthCallInput) -> Self { ffi :: EthCallInput { transaction_info : other . transaction_info . map (Into :: into) . unwrap_or_default () , block_number : other . block_number . into () , } } } impl From < ffi :: EthGetBalanceResult > for super :: types :: EthGetBalanceResult { fn from (other : ffi :: EthGetBalanceResult) -> Self { super :: types :: EthGetBalanceResult { balance : other . balance . into () , } } } impl From < super :: types :: EthGetBalanceResult > for ffi :: EthGetBalanceResult { fn from (other : super :: types :: EthGetBalanceResult) -> Self { ffi :: EthGetBalanceResult { balance : other . balance . into () , } } } impl From < ffi :: Vin > for super :: types :: Vin { fn from (other : ffi :: Vin) -> Self { super :: types :: Vin { txid : other . txid . into () , vout : other . vout . into () , script_sig : Some (other . script_sig . into ()) , sequence : other . sequence . into () , txinwitness : other . txinwitness . into_iter () . map (Into :: into) . collect () , coinbase : other . coinbase . into () , } } } impl From < super :: types :: Vin > for ffi :: Vin { fn from (other : super :: types :: Vin) -> Self { ffi :: Vin { txid : other . txid . into () , vout : other . vout . into () , script_sig : other . script_sig . map (Into :: into) . unwrap_or_default () , sequence : other . sequence . into () , txinwitness : other . txinwitness . into_iter () . map (Into :: into) . collect () , coinbase : other . coinbase . into () , } } } impl From < ffi :: EthBlockInfo > for super :: types :: EthBlockInfo { fn from (other : ffi :: EthBlockInfo) -> Self { super :: types :: EthBlockInfo { block_number : other . block_number . into () , hash : other . hash . into () , parent_hash : other . parent_hash . into () , nonce : other . nonce . into () , sha3_uncles : other . sha3_uncles . into () , logs_bloom : other . logs_bloom . into () , transactions_root : other . transactions_root . into () , state_root : other . state_root . into () , receipt_root : other . receipt_root . into () , miner : other . miner . into () , difficulty : other . difficulty . into () , total_difficulty : other . total_difficulty . into () , extra_data : other . extra_data . into () , size : other . size . into () , gas_limit : other . gas_limit . into () , gas_used : other . gas_used . into () , timestamps : other . timestamps . into () , transactions : other . transactions . into_iter () . map (Into :: into) . collect () , uncles : other . uncles . into_iter () . map (Into :: into) . collect () , } } } impl From < super :: types :: EthBlockInfo > for ffi :: EthBlockInfo { fn from (other : super :: types :: EthBlockInfo) -> Self { ffi :: EthBlockInfo { block_number : other . block_number . into () , hash : other . hash . into () , parent_hash : other . parent_hash . into () , nonce : other . nonce . into () , sha3_uncles : other . sha3_uncles . into () , logs_bloom : other . logs_bloom . into () , transactions_root : other . transactions_root . into () , state_root : other . state_root . into () , receipt_root : other . receipt_root . into () , miner : other . miner . into () , difficulty : other . difficulty . into () , total_difficulty : other . total_difficulty . into () , extra_data : other . extra_data . into () , size : other . size . into () , gas_limit : other . gas_limit . into () , gas_used : other . gas_used . into () , timestamps : other . timestamps . into () , transactions : other . transactions . into_iter () . map (Into :: into) . collect () , uncles : other . uncles . into_iter () . map (Into :: into) . collect () , } } } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Accounts (client : & Box < Client >) -> Result < ffi :: EthAccountsResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthAccountsResult , _ > = c . request ("eth_accounts" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Call (client : & Box < Client > , eth_call_input : EthCallInput) -> Result < ffi :: EthCallResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_call_input = super :: types :: EthCallInput :: from (eth_call_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_call_input . transaction_info , & eth_call_input . block_number] ; let resp : Result < super :: types :: EthCallResult , _ > = c . request ("eth_call" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBalance (client : & Box < Client > , eth_get_balance_input : EthGetBalanceInput) -> Result < ffi :: EthGetBalanceResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_balance_input = super :: types :: EthGetBalanceInput :: from (eth_get_balance_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_balance_input . address , & eth_get_balance_input . block_number] ; let resp : Result < super :: types :: EthGetBalanceResult , _ > = c . request ("eth_getbalance" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByHash (client : & Box < Client > , eth_get_block_by_hash_input : EthGetBlockByHashInput) -> Result < ffi :: EthBlockInfo , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_block_by_hash_input = super :: types :: EthGetBlockByHashInput :: from (eth_get_block_by_hash_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_block_by_hash_input . hash , & eth_get_block_by_hash_input . full_transaction] ; let resp : Result < super :: types :: EthBlockInfo , _ > = c . request ("eth_getblockbyhash" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_ChainId (client : & Box < Client >) -> Result < ffi :: EthChainIdResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthChainIdResult , _ > = c . request ("eth_chainid" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallNet_Version (client : & Box < Client >) -> Result < ffi :: EthChainIdResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthChainIdResult , _ > = c . request ("net_version" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_BlockNumber (client : & Box < Client >) -> Result < ffi :: EthBlockNumberResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthBlockNumberResult , _ > = c . request ("eth_blocknumber" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_GetBlockByNumber (client : & Box < Client > , eth_get_block_by_number_input : EthGetBlockByNumberInput) -> Result < ffi :: EthBlockInfo , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let eth_get_block_by_number_input = super :: types :: EthGetBlockByNumberInput :: from (eth_get_block_by_number_input) ; let params = jsonrpsee_core :: rpc_params ! [& eth_get_block_by_number_input . number , & eth_get_block_by_number_input . full_transaction] ; let resp : Result < super :: types :: EthBlockInfo , _ > = c . request ("eth_getblockbynumber" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) } # [allow (non_snake_case)] # [allow (clippy :: borrowed_box)] fn CallEth_Mining (client : & Box < Client >) -> Result < ffi :: EthMiningResult , Box < dyn std :: error :: Error >> { let (tx , mut rx) = tokio :: sync :: mpsc :: channel (1) ; let c = client . inner . clone () ; client . handle . spawn (async move { let params = jsonrpsee_core :: rpc_params ! [] ; let resp : Result < super :: types :: EthMiningResult , _ > = c . request ("eth_mining" , params) . await ; let _ = tx . send (resp) . await ; }) ; Ok (rx . blocking_recv () . unwrap () . map (Into :: into) ?) }# [derive (Clone)] pub struct EthService { # [allow (dead_code)] adapter : Arc < Handlers > } impl EthService { # [inline] # [allow (dead_code)] pub fn new (adapter : Arc < Handlers >) -> EthService { EthService { adapter } } # [inline] # [allow (dead_code)] pub fn service (& self) -> eth_server :: EthServer < EthService > { eth_server :: EthServer :: new (self . clone ()) } # [inline] # [allow (unused_mut , dead_code)] pub fn module (& self) -> Result < jsonrpsee_http_server :: RpcModule < () > , jsonrpsee_core :: Error > { let mut module = jsonrpsee_http_server :: RpcModule :: new (()) ; let adapter = self . adapter . clone () ; module . register_method ("eth_accounts" , move | _params , _ | { Self :: Eth_Accounts (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_call" , move | _params , _ | { let mut eth_call_input = super :: types :: EthCallInput :: default () ; if _params . is_object () { eth_call_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_call_input . transaction_info = seq . next () . map_err (| _ | missing_param ("transaction_info")) ? ; eth_call_input . block_number = seq . next () . map_err (| _ | missing_param ("block_number")) ? ; } let mut input = eth_call_input . into () ; Self :: Eth_Call (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getbalance" , move | _params , _ | { let mut eth_get_balance_input = super :: types :: EthGetBalanceInput :: default () ; if _params . is_object () { eth_get_balance_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_balance_input . address = seq . next () . map_err (| _ | missing_param ("address")) ? ; eth_get_balance_input . block_number = seq . next () . map_err (| _ | missing_param ("block_number")) ? ; } let mut input = eth_get_balance_input . into () ; Self :: Eth_GetBalance (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getblockbyhash" , move | _params , _ | { let mut eth_get_block_by_hash_input = super :: types :: EthGetBlockByHashInput :: default () ; if _params . is_object () { eth_get_block_by_hash_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_block_by_hash_input . hash = seq . next () . map_err (| _ | missing_param ("hash")) ? ; eth_get_block_by_hash_input . full_transaction = seq . next () . map_err (| _ | missing_param ("full_transaction")) ? ; } let mut input = eth_get_block_by_hash_input . into () ; Self :: Eth_GetBlockByHash (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_chainid" , move | _params , _ | { Self :: Eth_ChainId (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("net_version" , move | _params , _ | { Self :: Net_Version (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_blocknumber" , move | _params , _ | { Self :: Eth_BlockNumber (adapter . clone () ,) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_getblockbynumber" , move | _params , _ | { let mut eth_get_block_by_number_input = super :: types :: EthGetBlockByNumberInput :: default () ; if _params . is_object () { eth_get_block_by_number_input = _params . parse () ? ; } else { let mut seq = _params . sequence () ; eth_get_block_by_number_input . number = seq . next () . map_err (| _ | missing_param ("number")) ? ; eth_get_block_by_number_input . full_transaction = seq . next () . map_err (| _ | missing_param ("full_transaction")) ? ; } let mut input = eth_get_block_by_number_input . into () ; Self :: Eth_GetBlockByNumber (adapter . clone () , input) }) ? ; let adapter = self . adapter . clone () ; module . register_method ("eth_mining" , move | _params , _ | { Self :: Eth_Mining (adapter . clone () ,) }) ? ; Ok (module) } } # [tonic :: async_trait] impl eth_server :: Eth for EthService { async fn eth_accounts (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthAccountsResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_Accounts (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_call (& self , request : tonic :: Request < super :: types :: EthCallInput >) -> Result < tonic :: Response < super :: types :: EthCallResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_Call (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_balance (& self , request : tonic :: Request < super :: types :: EthGetBalanceInput >) -> Result < tonic :: Response < super :: types :: EthGetBalanceResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBalance (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_block_by_hash (& self , request : tonic :: Request < super :: types :: EthGetBlockByHashInput >) -> Result < tonic :: Response < super :: types :: EthBlockInfo > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBlockByHash (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } # [allow (unused_variables)] async fn eth_send_transaction (& self , request : tonic :: Request < super :: types :: EthSendTransactionInput >) -> Result < tonic :: Response < super :: types :: EthSendTransactionResult > , tonic :: Status > { unimplemented ! () ; } async fn eth_chain_id (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthChainIdResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_ChainId (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn net_version (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthChainIdResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Net_Version (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_block_number (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthBlockNumberResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_BlockNumber (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_get_block_by_number (& self , request : tonic :: Request < super :: types :: EthGetBlockByNumberInput >) -> Result < tonic :: Response < super :: types :: EthBlockInfo > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { let input = request . into_inner () . into () ; Self :: Eth_GetBlockByNumber (adapter . clone () , input) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } async fn eth_mining (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: EthMiningResult > , tonic :: Status > { let adapter = self . adapter . clone () ; let result = tokio :: task :: spawn_blocking (move || { Self :: Eth_Mining (adapter . clone () ,) . map_err (| e | tonic :: Status :: unknown (e . to_string ())) }) . await . map_err (| e | { tonic :: Status :: unknown (format ! ("failed to invoke RPC call: {}" , e)) }) ? ? ; Ok (tonic :: Response :: new (result . into ())) } }# [derive (Clone)] pub struct BlockchainService { # [allow (dead_code)] adapter : Arc < Handlers > } impl BlockchainService { # [inline] # [allow (dead_code)] pub fn new (adapter : Arc < Handlers >) -> BlockchainService { BlockchainService { adapter } } # [inline] # [allow (dead_code)] pub fn service (& self) -> blockchain_server :: BlockchainServer < BlockchainService > { blockchain_server :: BlockchainServer :: new (self . clone ()) } # [inline] # [allow (unused_mut , dead_code)] pub fn module (& self) -> Result < jsonrpsee_http_server :: RpcModule < () > , jsonrpsee_core :: Error > { let mut module = jsonrpsee_http_server :: RpcModule :: new (()) ; Ok (module) } } # [tonic :: async_trait] impl blockchain_server :: Blockchain for BlockchainService { # [allow (unused_variables)] async fn get_best_block_hash (& self , _request : tonic :: Request < () >) -> Result < tonic :: Response < super :: types :: BlockHashResult > , tonic :: Status > { unimplemented ! () ; } # [allow (unused_variables)] async fn get_block (& self , request : tonic :: Request < super :: types :: BlockInput >) -> Result < tonic :: Response < super :: types :: BlockResult > , tonic :: Status > { unimplemented ! () ; } } \ No newline at end of file diff --git a/src/rust/ain-rs-exports/build.rs b/src/rust/ain-rs-exports/build.rs index 75ab6dcd9b..517b204f05 100644 --- a/src/rust/ain-rs-exports/build.rs +++ b/src/rust/ain-rs-exports/build.rs @@ -6,7 +6,7 @@ use std::io::{Read, Write}; use std::path::PathBuf; fn main() { - let _pkg_name = env::var("CARGO_PKG_NAME").unwrap(); + let pkg_name = env::var("CARGO_PKG_NAME").unwrap(); let manifest_path = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()); // TODO: Use root path to force re-run during development @@ -22,9 +22,7 @@ fn main() { println!("BUILD_DIR: {:?}", target_dir); std::fs::create_dir_all(&target_dir).unwrap(); - let parent = manifest_path.clone(); - - let lib_path = &parent.join("src").join("lib.rs"); + let lib_path = &manifest_path.join("src").join("lib.rs"); let mut content = String::new(); File::open(lib_path) @@ -32,21 +30,25 @@ fn main() { .read_to_string(&mut content) .unwrap(); + let pkg_name_underscored = pkg_name.replace("-", "_"); + let header_file_path = String::from(pkg_name_underscored.clone() + ".h"); + let source_file_path = String::from(pkg_name_underscored.clone() + ".cpp"); + let tt: TokenStream = content.parse().unwrap(); let mut opt = cxx_gen::Opt::default(); opt.include.push(cxx_gen::Include { - path: "libain_rs_exports.h".to_string(), + path: header_file_path.clone(), kind: cxx_gen::IncludeKind::Bracketed, }); let codegen = cxx_gen::generate_header_and_cc(tt, &opt).unwrap(); let cpp_stuff = String::from_utf8(codegen.implementation).unwrap(); - File::create(target_dir.join("libain_rs_exports.h")) + File::create(target_dir.join(header_file_path)) .unwrap() .write_all(&codegen.header) .unwrap(); - File::create(target_dir.join("libain_rs_exports.cpp")) + File::create(target_dir.join(source_file_path)) .unwrap() .write_all(cpp_stuff.as_bytes()) .unwrap(); diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 0be25c85d1..f4fb681f06 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/validation.cpp b/src/validation.cpp index 80001c5f68..e7e0e7eaef 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include From db54529cd9cc3ce6607028e237879515f23c4782 Mon Sep 17 00:00:00 2001 From: dcorral Date: Thu, 13 Apr 2023 10:46:49 +0200 Subject: [PATCH 5/6] set local C to work with OSX out of the box rm whitespaces --- make.sh | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/make.sh b/make.sh index 8bb9d589a3..df4984b2b5 100755 --- a/make.sh +++ b/make.sh @@ -3,7 +3,7 @@ # Copyright (c) DeFi Blockchain Developers # Maker script -export LC_ALL=C.UTF-8 +export LC_ALL=C set -Eeuo pipefail setup_vars() { @@ -11,7 +11,7 @@ setup_vars() { GIT_VERSION=${GIT_VERSION:-0} if [[ "$GIT_VERSION" == 1 ]]; then IMAGE_VERSION=${IMAGE_VERSION:-"$(git_version 0)"} - else + else IMAGE_VERSION=${IMAGE_VERSION:-"latest"} fi @@ -99,7 +99,7 @@ help() { printf "\n\`%s build\` or \`%s docker-build\` are your friends :) \n" "$0" "$0" printf "\nCommands:\n" printf "\t%s\n" "${COMMANDS[@]//_/-}" - printf "\nNote: All commands without docker-* prefix assume that it's run in\n" + printf "\nNote: All commands without docker-* prefix assume that it's run in\n" printf "an environment with correct arch and pre-requisites configured. \n" printf "(most pre-requisites can be installed with pkg-* commands). \n" } @@ -114,12 +114,12 @@ build_deps() { local release_depends_dir=${DEPENDS_DIR} echo "> build-deps: target: ${target} / deps_args: ${make_deps_args} / jobs: ${make_jobs}" - + _ensure_enter_dir "$release_depends_dir" if [[ "$target" =~ .*darwin.* ]]; then pkg_local_ensure_osx_sysroot fi - + _fold_start "build-deps" # shellcheck disable=SC2086 @@ -193,7 +193,7 @@ deploy() { echo "> deploy into: ${release_dir} from ${versioned_release_path}" _safe_rm_rf "${versioned_release_path}" && mkdir -p "${versioned_release_path}" - + make -C "${release_target_dir}" prefix=/ DESTDIR="${versioned_release_path}" \ install && cp README.md "${versioned_release_path}/" @@ -376,7 +376,7 @@ git_version() { fi fi - if [[ "$verbose" == "1" ]]; then + if [[ "$verbose" == "1" ]]; then echo "> git branch: ${current_branch}" echo "> version: ${ver}" else @@ -390,7 +390,7 @@ pkg_update_base() { apt update apt install -y apt-transport-https apt dist-upgrade -y - + _fold_end } @@ -410,7 +410,7 @@ pkg_install_deps() { pkg_install_deps_mingw_x86_64() { _fold_start "pkg-install-deps-mingw-x86_64" - + apt install -y \ g++-mingw-w64-x86-64 mingw-w64-x86-64-dev @@ -454,7 +454,7 @@ pkg_local_ensure_osx_sysroot() { _fold_start "pkg-local-mac-sdk" - if [[ ! -f "${pkg}" ]]; then + if [[ ! -f "${pkg}" ]]; then wget https://bitcoincore.org/depends-sources/sdks/${pkg} fi tar -zxf "${pkg}" @@ -494,11 +494,11 @@ purge() { clean_artifacts() { # If build is done out of tree, this is not needed at all. But when done - # in-tree, or helper tools that end up running configure in-tree, this is - # a helpful method to clean up left overs. + # in-tree, or helper tools that end up running configure in-tree, this is + # a helpful method to clean up left overs. local items=(\ .libs .deps obj "*.dirstamp" "*.a" "*.o" "*.Po" "*.lo") - + local x for x in "${items[@]}"; do _safe_rm_rf "$(find src -iname "$x" -print0 | xargs -0)" @@ -588,12 +588,12 @@ _get_default_target() { elif [[ "${OSTYPE}" == "msys" ]]; then default_target="x86_64-w64-mingw32" else - # Note: make.sh only formally supports auto selection for + # Note: make.sh only formally supports auto selection for # windows under msys, mac os and debian derivatives to build on. # Also note: Support for auto selection on make.sh does not imply - # support for the architecture. + # support for the architecture. # Only supported architectures are the ones with release builds - # enabled on the CI. + # enabled on the CI. local dpkg_arch="" dpkg_arch=$(dpkg --print-architecture || true) if [[ "$dpkg_arch" == "armhf" ]]; then @@ -601,7 +601,7 @@ _get_default_target() { elif [[ "$dpkg_arch" == "aarch64" ]]; then default_target="aarch64-linux-gnu" else - # Global default if we can't determine it from the + # Global default if we can't determine it from the # above, which are our only supported list for auto select default_target="x86_64-pc-linux-gnu" fi @@ -629,7 +629,7 @@ _get_default_conf_args() { _platform_init() { # Lazy init functions if [[ $(readlink -m . 2> /dev/null) != "${_SCRIPT_DIR}" ]]; then - if [[ $(greadlink -m . 2> /dev/null) != "${_SCRIPT_DIR}" ]]; then + if [[ $(greadlink -m . 2> /dev/null) != "${_SCRIPT_DIR}" ]]; then echo "error: readlink or greadlink with \`-m\` support is required" echo "tip: debian/ubuntu: apt install coreutils" echo "tip: osx: brew install coreutils" @@ -672,7 +672,7 @@ _sign() { _safe_rm_rf() { local x for x in "$@"; do - if [[ "$x" =~ ^[[:space:]]*$ || "$x" =~ ^/*$ ]]; then + if [[ "$x" =~ ^[[:space:]]*$ || "$x" =~ ^/*$ ]]; then # Safe guard against accidental rm -rfs echo "error: unsafe delete attempted" exit 1 From 981574dbdd8d9c417a035486c1f3b637197d6965 Mon Sep 17 00:00:00 2001 From: dcorral Date: Thu, 13 Apr 2023 10:51:19 +0200 Subject: [PATCH 6/6] Revert "set local C to work with OSX out of the box" This reverts commit db54529cd9cc3ce6607028e237879515f23c4782. --- make.sh | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/make.sh b/make.sh index df4984b2b5..8bb9d589a3 100755 --- a/make.sh +++ b/make.sh @@ -3,7 +3,7 @@ # Copyright (c) DeFi Blockchain Developers # Maker script -export LC_ALL=C +export LC_ALL=C.UTF-8 set -Eeuo pipefail setup_vars() { @@ -11,7 +11,7 @@ setup_vars() { GIT_VERSION=${GIT_VERSION:-0} if [[ "$GIT_VERSION" == 1 ]]; then IMAGE_VERSION=${IMAGE_VERSION:-"$(git_version 0)"} - else + else IMAGE_VERSION=${IMAGE_VERSION:-"latest"} fi @@ -99,7 +99,7 @@ help() { printf "\n\`%s build\` or \`%s docker-build\` are your friends :) \n" "$0" "$0" printf "\nCommands:\n" printf "\t%s\n" "${COMMANDS[@]//_/-}" - printf "\nNote: All commands without docker-* prefix assume that it's run in\n" + printf "\nNote: All commands without docker-* prefix assume that it's run in\n" printf "an environment with correct arch and pre-requisites configured. \n" printf "(most pre-requisites can be installed with pkg-* commands). \n" } @@ -114,12 +114,12 @@ build_deps() { local release_depends_dir=${DEPENDS_DIR} echo "> build-deps: target: ${target} / deps_args: ${make_deps_args} / jobs: ${make_jobs}" - + _ensure_enter_dir "$release_depends_dir" if [[ "$target" =~ .*darwin.* ]]; then pkg_local_ensure_osx_sysroot fi - + _fold_start "build-deps" # shellcheck disable=SC2086 @@ -193,7 +193,7 @@ deploy() { echo "> deploy into: ${release_dir} from ${versioned_release_path}" _safe_rm_rf "${versioned_release_path}" && mkdir -p "${versioned_release_path}" - + make -C "${release_target_dir}" prefix=/ DESTDIR="${versioned_release_path}" \ install && cp README.md "${versioned_release_path}/" @@ -376,7 +376,7 @@ git_version() { fi fi - if [[ "$verbose" == "1" ]]; then + if [[ "$verbose" == "1" ]]; then echo "> git branch: ${current_branch}" echo "> version: ${ver}" else @@ -390,7 +390,7 @@ pkg_update_base() { apt update apt install -y apt-transport-https apt dist-upgrade -y - + _fold_end } @@ -410,7 +410,7 @@ pkg_install_deps() { pkg_install_deps_mingw_x86_64() { _fold_start "pkg-install-deps-mingw-x86_64" - + apt install -y \ g++-mingw-w64-x86-64 mingw-w64-x86-64-dev @@ -454,7 +454,7 @@ pkg_local_ensure_osx_sysroot() { _fold_start "pkg-local-mac-sdk" - if [[ ! -f "${pkg}" ]]; then + if [[ ! -f "${pkg}" ]]; then wget https://bitcoincore.org/depends-sources/sdks/${pkg} fi tar -zxf "${pkg}" @@ -494,11 +494,11 @@ purge() { clean_artifacts() { # If build is done out of tree, this is not needed at all. But when done - # in-tree, or helper tools that end up running configure in-tree, this is - # a helpful method to clean up left overs. + # in-tree, or helper tools that end up running configure in-tree, this is + # a helpful method to clean up left overs. local items=(\ .libs .deps obj "*.dirstamp" "*.a" "*.o" "*.Po" "*.lo") - + local x for x in "${items[@]}"; do _safe_rm_rf "$(find src -iname "$x" -print0 | xargs -0)" @@ -588,12 +588,12 @@ _get_default_target() { elif [[ "${OSTYPE}" == "msys" ]]; then default_target="x86_64-w64-mingw32" else - # Note: make.sh only formally supports auto selection for + # Note: make.sh only formally supports auto selection for # windows under msys, mac os and debian derivatives to build on. # Also note: Support for auto selection on make.sh does not imply - # support for the architecture. + # support for the architecture. # Only supported architectures are the ones with release builds - # enabled on the CI. + # enabled on the CI. local dpkg_arch="" dpkg_arch=$(dpkg --print-architecture || true) if [[ "$dpkg_arch" == "armhf" ]]; then @@ -601,7 +601,7 @@ _get_default_target() { elif [[ "$dpkg_arch" == "aarch64" ]]; then default_target="aarch64-linux-gnu" else - # Global default if we can't determine it from the + # Global default if we can't determine it from the # above, which are our only supported list for auto select default_target="x86_64-pc-linux-gnu" fi @@ -629,7 +629,7 @@ _get_default_conf_args() { _platform_init() { # Lazy init functions if [[ $(readlink -m . 2> /dev/null) != "${_SCRIPT_DIR}" ]]; then - if [[ $(greadlink -m . 2> /dev/null) != "${_SCRIPT_DIR}" ]]; then + if [[ $(greadlink -m . 2> /dev/null) != "${_SCRIPT_DIR}" ]]; then echo "error: readlink or greadlink with \`-m\` support is required" echo "tip: debian/ubuntu: apt install coreutils" echo "tip: osx: brew install coreutils" @@ -672,7 +672,7 @@ _sign() { _safe_rm_rf() { local x for x in "$@"; do - if [[ "$x" =~ ^[[:space:]]*$ || "$x" =~ ^/*$ ]]; then + if [[ "$x" =~ ^[[:space:]]*$ || "$x" =~ ^/*$ ]]; then # Safe guard against accidental rm -rfs echo "error: unsafe delete attempted" exit 1