MCPcopy Create free account
hub / github.com/cairoeth/preconfirmations / processRequest

Method processRequest

rpc/server/request_handler.go:115–125  ·  view source on GitHub ↗

processRequest handles single request

(client RPCProxyClient, jsonReq *types.JSONRPCRequest, origin, referer string, isWhitehatBundleCollection bool, whitehatBundleID string, urlParams URLParameters)

Source from the content-addressed store, hash-verified

113
114// processRequest handles single request
115func (r *RPCRequestHandler) processRequest(client RPCProxyClient, jsonReq *types.JSONRPCRequest, origin, referer string, isWhitehatBundleCollection bool, whitehatBundleID string, urlParams URLParameters) {
116 var entry *database.EthSendRawTxEntry
117 if jsonReq.Method == "eth_sendRawTransaction" {
118 entry = r.requestRecord.AddEthSendRawTxEntry(uuid.New())
119 }
120 // Handle single request
121 rpcReq := NewRPCRequest(r.logger, client, jsonReq, r.relaySigningKey, r.relayURL, origin, referer, isWhitehatBundleCollection, whitehatBundleID, entry, urlParams, r.chainID)
122 res := rpcReq.ProcessRequest()
123 // Write response
124 r._writeRPCResponse(res)
125}
126
127func (r *RPCRequestHandler) finishRequest() {
128 reqDuration := time.Since(r.timeStarted) // At end of request, log the time it needed

Callers 1

processMethod · 0.95

Calls 4

ProcessRequestMethod · 0.95
_writeRPCResponseMethod · 0.95
NewRPCRequestFunction · 0.85
AddEthSendRawTxEntryMethod · 0.80

Tested by

no test coverage detected