Skip to content

Commit 17f8a0f

Browse files
authored
feat(rpc): Added starknet_getTransactionStatus and removed starknet_pendingTransactions (keep-starknet-strange#1299)
1 parent f128573 commit 17f8a0f

File tree

10 files changed

+185
-217
lines changed

10 files changed

+185
-217
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Next release
44

5+
- refacto: substrate/starknet names in rpc library
6+
- feat(rpc): Added starknet_getTransactionStatus and removed
7+
starknet_pendingTransactions
58
- feat(rpc): add starknet_specVersion rpc + added test for future support
69
- docs: Added v0.6.0-rc5 documentation above the rpc method functions
710
- dev(deps): bump starknet rs, use Eq for EmmitedEvents comparaison

Cargo.lock

Lines changed: 26 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/client/rpc-core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jsonrpsee = { workspace = true, features = [
3232
], default-features = true }
3333
mp-block = { workspace = true }
3434
mp-digest-log = { workspace = true }
35+
mp-transactions = { workspace = true, features = ["serde"] }
3536
num-bigint = { workspace = true }
3637
serde = { workspace = true, default-features = true }
3738
serde_json = { workspace = true }

crates/client/rpc-core/src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use serde_with::serde_as;
1414

1515
pub mod utils;
1616

17+
use mp_transactions::TransactionStatus;
1718
use starknet_core::serde::unsigned_field_element::UfeHex;
1819
use starknet_core::types::{
1920
BlockHashAndNumber, BlockId, BroadcastedDeclareTransaction, BroadcastedDeployAccountTransaction,
@@ -71,6 +72,10 @@ pub trait StarknetReadRpcApi {
7172
#[method(name = "getBlockTransactionCount")]
7273
fn get_block_transaction_count(&self, block_id: BlockId) -> RpcResult<u128>;
7374

75+
/// Gets the Transaction Status, Including Mempool Status and Execution Details
76+
#[method(name = "getTransactionStatus")]
77+
fn get_transaction_status(&self, transaction_hash: FieldElement) -> RpcResult<TransactionStatus>;
78+
7479
/// Get the value of the storage at the given address and key, at the given block id
7580
#[method(name = "getStorageAt")]
7681
fn get_storage_at(&self, contract_address: FieldElement, key: FieldElement, block_id: BlockId) -> RpcResult<Felt>;
@@ -128,10 +133,6 @@ pub trait StarknetReadRpcApi {
128133
#[method(name = "getStateUpdate")]
129134
fn get_state_update(&self, block_id: BlockId) -> RpcResult<StateUpdate>;
130135

131-
/// Returns the transactions in the transaction pool, recognized by this sequencer
132-
#[method(name = "pendingTransactions")]
133-
async fn pending_transactions(&self) -> RpcResult<Vec<Transaction>>;
134-
135136
/// Returns all events matching the given filter
136137
#[method(name = "getEvents")]
137138
async fn get_events(&self, filter: EventFilterWithPage) -> RpcResult<EventsPage>;

0 commit comments

Comments
 (0)