mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 06:21:02 +00:00
committed by
Bastian Köcher
parent
bde1629f86
commit
52542b11d4
@@ -45,7 +45,6 @@ use bp_header_chain::{
|
|||||||
use bp_runtime::{BlockNumberOf, Chain, HashOf, HasherOf, HeaderId, HeaderOf, OwnedBridgeModule};
|
use bp_runtime::{BlockNumberOf, Chain, HashOf, HasherOf, HeaderId, HeaderOf, OwnedBridgeModule};
|
||||||
use finality_grandpa::voter_set::VoterSet;
|
use finality_grandpa::voter_set::VoterSet;
|
||||||
use frame_support::{ensure, fail};
|
use frame_support::{ensure, fail};
|
||||||
use frame_system::ensure_signed;
|
|
||||||
use sp_finality_grandpa::{ConsensusLog, GRANDPA_ENGINE_ID};
|
use sp_finality_grandpa::{ConsensusLog, GRANDPA_ENGINE_ID};
|
||||||
use sp_runtime::traits::{Header as HeaderT, Zero};
|
use sp_runtime::traits::{Header as HeaderT, Zero};
|
||||||
use sp_std::{boxed::Box, convert::TryInto};
|
use sp_std::{boxed::Box, convert::TryInto};
|
||||||
@@ -156,12 +155,11 @@ pub mod pallet {
|
|||||||
justification.votes_ancestries.len().try_into().unwrap_or(u32::MAX),
|
justification.votes_ancestries.len().try_into().unwrap_or(u32::MAX),
|
||||||
))]
|
))]
|
||||||
pub fn submit_finality_proof(
|
pub fn submit_finality_proof(
|
||||||
origin: OriginFor<T>,
|
_origin: OriginFor<T>,
|
||||||
finality_target: Box<BridgedHeader<T, I>>,
|
finality_target: Box<BridgedHeader<T, I>>,
|
||||||
justification: GrandpaJustification<BridgedHeader<T, I>>,
|
justification: GrandpaJustification<BridgedHeader<T, I>>,
|
||||||
) -> DispatchResultWithPostInfo {
|
) -> DispatchResultWithPostInfo {
|
||||||
Self::ensure_not_halted().map_err(Error::<T, I>::BridgeModule)?;
|
Self::ensure_not_halted().map_err(Error::<T, I>::BridgeModule)?;
|
||||||
let _ = ensure_signed(origin)?;
|
|
||||||
|
|
||||||
ensure!(Self::request_count() < T::MaxRequests::get(), <Error<T, I>>::TooManyRequests);
|
ensure!(Self::request_count() < T::MaxRequests::get(), <Error<T, I>>::TooManyRequests);
|
||||||
|
|
||||||
|
|||||||
@@ -275,6 +275,7 @@ pub mod pallet {
|
|||||||
parachain_heads_proof: ParaHeadsProof,
|
parachain_heads_proof: ParaHeadsProof,
|
||||||
) -> DispatchResultWithPostInfo {
|
) -> DispatchResultWithPostInfo {
|
||||||
Self::ensure_not_halted().map_err(Error::<T, I>::BridgeModule)?;
|
Self::ensure_not_halted().map_err(Error::<T, I>::BridgeModule)?;
|
||||||
|
|
||||||
// we'll need relay chain header to verify that parachains heads are always increasing.
|
// we'll need relay chain header to verify that parachains heads are always increasing.
|
||||||
let (relay_block_number, relay_block_hash) = at_relay_block;
|
let (relay_block_number, relay_block_hash) = at_relay_block;
|
||||||
let relay_block = pallet_bridge_grandpa::ImportedHeaders::<
|
let relay_block = pallet_bridge_grandpa::ImportedHeaders::<
|
||||||
|
|||||||
Reference in New Issue
Block a user