-
Notifications
You must be signed in to change notification settings - Fork 575
Conversation
…Client, Ctx, getBlockNumber, getTransactionByBlockAndIndex, doCall
Codecov Report
@@ Coverage Diff @@
## main #1218 +/- ##
==========================================
- Coverage 57.20% 51.92% -5.28%
==========================================
Files 94 102 +8
Lines 8424 9282 +858
==========================================
+ Hits 4819 4820 +1
- Misses 3358 4214 +856
- Partials 247 248 +1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Updated the PR doing the following changes:
Still missing
I think that will be enough for a first PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@facs95 Looks good, since it's already merged I think we should address the following things in future PRs:
- move remaining logic from eth/api.go (
GetTransactionByBlockNumberAndIndex()
,GasPrice()
,MaxPriorityFeePerGas()
,GetTransactionLogs()
,GetPendingTransactions()
) - clean up interfaces. We probably don't need both interfaces
EVMBackend
andEthereumAPI
interface. What do you think?
// ProtocolVersion returns the supported Ethereum protocol version. | ||
func (e *PublicAPI) ProtocolVersion() hexutil.Uint { | ||
e.logger.Debug("eth_protocolVersion") | ||
return hexutil.Uint(ethermint.ProtocolVersion) | ||
} | ||
|
||
// GasPrice returns the current gas price based on Ethermint's gas price oracle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@facs95 Any reason, why you didn't move this endpoint logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any method of PublicAPI
gets exposed as an endpoint (eth_protocolVersion
) its not the same when its a backend method. Those are not exposed. So I just moved the logic that use clientQuery or clientCtx to the backend. Anything that required state query.
* move non api methods from eth/api.go to evm_backend: ClientCtx, QueryClient, Ctx, getBlockNumber, getTransactionByBlockAndIndex, doCall * organize eth/api.go into sections and move backend logic to dedicated files * remove unnecesary comment * move resend to the backend * refractor eth api * refractor debug namespace * refactor miner namespace * refactor personal namespace * update transactionReceipt from upstream * update getBlockByNumber from upstream * update getBalance from upstream * update getProof from upstream * update getBalance from upstream * fix linter * remove duplicated import * remove duplicated import * fix backend tests * fix lint * fix duplicated imports * fix linter * reorganize blocks * backend folder refractor * remove unnecessary file * remove duplicate import Co-authored-by: Freddy Caceres <facs95@gmail.com>
* move non api methods from eth/api.go to evm_backend: ClientCtx, QueryClient, Ctx, getBlockNumber, getTransactionByBlockAndIndex, doCall * organize eth/api.go into sections and move backend logic to dedicated files * remove unnecesary comment * move resend to the backend * refractor eth api * refractor debug namespace * refactor miner namespace * refactor personal namespace * update transactionReceipt from upstream * update getBlockByNumber from upstream * update getBalance from upstream * update getProof from upstream * update getBalance from upstream * fix linter * remove duplicated import * remove duplicated import * fix backend tests * fix lint * fix duplicated imports * fix linter * reorganize blocks * backend folder refractor * remove unnecessary file * remove duplicate import Co-authored-by: Freddy Caceres <facs95@gmail.com>
* move non api methods from eth/api.go to evm_backend: ClientCtx, QueryClient, Ctx, getBlockNumber, getTransactionByBlockAndIndex, doCall * organize eth/api.go into sections and move backend logic to dedicated files * remove unnecesary comment * move resend to the backend * refractor eth api * refractor debug namespace * refactor miner namespace * refactor personal namespace * update transactionReceipt from upstream * update getBlockByNumber from upstream * update getBalance from upstream * update getProof from upstream * update getBalance from upstream * fix linter * remove duplicated import * remove duplicated import * fix backend tests * fix lint * fix duplicated imports * fix linter * reorganize blocks * backend folder refractor * remove unnecessary file * remove duplicate import Co-authored-by: Freddy Caceres <facs95@gmail.com> (cherry picked from commit d43386d)
Description
This PR reorganizes the JSON-RPC apis and backend.
Right now the changes include an example for the following proposal:
use
namespace/ethereum/<namespace>/api.go
files for an overview of exposed apisuse
backend
for api logic. Separate into several backend logic files: