Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
e0f4cc7
Initial setup
gupnik May 15, 2023
5d688f8
Adds node block
gupnik May 15, 2023
1681e65
Uses UncheckedExtrinsic and removes Where section
gupnik May 15, 2023
3e461f1
Merge branch 'master' of github.com:paritytech/substrate into gupnik/…
gupnik May 23, 2023
a69a911
Merge branch 'master' of github.com:paritytech/substrate into gupnik/…
gupnik Jun 3, 2023
a5e7cb6
Merge branch 'master' of github.com:paritytech/substrate into gupnik/…
gupnik Jun 5, 2023
2590f43
Updates frame_system to use Block
gupnik Jun 5, 2023
f4e772a
Adds deprecation warning
gupnik Jun 5, 2023
989d2fc
Hopefully this fixes
gupnik Jun 10, 2023
ad7a25c
Fixes pallet-timestamp
gupnik Jun 11, 2023
c71aa74
Fixes node-template runtime
gupnik Jun 11, 2023
268e71f
Fixes node runtime
gupnik Jun 11, 2023
1616670
Fixes node-template
gupnik Jun 11, 2023
7bd6da7
Fixes cargo check
gupnik Jun 12, 2023
559e0e4
More fixes
gupnik Jun 12, 2023
c96d9bc
More fixes
gupnik Jun 13, 2023
0a19f0d
More fixes
gupnik Jun 13, 2023
6cb0ab9
".git/.scripts/commands/fmt/fmt.sh"
Jun 13, 2023
4ce055c
More fixes
gupnik Jun 13, 2023
9ab1b37
Removes unused import
gupnik Jun 13, 2023
54aebda
Fixes warnings
gupnik Jun 13, 2023
375bc0f
Fixes warnings
gupnik Jun 13, 2023
ee2eb17
Fixes warnings
gupnik Jun 13, 2023
9a9d41d
Fixes warnings
gupnik Jun 13, 2023
23bfc19
Fixes warnings
gupnik Jun 13, 2023
e63d231
Fixes warnings
gupnik Jun 13, 2023
3b50fe4
Fixes warnings
gupnik Jun 13, 2023
709d6a6
Fixes warnings
gupnik Jun 13, 2023
63decd8
Fixes tests
gupnik Jun 14, 2023
f66589a
Merge branch 'master' of github.com:paritytech/substrate into gupnik/…
gupnik Jun 14, 2023
b60fb81
".git/.scripts/commands/fmt/fmt.sh"
Jun 14, 2023
e5dafb9
Fixes tests
gupnik Jun 14, 2023
21abefc
Fixes doc link
gupnik Jun 14, 2023
8e2607a
Fixes warnings
gupnik Jun 14, 2023
2e4a3d2
Fixes warnings
gupnik Jun 14, 2023
b197dd0
Fixes warnings
gupnik Jun 14, 2023
dbf809e
Fixes warnings
gupnik Jun 14, 2023
922deb8
Fixes doc link and warnings
gupnik Jun 14, 2023
3377b38
Fixes tests
gupnik Jun 14, 2023
688922e
Minor update
gupnik Jun 14, 2023
dc3bf2c
Fixes tests
gupnik Jun 14, 2023
ccc76a2
Fixes impl_runtime_api
gupnik Jun 14, 2023
e0b1b14
Minor update
gupnik Jun 14, 2023
7eff183
Removes unused import
gupnik Jun 14, 2023
d39a6f2
Removes unused import
gupnik Jun 14, 2023
13db70d
Fixes tests
gupnik Jun 14, 2023
b8ded7f
Addresses review comments
gupnik Jun 18, 2023
f7a5450
Merge branch 'master' of github.com:paritytech/substrate into gupnik/…
gupnik Jun 18, 2023
7f82fe4
Merge branch 'master' of github.com:paritytech/substrate into gupnik/…
gupnik Jun 19, 2023
dbf3db3
Updates pallet-society
gupnik Jun 19, 2023
67a56fb
Updates pallet-society
gupnik Jun 19, 2023
6f40dda
Removes use_attr
gupnik Jun 19, 2023
701acd8
Fixes try-runtime-cli
gupnik Jun 19, 2023
f859b13
".git/.scripts/commands/fmt/fmt.sh"
Jun 19, 2023
204a1bc
Fixes unused import in ui tests
gupnik Jun 19, 2023
05b8873
Fixes sp-api tests
gupnik Jun 19, 2023
bf4b6aa
Merge branch 'master' of github.com:paritytech/substrate into gupnik/…
gupnik Jun 19, 2023
c9576f3
Fixes build
gupnik Jun 19, 2023
6f706bd
Uses u32 in mock block
gupnik Jun 20, 2023
60bd4c6
Uses u32 in mock block
gupnik Jun 20, 2023
dc946ad
Fixes type
gupnik Jun 20, 2023
f5f00d9
Revert "Fixes type"
gupnik Jun 20, 2023
cadd1e4
Revert "Uses u32 in mock block"
gupnik Jun 20, 2023
0040c20
Revert "Uses u32 in mock block"
gupnik Jun 20, 2023
88a92b6
Adds u32 block type
gupnik Jun 20, 2023
24e9580
Fixes doc tests
gupnik Jun 20, 2023
a2ecd52
".git/.scripts/commands/fmt/fmt.sh"
Jun 20, 2023
37d6cf4
Revert "Fixes doc tests"
gupnik Jun 20, 2023
6d18500
Merge branch 'master' of github.com:paritytech/substrate into gupnik/…
gupnik Jun 20, 2023
8461e97
Removes doc for decl_* to make CI happy
gupnik Jun 20, 2023
1c45275
Fixes sp-api doc
gupnik Jun 20, 2023
9296a79
Fixes rpc-support doc
gupnik Jun 20, 2023
86b6824
Merge branch 'master' of github.com:paritytech/substrate into gupnik/…
gupnik Jun 20, 2023
c537e8f
".git/.scripts/commands/fmt/fmt.sh"
Jun 21, 2023
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
Prev Previous commit
Next Next commit
Fixes node-template
  • Loading branch information
