Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: evm_rpc_types crate and Nat256 #257

Merged
merged 18 commits into from
Aug 26, 2024
Merged

Conversation

gregorydemay
Copy link
Member

@gregorydemay gregorydemay commented Aug 23, 2024

Introduce a new crate evm_rpc_types that will contain all Candid types necessary to interact with the EVM RPC canister. As a first step for #243 :

  1. Introduce Nat256 as a wrapper around a Nat that is guaranteed to have the same encoding/decoding as a Nat, while ensuring that it fits in a U256 bits.
  2. As an example, refactor eth_fee_history so that the public API only uses types from the new evm_rpc_types crate .

@gregorydemay gregorydemay linked an issue Aug 23, 2024 that may be closed by this pull request
@gregorydemay gregorydemay changed the title feat: Nat256 feat: evm_rpc_types crate and Nat256 Aug 23, 2024
@gregorydemay gregorydemay marked this pull request as ready for review August 23, 2024 15:17
@gregorydemay gregorydemay requested review from rvanasa and THLO August 23, 2024 15:17
Copy link
Collaborator

@rvanasa rvanasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; thanks! I like the naming conventions, and the temporary cketh_conversions file should be fine until we finish refactoring.

@gregorydemay gregorydemay merged commit a55cd77 into main Aug 26, 2024
3 checks passed
@gregorydemay gregorydemay deleted the gdemay/243-types-crate branch August 26, 2024 07:39
gregorydemay added a commit that referenced this pull request Aug 28, 2024
…ate (#261)

Follow-up on #257 to move the types `GetLogsArgs` and `LogEntry` to the `evm_rpc_types` crate, so that the public API of `eth_get_logs` only uses types from that crate.

Additionally, add the types `Hex`, `Hex20`, and `Hex32` as a transparent wrapper around a Candid type `text` to represent Ethereum hex strings (prefixed by `0x`) containing an unbounded, 20 or 32 bytes, respectively.
gregorydemay added a commit that referenced this pull request Aug 29, 2024
Follow-up on #257 to move the type `TransactionReceipt` to the
`evm_rpc_types` crate, so that the public API of
`eth_get_transaction_receipt` only uses types from that crate.
gregorydemay added a commit that referenced this pull request Sep 11, 2024
Follow-up on #257 to move the type `Block` to the `evm_rpc_types` crate,
so that the public API of `eth_get_block_by_number` only uses types from
that crate.

---------

Co-authored-by: rvanasa <[email protected]>
gregorydemay added a commit that referenced this pull request Sep 12, 2024
…s` to `evm_rpc_types` (#270)

Follow-up on #257 to move the types `GetTransactionCountArgs` and
`SendRawTransactionStatus` to the `evm_rpc_types` crate, so that the
public API of `eth_get_transaction_count` and
`eth_send_raw_transaction`, respectively, only uses types from that
crate.
gregorydemay added a commit that referenced this pull request Sep 13, 2024
)

Follow-up on #257 to move the following types to the `evm_rpc_types`
crate:

1. `EthMainnetService`
2. `EthSepoliaService`
3. `HttpHeader`
4. `L2MainnetService`
5. `RpcApi`
6. `RpcConfig`
7. `RpcService`
8. `RpcServices`


so that the public API of all methods in `main.rs` only use types from
that crate as arguments.
gregorydemay added a commit that referenced this pull request Sep 16, 2024
Follow-up on #257 to move the following types to the `evm_rpc_types`
crate:

1. `HttpOutcallError`
2. `JsonRpcError`
3. `MultiRpcResult`
4. `ProviderError`
5. `RpcError`,
6.   `RpcResult`
7. `ValidationError`

so that the public API of all methods in `main.rs` only use types from
that crate as return types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor to remove cketh-minter dependency
3 participants