mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
Make node read-only
Transactions should be sent to official rpc; mark it as read only and check if we can proxy the requests later
This commit is contained in:
@ -769,33 +769,28 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Handler for: `eth_sendTransaction`
|
/// Handler for: `eth_sendTransaction`
|
||||||
async fn send_transaction(&self, request: TransactionRequest) -> RpcResult<B256> {
|
async fn send_transaction(&self, _request: TransactionRequest) -> RpcResult<B256> {
|
||||||
trace!(target: "rpc::eth", ?request, "Serving eth_sendTransaction");
|
Err(internal_rpc_err("The node is read-only"))
|
||||||
Ok(EthTransactions::send_transaction(self, request).await?)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Handler for: `eth_sendRawTransaction`
|
/// Handler for: `eth_sendRawTransaction`
|
||||||
async fn send_raw_transaction(&self, tx: Bytes) -> RpcResult<B256> {
|
async fn send_raw_transaction(&self, _tx: Bytes) -> RpcResult<B256> {
|
||||||
trace!(target: "rpc::eth", ?tx, "Serving eth_sendRawTransaction");
|
Err(internal_rpc_err("The node is read-only"))
|
||||||
Ok(EthTransactions::send_raw_transaction(self, tx).await?)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Handler for: `eth_sign`
|
/// Handler for: `eth_sign`
|
||||||
async fn sign(&self, address: Address, message: Bytes) -> RpcResult<Bytes> {
|
async fn sign(&self, _address: Address, _message: Bytes) -> RpcResult<Bytes> {
|
||||||
trace!(target: "rpc::eth", ?address, ?message, "Serving eth_sign");
|
Err(internal_rpc_err("The node is read-only"))
|
||||||
Ok(EthTransactions::sign(self, address, message).await?)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Handler for: `eth_signTransaction`
|
/// Handler for: `eth_signTransaction`
|
||||||
async fn sign_transaction(&self, request: TransactionRequest) -> RpcResult<Bytes> {
|
async fn sign_transaction(&self, _request: TransactionRequest) -> RpcResult<Bytes> {
|
||||||
trace!(target: "rpc::eth", ?request, "Serving eth_signTransaction");
|
Err(internal_rpc_err("The node is read-only"))
|
||||||
Ok(EthTransactions::sign_transaction(self, request).await?)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Handler for: `eth_signTypedData`
|
/// Handler for: `eth_signTypedData`
|
||||||
async fn sign_typed_data(&self, address: Address, data: TypedData) -> RpcResult<Bytes> {
|
async fn sign_typed_data(&self, _address: Address, _data: TypedData) -> RpcResult<Bytes> {
|
||||||
trace!(target: "rpc::eth", ?address, ?data, "Serving eth_signTypedData");
|
Err(internal_rpc_err("The node is read-only"))
|
||||||
Ok(EthTransactions::sign_typed_data(self, &data, address)?)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Handler for: `eth_getProof`
|
/// Handler for: `eth_getProof`
|
||||||
|
|||||||
Reference in New Issue
Block a user