Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ jsonrpsee = { version = "0.22", features = ["server", "client", "macros"] }
moka = { version = "0.12.1", features = ["future"] }
lru = "0.7.2"
tempfile = "3.1.0"
ts-rs = { version = "11.0.1", default-features = false }

# Ethereum
rlp = { git = "https://github.com/paritytech/parity-common.git", tag = "rlp-v0.5.2", default-features = false }
Expand Down
3 changes: 0 additions & 3 deletions pallets/system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ derive_more.workspace = true
hex-literal.workspace = true
itertools = { workspace = true, default-features = false }
thiserror-no-std.workspace = true
ts-rs = { workspace = true, optional = true }

# Substrate
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = [ "derive"] }
Expand Down Expand Up @@ -100,8 +99,6 @@ secure_padding_fill = []

testing-environment = []

ts = ["ts-rs"]

[[bench]]
name = "bench"
harness = false
2 changes: 0 additions & 2 deletions pallets/system/rpc/runtime-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ scale-info = { workspace = true, default-features = false }
frame-system = { workspace = true, default-features = false }
serde = { workspace = true, default-features = false }
sp-std = { workspace = true, default-features = false }
ts-rs = { workspace = true, optional = true }

[features]
default = [ "std" ]
std = [ "codec/std", "sp-api/std", "serde/std", "frame-system/std" ]
ts = ["ts-rs"]
24 changes: 8 additions & 16 deletions pallets/system/rpc/runtime-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

#![cfg_attr(not(feature = "std"), no_std)]

use system_events_api::fetch_events_v1::ApiResult as FetchEventsResult;
use system_events_api::fetch_events_v1::Options as FetchEventsOptions;
use system_events_api::fetch_events::ApiResult as FetchEventsResult;
use system_events_api::fetch_events::Options as FetchEventsOptions;

sp_api::decl_runtime_apis! {
/// The API to query account nonce.
Expand All @@ -38,14 +38,14 @@ sp_api::decl_runtime_apis! {

pub trait SystemEventsApi
{
fn fetch_events_v1(options: FetchEventsOptions) -> FetchEventsResult;
fn fetch_events(options: FetchEventsOptions) -> FetchEventsResult;
}
}

pub mod system_events_api {
use sp_std::vec::Vec;

pub mod fetch_events_v1 {
pub mod fetch_events {
use super::*;

pub const MAX_INDICES_COUNT: usize = 30;
Expand All @@ -55,18 +55,13 @@ pub mod system_events_api {

#[derive(Clone, Default, scale_info::TypeInfo, codec::Decode, codec::Encode)]
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "ts", derive(ts_rs::TS))]
#[cfg_attr(feature = "ts", ts(export, export_to = "FetchEvents.ts"))]
pub struct Options {
pub filter: Option<Filter>,
pub enable_encoding: Option<bool>,
pub enable_decoding: Option<bool>,
pub fetch_data: Option<bool>,
}

#[derive(Clone, scale_info::TypeInfo, codec::Decode, codec::Encode)]
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "ts", derive(ts_rs::TS))]
#[cfg_attr(feature = "ts", ts(export, export_to = "FetchEvents.ts"))]
#[repr(u8)]
pub enum Filter {
All = 0,
Expand Down Expand Up @@ -130,22 +125,19 @@ pub mod system_events_api {
pub index: u32,
// (Pallet Id, Event Id)
pub emitted_index: (u8, u8),
pub encoded: Option<Vec<u8>>,
pub decoded: Option<Vec<u8>>,
pub data: Option<Vec<u8>>,
}

impl RuntimeEvent {
pub fn new(
index: u32,
emitted_index: (u8, u8),
encoded: Option<Vec<u8>>,
decoded: Option<Vec<u8>>,
data: Option<Vec<u8>>,
) -> Self {
Self {
index,
emitted_index,
encoded,
decoded,
data,
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions pallets/system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1062,8 +1062,6 @@ pub type KeyValue = (Vec<u8>, Vec<u8>);
/// A phase of a block's execution.
#[derive(Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "ts", derive(ts_rs::TS))]
#[cfg_attr(feature = "ts", ts(export, export_to = "FetchEvents.ts"))]
pub enum Phase {
/// Applying an extrinsic.
ApplyExtrinsic(u32),
Expand Down
2 changes: 0 additions & 2 deletions rpc/kate-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ sp-runtime = { workspace = true, default-features = false }
sc-service = { workspace = true, default-features = false }
sp-core = { workspace = true, default-features = false }
frame-system-rpc-runtime-api = { workspace = true, default-features = false }
ts-rs = { workspace = true, optional = true }

[features]
default = [ "std" ]
Expand All @@ -54,4 +53,3 @@ std = [
# NOTE: WIP because that affects the Data Availability Protocol used during
# the block import process.
secure_padding_fill = []
ts = ["ts-rs"]
13 changes: 0 additions & 13 deletions rpc/kate-rpc/src/justifications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,36 +192,26 @@ impl<'de> serde::Deserialize<'de> for Signature {
}

#[derive(Clone, codec::Decode, serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "ts", derive(ts_rs::TS))]
#[cfg_attr(feature = "ts", ts(export, export_to = "BlockJustification.ts"))]
pub struct Precommit {
/// The target block's hash.
#[cfg_attr(feature = "ts", ts(as = "String"))]
pub target_hash: H256,
/// The target block's number
pub target_number: u32,
}

#[derive(Clone, codec::Decode, serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "ts", derive(ts_rs::TS))]
#[cfg_attr(feature = "ts", ts(export, export_to = "BlockJustification.ts"))]
pub struct SignedPrecommit {
/// The precommit message which has been signed.
pub precommit: Precommit,
/// The signature on the message.
#[cfg_attr(feature = "ts", ts(as = "String"))]
pub signature: Signature,
/// The Id of the signer.
#[cfg_attr(feature = "ts", ts(as = "String"))]
pub id: AuthorityId,
}

#[derive(Clone, codec::Decode, serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "ts", derive(ts_rs::TS))]
#[cfg_attr(feature = "ts", ts(export, export_to = "BlockJustification.ts"))]
pub struct Commit {
/// The target block's hash.
#[cfg_attr(feature = "ts", ts(as = "String"))]
pub target_hash: H256,
/// The target block's number.
pub target_number: u32,
Expand All @@ -230,11 +220,8 @@ pub struct Commit {
}

#[derive(Clone, codec::Decode, serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "ts", derive(ts_rs::TS))]
#[cfg_attr(feature = "ts", ts(export, export_to = "BlockJustification.ts"))]
pub struct GrandpaJustification {
pub round: u64,
pub commit: Commit,
#[cfg_attr(feature = "ts", ts(as = "Vec<String>"))]
pub votes_ancestries: Vec<Header>,
}
Loading