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

Commit

Permalink
feat(rpc): Added starknet_getTransactionStatus and removed starknet_p…
Browse files Browse the repository at this point in the history
…endingTransactions (#1299)
  • Loading branch information
antiyro authored Dec 6, 2023
1 parent f128573 commit 17f8a0f
Show file tree
Hide file tree
Showing 10 changed files with 185 additions and 217 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Next release

- refacto: substrate/starknet names in rpc library
- feat(rpc): Added starknet_getTransactionStatus and removed
starknet_pendingTransactions
- feat(rpc): add starknet_specVersion rpc + added test for future support
- docs: Added v0.6.0-rc5 documentation above the rpc method functions
- dev(deps): bump starknet rs, use Eq for EmmitedEvents comparaison
Expand Down
51 changes: 26 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/client/rpc-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jsonrpsee = { workspace = true, features = [
], default-features = true }
mp-block = { workspace = true }
mp-digest-log = { workspace = true }
mp-transactions = { workspace = true, features = ["serde"] }
num-bigint = { workspace = true }
serde = { workspace = true, default-features = true }
serde_json = { workspace = true }
Expand Down
9 changes: 5 additions & 4 deletions crates/client/rpc-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use serde_with::serde_as;

pub mod utils;

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

/// Gets the Transaction Status, Including Mempool Status and Execution Details
#[method(name = "getTransactionStatus")]
fn get_transaction_status(&self, transaction_hash: FieldElement) -> RpcResult<TransactionStatus>;

/// Get the value of the storage at the given address and key, at the given block id
#[method(name = "getStorageAt")]
fn get_storage_at(&self, contract_address: FieldElement, key: FieldElement, block_id: BlockId) -> RpcResult<Felt>;
Expand Down Expand Up @@ -128,10 +133,6 @@ pub trait StarknetReadRpcApi {
#[method(name = "getStateUpdate")]
fn get_state_update(&self, block_id: BlockId) -> RpcResult<StateUpdate>;

/// Returns the transactions in the transaction pool, recognized by this sequencer
#[method(name = "pendingTransactions")]
async fn pending_transactions(&self) -> RpcResult<Vec<Transaction>>;

/// Returns all events matching the given filter
#[method(name = "getEvents")]
async fn get_events(&self, filter: EventFilterWithPage) -> RpcResult<EventsPage>;
Expand Down
Loading

0 comments on commit 17f8a0f

Please sign in to comment.