From 6f9654e50ea0c57b257201d16a4c4148d73b72b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Delabrouille?= Date: Tue, 21 Nov 2023 13:36:53 +0100 Subject: [PATCH] chore: rebase and fix --- CHANGELOG.md | 1 + crates/pallets/starknet/runtime_api/Cargo.toml | 2 +- crates/pallets/starknet/runtime_api/src/lib.rs | 10 +++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d4a48fed2..36a65b28b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/crates/pallets/starknet/runtime_api/Cargo.toml b/crates/pallets/starknet/runtime_api/Cargo.toml index 67ae7910c9..15c3bc1272 100644 --- a/crates/pallets/starknet/runtime_api/Cargo.toml +++ b/crates/pallets/starknet/runtime_api/Cargo.toml @@ -98,4 +98,4 @@ std = [ "dep:reqwest", "dep:cairo-lang-casm-contract-class", "parity-scale-codec/std", -] \ No newline at end of file +] diff --git a/crates/pallets/starknet/runtime_api/src/lib.rs b/crates/pallets/starknet/runtime_api/src/lib.rs index 409442feaf..81137fad02 100644 --- a/crates/pallets/starknet/runtime_api/src/lib.rs +++ b/crates/pallets/starknet/runtime_api/src/lib.rs @@ -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; @@ -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<::Extrinsic>) -> Vec; - fn get_events_for_tx_hash(xts: Vec<::Extrinsic>, chain_id: Felt252Wrapper, tx_hash: Felt252Wrapper) -> Option<(TxType, Vec)>; + fn get_index_and_tx_for_tx_hash(xts: Vec<::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>; /// Return the list of StarknetEvent evmitted during this block, along with the hash of the starknet transaction they bellong to /// @@ -66,6 +68,8 @@ sp_api::decl_runtime_apis! { fn get_tx_execution_outcome(tx_hash: TransactionHash) -> Option>; /// Return the block context fn get_block_context() -> BlockContext; + /// Return is fee disabled in state + fn is_transaction_fee_disabled() -> bool; } pub trait ConvertTransactionRuntimeApi { @@ -132,4 +136,4 @@ impl From for BlockContext { max_recursion_depth: value.max_recursion_depth, } } -} \ No newline at end of file +}