gupnik committed Jun 11, 2023
commit 1616670d45b92fac29e47a4c5b4ee45eaabf834a
5 changes: 1 addition & 4 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1861,10 +1861,7 @@ impl pallet_statement::Config for Runtime {
}

construct_runtime!(
pub struct Runtime where
Block = Block,
NodeBlock = node_primitives::Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: frame_system,
Utility: pallet_utility,
Expand Down
2 changes: 1 addition & 1 deletion client/api/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use parking_lot::RwLock;
use sp_consensus::BlockOrigin;
use sp_core::offchain::OffchainStorage;
use sp_runtime::{
traits::{Block as BlockT, HashFor, NumberFor},
traits::{Block as BlockT, HashFor, HeaderProvider, NumberFor},
Justification, Justifications, StateVersion, Storage,
};
use sp_state_machine::{
Expand Down
2 changes: 1 addition & 1 deletion client/api/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use sp_consensus::BlockOrigin;
use sp_core::storage::StorageKey;
use sp_runtime::{
generic::SignedBlock,
traits::{Block as BlockT, NumberFor},
traits::{Block as BlockT, HeaderProvider, NumberFor},
Justifications,
};
use std::{collections::HashSet, fmt, sync::Arc};
Expand Down
12 changes: 6 additions & 6 deletions client/api/src/in_mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use sp_core::{
};
use sp_runtime::{
generic::BlockId,
traits::{Block as BlockT, HashFor, Header as HeaderT, NumberFor, Zero},
traits::{Block as BlockT, HashFor, Header as HeaderT, HeaderProvider, NumberFor, Zero},
Justification, Justifications, StateVersion, Storage,
};
use sp_state_machine::{
Expand Down Expand Up @@ -155,7 +155,7 @@ impl<Block: BlockT> Blockchain<Block> {
pub fn insert(
&self,
hash: Block::Hash,
header: <Block as BlockT>::Header,
header: <Block as sp_runtime::traits::HeaderProvider>::Header,
justifications: Option<Justifications>,
body: Option<Vec<<Block as BlockT>::Extrinsic>>,
new_state: NewBlockState,
Expand Down Expand Up @@ -225,7 +225,7 @@ impl<Block: BlockT> Blockchain<Block> {
self.apply_head(&header)
}

fn apply_head(&self, header: &<Block as BlockT>::Header) -> sp_blockchain::Result<()> {
fn apply_head(&self, header: &<Block as sp_runtime::traits::HeaderProvider>::Header) -> sp_blockchain::Result<()> {
let hash = header.hash();
let number = header.number();

Expand Down Expand Up @@ -331,7 +331,7 @@ impl<Block: BlockT> HeaderBackend<Block> for Blockchain<Block> {
fn header(
&self,
hash: Block::Hash,
) -> sp_blockchain::Result<Option<<Block as BlockT>::Header>> {
) -> sp_blockchain::Result<Option<<Block as sp_runtime::traits::HeaderProvider>::Header>> {
Ok(self.storage.read().blocks.get(&hash).map(|b| b.header().clone()))
}

Expand Down Expand Up @@ -366,7 +366,7 @@ impl<Block: BlockT> HeaderBackend<Block> for Blockchain<Block> {

fn hash(
&self,
number: <<Block as BlockT>::Header as HeaderT>::Number,
number: <<Block as sp_runtime::traits::HeaderProvider>::Header as HeaderT>::Number,
) -> sp_blockchain::Result<Option<Block::Hash>> {
Ok(self.id(BlockId::Number(number)))
}
Expand Down Expand Up @@ -525,7 +525,7 @@ impl<Block: BlockT> backend::BlockImportOperation<Block> for BlockImportOperatio

fn set_block_data(
&mut self,
header: <Block as BlockT>::Header,
header: <Block as sp_runtime::traits::HeaderProvider>::Header,
body: Option<Vec<<Block as BlockT>::Extrinsic>>,
_indexed_body: Option<Vec<Vec<u8>>>,
justifications: Option<Justifications>,
Expand Down
8 changes: 4 additions & 4 deletions client/basic-authorship/src/basic_authorship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use sp_consensus::{DisableProofRecording, EnableProofRecording, ProofRecording,
use sp_core::traits::SpawnNamed;
use sp_inherents::InherentData;
use sp_runtime::{
traits::{BlakeTwo256, Block as BlockT, Hash as HashT, Header as HeaderT},
traits::{BlakeTwo256, Block as BlockT, Hash as HashT, Header as HeaderT, HeaderProvider},
Digest, Percent, SaturatedConversion,
};
use std::{marker::PhantomData, pin::Pin, sync::Arc, time};
Expand Down Expand Up @@ -190,7 +190,7 @@ where
{
fn init_with_now(
&mut self,
parent_header: &<Block as BlockT>::Header,
parent_header: &<Block as sp_runtime::traits::HeaderProvider>::Header,
now: Box<dyn Fn() -> time::Instant + Send + Sync>,
) -> Proposer<B, Block, C, A, PR> {
let parent_hash = parent_header.hash();
Expand Down Expand Up @@ -235,7 +235,7 @@ where
type Proposer = Proposer<B, Block, C, A, PR>;
type Error = sp_blockchain::Error;

fn init(&mut self, parent_header: &<Block as BlockT>::Header) -> Self::CreateProposer {
fn init(&mut self, parent_header: &<Block as sp_runtime::traits::HeaderProvider>::Header) -> Self::CreateProposer {
future::ready(Ok(self.init_with_now(parent_header, Box::new(time::Instant::now))))
}
}
Expand All @@ -245,7 +245,7 @@ pub struct Proposer<B, Block: BlockT, C, A: TransactionPool, PR> {
spawn_handle: Box<dyn SpawnNamed>,
client: Arc<C>,
parent_hash: Block::Hash,
parent_number: <<Block as BlockT>::Header as HeaderT>::Number,
parent_number: <<Block as sp_runtime::traits::HeaderProvider>::Header as HeaderT>::Number,
transaction_pool: Arc<A>,
now: Box<dyn Fn() -> time::Instant + Send + Sync>,
metrics: PrometheusMetrics,
Expand Down
2 changes: 1 addition & 1 deletion client/block-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ where
inherent_digests: Digest,
backend: &'a B,
) -> Result<Self, Error> {
let header = <<Block as BlockT>::Header as HeaderT>::new(
let header = <<Block as sp_runtime::traits::HeaderProvider>::Header as HeaderT>::new(
parent_number + One::one(),
Default::default(),
Default::default(),
Expand Down
4 changes: 2 additions & 2 deletions client/chain-spec/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ pub fn construct_genesis_block<Block: BlockT>(
state_root: Block::Hash,
state_version: StateVersion,
) -> Block {
let extrinsics_root = <<<Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root(
let extrinsics_root = <<<Block as sp_runtime::traits::HeaderProvider>::Header as HeaderT>::Hashing as HashT>::trie_root(
Vec::new(),
state_version,
);

Block::new(
<<Block as BlockT>::Header as HeaderT>::new(
<<Block as sp_runtime::traits::HeaderProvider>::Header as HeaderT>::new(
Zero::zero(),
extrinsics_root,
state_root,
Expand Down
4 changes: 2 additions & 2 deletions client/cli/src/commands/chain_info_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ struct ChainInfo<B: BlockT> {
/// Best block hash.
best_hash: B::Hash,
/// Best block number.
best_number: <<B as BlockT>::Header as HeaderT>::Number,
best_number: <<B as sp_runtime::traits::HeaderProvider>::Header as HeaderT>::Number,
/// Genesis block hash.
genesis_hash: B::Hash,
/// The head of the finalized chain.
finalized_hash: B::Hash,
/// Last finalized block number.
finalized_number: <<B as BlockT>::Header as HeaderT>::Number,
finalized_number: <<B as sp_runtime::traits::HeaderProvider>::Header as HeaderT>::Number,
}

impl<B: BlockT> From<Info<B>> for ChainInfo<B> {
Expand Down
2 changes: 1 addition & 1 deletion client/cli/src/commands/revert_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl RevertCmd {
B: BlockT,
BA: Backend<B>,
C: UsageProvider<B>,
<<<B as BlockT>::Header as HeaderT>::Number as FromStr>::Err: Debug,
<<<B as sp_runtime::traits::HeaderProvider>::Header as HeaderT>::Number as FromStr>::Err: Debug,
{
let blocks = self.num.parse()?;
if let Some(aux_revert) = aux_revert {
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/aura/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ mod tests {
type CreateProposer = futures::future::Ready<Result<DummyProposer, Error>>;
type Error = Error;

fn init(&mut self, parent_header: &<TestBlock as BlockT>::Header) -> Self::CreateProposer {
fn init(&mut self, parent_header: &<TestBlock as sp_runtime::traits::HeaderProvider>::Header) -> Self::CreateProposer {
futures::future::ready(Ok(DummyProposer(parent_header.number + 1, self.0.clone())))
}
}
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/babe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ impl<B: BlockT> Future for BabeWorker<B> {

/// Slot notification sinks.
type SlotNotificationSinks<B> = Arc<
Mutex<Vec<Sender<(Slot, ViableEpochDescriptor<<B as BlockT>::Hash, NumberFor<B>, Epoch>)>>>,
Mutex<Vec<Sender<(Slot, ViableEpochDescriptor<<B as sp_runtime::traits::HeaderProvider>::Hash, NumberFor<B>, Epoch>)>>>,
>;

struct BabeSlotWorker<B: BlockT, C, E, I, SO, L, BS> {
Expand Down
4 changes: 2 additions & 2 deletions client/consensus/babe/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl Environment<TestBlock> for DummyFactory {
type Proposer = DummyProposer;
type Error = Error;

fn init(&mut self, parent_header: &<TestBlock as BlockT>::Header) -> Self::CreateProposer {
fn init(&mut self, parent_header: &<TestBlock as sp_runtime::traits::HeaderProvider>::Header) -> Self::CreateProposer {
future::ready(Ok(DummyProposer {
factory: self.clone(),
parent_hash: parent_header.hash(),
Expand Down Expand Up @@ -178,7 +178,7 @@ pub struct BabeTestNet {
peers: Vec<BabePeer>,
}

type TestHeader = <TestBlock as BlockT>::Header;
type TestHeader = <TestBlock as sp_runtime::traits::HeaderProvider>::Header;

type TestSelectChain =
substrate_test_runtime_client::LongestChain<substrate_test_runtime_client::Backend, TestBlock>;
Expand Down
4 changes: 2 additions & 2 deletions client/consensus/common/src/import_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ pub type RuntimeOrigin = libp2p_identity::PeerId;
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct IncomingBlock<B: BlockT> {
/// Block header hash.
pub hash: <B as BlockT>::Hash,
pub hash: <B as sp_runtime::traits::HeaderProvider>::Hash,
/// Block header if requested.
pub header: Option<<B as BlockT>::Header>,
pub header: Option<<B as sp_runtime::traits::HeaderProvider>::Header>,
/// Block body if requested.
pub body: Option<Vec<<B as BlockT>::Extrinsic>>,
/// Indexed block body if requested.
Expand Down
6 changes: 3 additions & 3 deletions client/consensus/common/src/longest_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use sc_client_api::backend;
use sp_blockchain::{Backend, HeaderBackend};
use sp_consensus::{Error as ConsensusError, SelectChain};
use sp_runtime::traits::{Block as BlockT, Header, NumberFor};
use sp_runtime::traits::{Block as BlockT, Header, HeaderProvider, NumberFor};
use std::{marker::PhantomData, sync::Arc};

/// Implement Longest Chain Select implementation
Expand Down Expand Up @@ -59,7 +59,7 @@ where
Ok(best_hash)
}

fn best_header(&self) -> sp_blockchain::Result<<Block as BlockT>::Header> {
fn best_header(&self) -> sp_blockchain::Result<<Block as sp_runtime::traits::HeaderProvider>::Header> {
let best_hash = self.best_hash()?;
Ok(self
.backend
Expand Down Expand Up @@ -142,7 +142,7 @@ where
LongestChain::leaves(self).map_err(|e| ConsensusError::ChainLookup(e.to_string()))
}

async fn best_chain(&self) -> Result<<Block as BlockT>::Header, ConsensusError> {
async fn best_chain(&self) -> Result<<Block as sp_runtime::traits::HeaderProvider>::Header, ConsensusError> {
LongestChain::best_header(self).map_err(|e| ConsensusError::ChainLookup(e.to_string()))
}

Expand Down
4 changes: 2 additions & 2 deletions client/consensus/grandpa/src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ use crate::{
};

type HistoricalVotes<Block> = finality_grandpa::HistoricalVotes<
<Block as HeaderProvider>::Hash,
<Block as sp_runtime::traits::HeaderProvider>::Hash,
NumberFor<Block>,
AuthoritySignature,
AuthorityId,
Expand Down Expand Up @@ -167,7 +167,7 @@ impl<Block: BlockT> CompletedRounds<Block> {

/// A map with voter status information for currently live rounds,
/// which votes have we cast and what are they.
pub type CurrentRounds<Block> = BTreeMap<RoundNumber, HasVoted<<Block as BlockT>::Header>>;
pub type CurrentRounds<Block> = BTreeMap<RoundNumber, HasVoted<<Block as sp_runtime::traits::HeaderProvider>::Header>>;

/// The state of the current voter set, whether it is currently active or not
/// and information related to the previously completed rounds. Current round
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/grandpa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ mod tests;
/// exposed publicly, used internally to simplify types in the communication
/// layer.
type CommunicationIn<Block> = voter::CommunicationIn<
<Block as HeaderProvider>::Hash,
<Block as sp_runtime::traits::HeaderProvider>::Hash,
NumberFor<Block>,
AuthoritySignature,
AuthorityId,
Expand Down
12 changes: 6 additions & 6 deletions client/consensus/grandpa/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ impl GenesisAuthoritySetProvider<Block> for TestApi {
#[derive(Clone, Default)]
struct MockSelectChain {
leaves: Arc<Mutex<Option<Vec<Hash>>>>,
best_chain: Arc<Mutex<Option<<Block as BlockT>::Header>>>,
best_chain: Arc<Mutex<Option<<Block as sp_runtime::traits::HeaderProvider>::Header>>>,
finality_target: Arc<Mutex<Option<Hash>>>,
}

impl MockSelectChain {
fn set_best_chain(&self, best: <Block as BlockT>::Header) {
fn set_best_chain(&self, best: <Block as sp_runtime::traits::HeaderProvider>::Header) {
*self.best_chain.lock() = Some(best);
}

Expand All @@ -232,7 +232,7 @@ impl SelectChain<Block> for MockSelectChain {
Ok(self.leaves.lock().take().unwrap())
}

async fn best_chain(&self) -> Result<<Block as BlockT>::Header, ConsensusError> {
async fn best_chain(&self) -> Result<<Block as sp_runtime::traits::HeaderProvider>::Header, ConsensusError> {
Ok(self.best_chain.lock().take().unwrap())
}

Expand All @@ -256,9 +256,9 @@ where
fn restrict_vote(
&self,
_backend: Arc<B>,
_base: &<Block as BlockT>::Header,
best_target: &<Block as BlockT>::Header,
_current_target: &<Block as BlockT>::Header,
_base: &<Block as sp_runtime::traits::HeaderProvider>::Header,
best_target: &<Block as sp_runtime::traits::HeaderProvider>::Header,
_current_target: &<Block as sp_runtime::traits::HeaderProvider>::Header,
) -> VotingRuleResult<Block> {
if let Some(expected) = *self.0.lock() {
assert_eq!(best_target.hash(), expected);
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/grandpa/src/until_imported.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ pub(crate) type UntilVoteTargetImported<Block, BlockStatus, BlockSyncRequester,
BlockStatus,
BlockSyncRequester,
I,
SignedMessage<<Block as BlockT>::Header>,
SignedMessage<<Block as sp_runtime::traits::HeaderProvider>::Header>,
>;

/// This blocks a global message import, i.e. a commit or catch up messages,
Expand Down
Loading