Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
Small refactor (#978)
Browse files Browse the repository at this point in the history
* Small refactor

* clean up
  • Loading branch information
tcoratger authored Apr 17, 2024
1 parent 7e5ff0b commit 4891841
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/eth_provider/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ where
let block = match block_id {
BlockId::Hash(hash) => BlockHashOrNumber::Hash((*hash).into()),
BlockId::Number(number_or_tag) => {
BlockHashOrNumber::Number(self.tag_into_block_number(*number_or_tag).await?.to::<u64>())
BlockHashOrNumber::Number(self.tag_into_block_number(*number_or_tag).await?.to())
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/eth_rpc/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ where
let net_rpc_module = NetRpc::new(eth_provider.clone()).into_rpc();
let debug_rpc_module = DebugRpc::new(eth_provider).into_rpc();

let mut modules: HashMap<KakarotRpcModule, Methods> = HashMap::new();
let mut modules = HashMap::new();

modules.insert(KakarotRpcModule::Eth, eth_rpc_module.into());
modules.insert(KakarotRpcModule::Alchemy, alchemy_rpc_module.into());
Expand Down
3 changes: 1 addition & 2 deletions src/models/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ impl From<EthBlockNumberOrTag> for BlockNumberOrTag {

impl From<EthBlockNumberOrTag> for StarknetBlockId {
fn from(block_number_or_tag: EthBlockNumberOrTag) -> Self {
let block_number_or_tag = block_number_or_tag.into();
match block_number_or_tag {
match block_number_or_tag.into() {
BlockNumberOrTag::Latest | BlockNumberOrTag::Pending => {
// We set to pending because in Starknet, a pending block is an unsealed block,
// With a centralized sequencer, the latest block is the pending block being filled.
Expand Down

0 comments on commit 4891841

Please sign in to comment.