mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 19:17:58 +00:00
Build block without checking signatures (#4916)
* in executive * in other places * to UnsafeResult * move doc comment * apply suggestions * allow validity mocking for TestXt * add test * augment checkable instead of another trait * fix im online test * blockbuilder dihotomy * review suggestions * update test * Update client/block-builder/src/lib.rs * updae spec_version Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -41,6 +41,7 @@ use sp_runtime::{
|
||||
BlindCheckable, BlakeTwo256, Block as BlockT, Extrinsic as ExtrinsicT,
|
||||
GetNodeBlockType, GetRuntimeBlockType, Verify, IdentityLookup,
|
||||
},
|
||||
generic::CheckSignature,
|
||||
};
|
||||
use sp_version::RuntimeVersion;
|
||||
pub use sp_core::{hash::H256};
|
||||
@@ -126,7 +127,7 @@ impl serde::Serialize for Extrinsic {
|
||||
impl BlindCheckable for Extrinsic {
|
||||
type Checked = Self;
|
||||
|
||||
fn check(self) -> Result<Self, TransactionValidityError> {
|
||||
fn check(self, _signature: CheckSignature) -> Result<Self, TransactionValidityError> {
|
||||
match self {
|
||||
Extrinsic::AuthoritiesChange(new_auth) => Ok(Extrinsic::AuthoritiesChange(new_auth)),
|
||||
Extrinsic::Transfer(transfer, signature) => {
|
||||
@@ -493,6 +494,10 @@ cfg_if! {
|
||||
system::execute_transaction(extrinsic)
|
||||
}
|
||||
|
||||
fn apply_trusted_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
|
||||
system::execute_transaction(extrinsic)
|
||||
}
|
||||
|
||||
fn finalize_block() -> <Block as BlockT>::Header {
|
||||
system::finalize_block()
|
||||
}
|
||||
@@ -680,6 +685,10 @@ cfg_if! {
|
||||
system::execute_transaction(extrinsic)
|
||||
}
|
||||
|
||||
fn apply_trusted_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
|
||||
system::execute_transaction(extrinsic)
|
||||
}
|
||||
|
||||
fn finalize_block() -> <Block as BlockT>::Header {
|
||||
system::finalize_block()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user