Update substrate/ to latest substrate

This commit is contained in:
Luke Parker 2023-01-16 15:52:11 -05:00
parent 19ab49cb8c
commit a1ecdbf2f3
No known key found for this signature in database
3 changed files with 4 additions and 8 deletions

View file

@ -184,6 +184,7 @@ impl pallet_assets::Config for Runtime {
type ApprovalDeposit = ConstU64<0>;
// Unused hooks
type CallbackHandle = ();
type Freezer = ();
type Extra = ();

View file

@ -21,7 +21,6 @@ use sp_runtime::{
Digest,
};
use sp_blockchain::HeaderBackend;
use sp_api::BlockId;
use sp_consensus::{Error, BlockOrigin, Proposer, Environment};
use sc_consensus::import_queue::IncomingBlock;
@ -200,9 +199,7 @@ impl<T: TendermintValidator> TendermintAuthority<T> {
};
// Get our first proposal
let proposal = authority
.get_proposal(&import.client.header(BlockId::Hash(last_hash)).unwrap().unwrap())
.await;
let proposal = authority.get_proposal(&import.client.header(last_hash).unwrap().unwrap()).await;
// Create the gossip network
// This has to be spawning the machine, else gossip fails for some reason

View file

@ -2,7 +2,6 @@ use std::{marker::PhantomData, sync::Arc, collections::HashMap};
use async_trait::async_trait;
use sp_api::BlockId;
use sp_runtime::traits::{Header, Block};
use sp_blockchain::{BlockStatus, HeaderBackend, Backend as BlockchainBackend};
use sp_consensus::{Error, CacheKeyId, BlockOrigin, SelectChain};
@ -15,13 +14,12 @@ use crate::{TendermintValidator, tendermint::TendermintImport};
impl<T: TendermintValidator> TendermintImport<T> {
fn check_already_in_chain(&self, hash: <T::Block as Block>::Hash) -> bool {
let id = BlockId::Hash(hash);
// If it's in chain, with justifications, return it's already on chain
// If it's in chain, without justifications, continue the block import process to import its
// justifications
// This can be triggered if the validators add a block, without justifications, yet the p2p
// process then broadcasts it with its justifications
(self.client.status(id).unwrap() == BlockStatus::InChain) &&
(self.client.status(hash).unwrap() == BlockStatus::InChain) &&
self.client.justifications(hash).unwrap().is_some()
}
}
@ -173,7 +171,7 @@ impl<B: Block, Be: Backend<B>> SelectChain<B> for TendermintSelectChain<B, Be> {
.0
.blockchain()
// There should always be a finalized block
.header(BlockId::Hash(self.0.blockchain().last_finalized().unwrap()))
.header(self.0.blockchain().last_finalized().unwrap())
// There should not be an error in retrieving it and since it's finalized, it should exist
.unwrap()
.unwrap(),