Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
chore: rebase and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tdelabro committed Nov 21, 2023
1 parent 709857a commit 82f9451
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Next release

- refacto: move starknet runtime api in it's own crate
- chore: update README.md and getting-started.md
- chore: remove crates that have been copy-pasted from plkdtSDK
- feat(rpc): return deployed contract address and actual fee in transaction
Expand Down
10 changes: 7 additions & 3 deletions crates/pallets/starknet/runtime_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use alloc::sync::Arc;

use blockifier::execution::contract_class::ContractClass;
use mp_felt::Felt252Wrapper;
use mp_transactions::{Transaction, TxType, UserTransaction};
use mp_transactions::{Transaction, UserTransaction};
use sp_api::BlockT;
pub extern crate alloc;
use alloc::string::String;
Expand Down Expand Up @@ -56,7 +56,9 @@ sp_api::decl_runtime_apis! {
/// the runtime itself, accomplished through the extrinsic_filter method. This enables the
/// client to operate seamlessly while abstracting the extrinsic complexity.
fn extrinsic_filter(xts: Vec<<Block as BlockT>::Extrinsic>) -> Vec<Transaction>;
fn get_events_for_tx_hash(xts: Vec<<Block as BlockT>::Extrinsic>, chain_id: Felt252Wrapper, tx_hash: Felt252Wrapper) -> Option<(TxType, Vec<StarknetEvent>)>;
fn get_index_and_tx_for_tx_hash(xts: Vec<<Block as BlockT>::Extrinsic>, chain_id: Felt252Wrapper, tx_hash: Felt252Wrapper) -> Option<(u32, Transaction)>;
/// Returns events, call with index from get_index_and_tx_for_tx_hash method
fn get_events_for_tx_by_index(tx_index: u32) -> Option<Vec<StarknetEvent>>;

/// Return the list of StarknetEvent evmitted during this block, along with the hash of the starknet transaction they bellong to
///
Expand All @@ -66,6 +68,8 @@ sp_api::decl_runtime_apis! {
fn get_tx_execution_outcome(tx_hash: TransactionHash) -> Option<Vec<u8>>;
/// Return the block context
fn get_block_context() -> BlockContext;
/// Return is fee disabled in state
fn is_transaction_fee_disabled() -> bool;
}

pub trait ConvertTransactionRuntimeApi {
Expand Down Expand Up @@ -132,4 +136,4 @@ impl From<blockifier::block_context::BlockContext> for BlockContext {
max_recursion_depth: value.max_recursion_depth,
}
}
}
}

0 comments on commit 82f9451

Please sign in to comment.