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

Commit 859f312

Browse files
Yogalholictdelabro
andauthored
refacto: move StarknetRuntimeApi trait definition in its own crate (#1272)
Co-authored-by: Timothée Delabrouille <timothee.delabrouille@gmail.com>
1 parent 3f36345 commit 859f312

File tree

22 files changed

+94
-17
lines changed

22 files changed

+94
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Next release
44

5+
- refacto: move starknet runtime api in it's own crate
56
- chore: update README.md and getting-started.md
67
- chore: remove crates that have been copy-pasted from plkdtSDK
78
- feat(rpc): return deployed contract address and actual fee in transaction

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ resolver = "2"
33
members = [
44
"crates/node",
55
"crates/runtime",
6+
"crates/pallets/starknet/runtime_api/",
67
"crates/pallets/starknet",
78
"crates/primitives/digest-log",
89
"crates/primitives/transactions",
@@ -28,6 +29,7 @@ members = [
2829
default-members = [
2930
"crates/node",
3031
"crates/runtime",
32+
"crates/pallets/starknet/runtime_api/",
3133
"crates/pallets/starknet",
3234
"crates/primitives/digest-log",
3335
"crates/primitives/transactions",
@@ -147,7 +149,7 @@ pallet-timestamp = { default-features = false, git = "https://github.com/parityt
147149

148150
# Madara pallets
149151
pallet-starknet = { path = "crates/pallets/starknet", default-features = false }
150-
152+
pallet-starknet-runtime-api = { path = "crates/pallets/starknet/runtime_api", default-features = false }
151153
# Madara primtitives
152154
mp-digest-log = { path = "crates/primitives/digest-log", default-features = false }
153155
mp-block = { path = "crates/primitives/block", default-features = false }

crates/client/commitment-state-diff/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ mp-digest-log = { workspace = true, default-features = true }
1717
mp-hashers = { workspace = true, default-features = true }
1818
mp-storage = { workspace = true, default-features = true }
1919
pallet-starknet = { workspace = true }
20+
pallet-starknet-runtime-api = { workspace = true, default-features = true }
2021

2122
# Starknet
2223
blockifier = { workspace = true, default-features = true }

crates/client/commitment-state-diff/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use futures::{Stream, StreamExt};
99
use indexmap::IndexMap;
1010
use mp_hashers::HasherT;
1111
use mp_storage::{SN_COMPILED_CLASS_HASH_PREFIX, SN_CONTRACT_CLASS_HASH_PREFIX, SN_NONCE_PREFIX, SN_STORAGE_PREFIX};
12-
use pallet_starknet::runtime_api::StarknetRuntimeApi;
12+
use pallet_starknet_runtime_api::StarknetRuntimeApi;
1313
use sc_client_api::client::BlockchainEvents;
1414
use sc_client_api::{StorageEventStream, StorageNotification};
1515
use sp_api::ProvideRuntimeApi;

crates/client/mapping-sync/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ mp-digest-log = { workspace = true }
2323
mp-hashers = { workspace = true }
2424
mp-transactions = { workspace = true }
2525
pallet-starknet = { workspace = true }
26+
pallet-starknet-runtime-api = { workspace = true }
2627
sc-client-api = { workspace = true }
2728
sp-api = { workspace = true }
2829
sp-blockchain = { workspace = true }

crates/client/mapping-sync/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use futures::task::{Context, Poll};
2020
use futures_timer::Delay;
2121
use log::debug;
2222
use mp_hashers::HasherT;
23-
use pallet_starknet::runtime_api::StarknetRuntimeApi;
23+
use pallet_starknet_runtime_api::StarknetRuntimeApi;
2424
use sc_client_api::backend::{Backend, StorageProvider};
2525
use sc_client_api::client::ImportNotifications;
2626
use sp_api::ProvideRuntimeApi;

crates/client/mapping-sync/src/sync_blocks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use mc_rpc_core::utils::get_block_by_block_hash;
22
use mp_digest_log::{find_starknet_block, FindLogError};
33
use mp_hashers::HasherT;
44
use mp_transactions::compute_hash::ComputeTransactionHash;
5-
use pallet_starknet::runtime_api::StarknetRuntimeApi;
5+
use pallet_starknet_runtime_api::StarknetRuntimeApi;
66
use sc_client_api::backend::{Backend, StorageProvider};
77
use sp_api::ProvideRuntimeApi;
88
use sp_blockchain::{Backend as _, HeaderBackend};

crates/client/rpc/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ targets = ["x86_64-unknown-linux-gnu"]
1818
[dependencies]
1919
# Madara runtime
2020
pallet-starknet = { workspace = true, default-features = true }
21+
pallet-starknet-runtime-api = { workspace = true, default-features = true }
2122
# Madara client
2223
mc-db = { workspace = true }
2324
mc-rpc-core = { workspace = true }

crates/client/rpc/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use jsonrpsee::types::error::{CallError, ErrorObject};
2-
use pallet_starknet::runtime_api::StarknetTransactionExecutionError;
2+
use pallet_starknet_runtime_api::StarknetTransactionExecutionError;
33

44
// Comes from the RPC Spec:
55
// https://github.com/starkware-libs/starknet-specs/blob/0e859ff905795f789f1dfd6f7340cdaf5015acc8/api/starknet_write_api.json#L227

0 commit comments

Comments
 (0)