|
| 1 | +use crate::account::{AccountWithinBlock, get_account}; |
| 2 | +use crate::header::{BlockHeaderPartial, get_header}; |
| 3 | +use crate::log::{get_log, LogWithinBlock}; |
| 4 | +use crate::misc::types::Address; |
| 5 | +use crate::receipt::{get_receipt, TxReceiptWithinBlock}; |
| 6 | +use crate::transaction::{get_transaction, TransactionWithinBlock}; |
| 7 | + |
| 8 | +#[export] |
| 9 | +pub fn benchmark_get_account(chain_id: u32, block_no: u64, address: Address) -> AccountWithinBlock { |
| 10 | + let result = get_account(chain_id, block_no, address); |
| 11 | + result |
| 12 | +} |
| 13 | + |
| 14 | +#[export] |
| 15 | +pub fn benchmark_get_header(chain_id: u32, block_no: u64) -> BlockHeaderPartial { |
| 16 | + let result = get_header(chain_id, block_no); |
| 17 | + result |
| 18 | +} |
| 19 | + |
| 20 | +#[export] |
| 21 | +pub fn benchmark_get_receipt(chain_id: u32, block_no: u64, tx_idx: Field) -> TxReceiptWithinBlock { |
| 22 | + let result = get_receipt(chain_id, block_no, tx_idx); |
| 23 | + result |
| 24 | +} |
| 25 | + |
| 26 | +#[export] |
| 27 | +pub fn benchmark_get_transaction( |
| 28 | + chain_id: u32, |
| 29 | + block_no: u64, |
| 30 | + tx_idx: Field, |
| 31 | +) -> TransactionWithinBlock<1000> { |
| 32 | + let result = get_transaction::<1000>(chain_id, block_no, tx_idx); |
| 33 | + result |
| 34 | +} |
| 35 | + |
| 36 | +#[export] |
| 37 | +pub fn benchmark_get_log( |
| 38 | + chain_id: u32, |
| 39 | + block_no: u64, |
| 40 | + tx_idx: Field, |
| 41 | + log_idx: u32, |
| 42 | +) -> LogWithinBlock<1000> { |
| 43 | + let result = get_log::<1000, 1000>(chain_id, block_no, tx_idx, log_idx); |
| 44 | + result |
| 45 | +} |
0 commit comments