Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit b9927cd

Browse files
authored
Mark sync_state_genSyncSpec JSON-RPC as safe (#10832)
* Mark sync_state_genSyncSpec JSON-RPC as safe * Note that parameter is unused * Ideally I'd wait for compilation to be finished before pushing, but it's really taking a long time * Remove deny_unsafe parameter * Remove unused dependency
1 parent 9d96262 commit b9927cd

File tree

4 files changed

+1
-10
lines changed

4 files changed

+1
-10
lines changed

Cargo.lock

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

bin/node/rpc/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ where
165165
client,
166166
shared_authority_set,
167167
shared_epoch_changes,
168-
deny_unsafe,
169168
)?,
170169
));
171170

client/sync-state-rpc/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ sc-client-api = { version = "4.0.0-dev", path = "../api" }
2222
sc-consensus-babe = { version = "0.10.0-dev", path = "../consensus/babe" }
2323
sc-consensus-epochs = { version = "0.10.0-dev", path = "../consensus/epochs" }
2424
sc-finality-grandpa = { version = "0.10.0-dev", path = "../finality-grandpa" }
25-
sc-rpc-api = { version = "0.10.0-dev", path = "../rpc-api" }
2625
serde_json = "1.0.74"
2726
serde = { version = "1.0.136", features = ["derive"] }
2827
sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" }

client/sync-state-rpc/src/lib.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ pub struct SyncStateRpcHandler<Block: BlockT, Backend> {
134134
client: Arc<Backend>,
135135
shared_authority_set: SharedAuthoritySet<Block>,
136136
shared_epoch_changes: SharedEpochChanges<Block>,
137-
deny_unsafe: sc_rpc_api::DenyUnsafe,
138137
}
139138

140139
impl<Block, Backend> SyncStateRpcHandler<Block, Backend>
@@ -148,12 +147,11 @@ where
148147
client: Arc<Backend>,
149148
shared_authority_set: SharedAuthoritySet<Block>,
150149
shared_epoch_changes: SharedEpochChanges<Block>,
151-
deny_unsafe: sc_rpc_api::DenyUnsafe,
152150
) -> Result<Self, Error<Block>> {
153151
if sc_chain_spec::get_extension::<LightSyncStateExtension>(chain_spec.extensions())
154152
.is_some()
155153
{
156-
Ok(Self { chain_spec, client, shared_authority_set, shared_epoch_changes, deny_unsafe })
154+
Ok(Self { chain_spec, client, shared_authority_set, shared_epoch_changes })
157155
} else {
158156
Err(Error::<Block>::LightSyncStateExtensionNotFound)
159157
}
@@ -185,10 +183,6 @@ where
185183
Backend: HeaderBackend<Block> + sc_client_api::AuxStore + 'static,
186184
{
187185
fn system_gen_sync_spec(&self, raw: bool) -> jsonrpc_core::Result<jsonrpc_core::Value> {
188-
if let Err(err) = self.deny_unsafe.check_if_safe() {
189-
return Err(err.into())
190-
}
191-
192186
let mut chain_spec = self.chain_spec.cloned_box();
193187

194188
let sync_state = self.build_sync_state().map_err(map_error::<Block, Error<Block>>)?;

0 commit comments

Comments
 (0)