Skip to content

Commit

Permalink
Fix block parameter for admin_generateCheckpoint and `eth_getBlockR…
Browse files Browse the repository at this point in the history
…eceipts` (#2063)
  • Loading branch information
JamesHinshelwood authored Dec 20, 2024
1 parent f612bdb commit bb0501d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions zilliqa/src/api/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use std::sync::{Arc, Mutex};

use alloy::eips::BlockNumberOrTag;
use alloy::eips::BlockId;
use anyhow::{anyhow, Result};
use jsonrpsee::{types::Params, RpcModule};
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -32,11 +32,11 @@ pub struct CheckpointResponse {

fn checkpoint(params: Params, node: &Arc<Mutex<Node>>) -> Result<CheckpointResponse> {
let mut params = params.sequence();
let block_number: BlockNumberOrTag = params.next()?;
let block_id: BlockId = params.next()?;
let mut node = node.lock().unwrap();
let block = node
.get_block(block_number)?
.ok_or(anyhow!("Block {block_number} does not exist"))?;
.get_block(block_id)?
.ok_or(anyhow!("Block {block_id} does not exist"))?;

let (file_name, hash) = node.consensus.checkpoint_at(block.number())?;
Ok(CheckpointResponse {
Expand Down
2 changes: 1 addition & 1 deletion zilliqa/src/api/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ fn get_balance(params: Params, node: &Arc<Mutex<Node>>) -> Result<String> {
}

fn get_block_receipts(params: Params, node: &Arc<Mutex<Node>>) -> Result<Vec<TransactionReceipt>> {
let block_id: B256 = params.one()?;
let block_id: BlockId = params.one()?;

let node = node.lock().unwrap();

Expand Down

0 comments on commit bb0501d

Please sign in to comment.