mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 18:41:03 +00:00
Make work with Substrate master (#36)
* Fix up wasm runtime build * Fixes for runtime * Fix. * More fixes * Runtime builds on native. * Native and wasm both build without warnings. * Fix runtime tests. * Merge #20 * Final fix for native runtime. * Compile polkadot wo consensus * Reverted changes to polkadot-consensus * reintroduce minimal subset of consensus * reintroduce checked_block to runtime for std * polkadot_consensus compiles without most of the code * remove checked_block again and do more checks in parachains for runtime * uncomment proposer * remove offline tracker * extract out parachain-attestation logic from proposal directly * reintroduce transaction_pool * write some custom aura verification logic for the block verifier * use transaction pool in more generic way * service compiles again * polkadot-network and tests pass * remove unused session_key function from router * everything but CLI compiles due to service hell * Fixes compilation of `polkadot_cli` * everything compiles * update adder wasm
This commit is contained in:
@@ -20,6 +20,8 @@ use rstd::prelude::*;
|
||||
use rstd::cmp::Ordering;
|
||||
use super::Hash;
|
||||
|
||||
use {AccountId};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use primitives::bytes;
|
||||
|
||||
@@ -110,7 +112,7 @@ impl CandidateReceipt {
|
||||
pub fn check_signature(&self) -> Result<(), ()> {
|
||||
use runtime_primitives::traits::Verify;
|
||||
|
||||
if self.signature.verify(&self.block_data_hash.0[..], &self.collator) {
|
||||
if self.signature.verify(self.block_data_hash.as_ref(), &self.collator) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(())
|
||||
@@ -205,3 +207,27 @@ pub enum Statement {
|
||||
/// Vote to advance round after inactive primary.
|
||||
Available(Hash),
|
||||
}
|
||||
|
||||
decl_runtime_apis! {
|
||||
/// The API for querying the state of parachains on-chain.
|
||||
pub trait ParachainHost {
|
||||
/// Get the current validators.
|
||||
fn validators() -> Vec<AccountId>;
|
||||
/// Get the current duty roster.
|
||||
fn duty_roster() -> DutyRoster;
|
||||
/// Get the currently active parachains.
|
||||
fn active_parachains() -> Vec<Id>;
|
||||
/// Get the given parachain's head data blob.
|
||||
fn parachain_head(id: Id) -> Option<Vec<u8>>;
|
||||
/// Get the given parachain's head code blob.
|
||||
fn parachain_code(id: Id) -> Option<Vec<u8>>;
|
||||
}
|
||||
}
|
||||
|
||||
/// Runtime ID module.
|
||||
pub mod id {
|
||||
use sr_version::ApiId;
|
||||
|
||||
/// Parachain host runtime API id.
|
||||
pub const PARACHAIN_HOST: ApiId = *b"parahost";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user