mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-12 05:59:23 +00:00
Compare commits
4 Commits
8970031f42
...
fd50192ba1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd50192ba1 | ||
|
|
3fd12a8910 | ||
|
|
74296a0775 | ||
|
|
55ed33d2d1 |
@@ -383,9 +383,11 @@ sp_api::impl_runtime_apis! {
|
|||||||
fn execute_block(block: Block) {
|
fn execute_block(block: Block) {
|
||||||
for tx in &block.extrinsics {
|
for tx in &block.extrinsics {
|
||||||
if let Some(signer) = tx.signer() {
|
if let Some(signer) = tx.signer() {
|
||||||
let signer = signer.0.into();
|
let signer = PublicKey::from(signer.0);
|
||||||
if System::providers(&signer) == 0 {
|
let mut info = frame_system::Account::<Runtime>::get(signer);
|
||||||
System::inc_providers(&signer);
|
if info.providers == 0 {
|
||||||
|
info.providers = 1;
|
||||||
|
frame_system::Account::<Runtime>::set(signer, info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -401,9 +403,11 @@ sp_api::impl_runtime_apis! {
|
|||||||
impl sp_block_builder::BlockBuilder<Block> for Runtime {
|
impl sp_block_builder::BlockBuilder<Block> for Runtime {
|
||||||
fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
|
fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
|
||||||
if let Some(signer) = extrinsic.signer() {
|
if let Some(signer) = extrinsic.signer() {
|
||||||
let signer = signer.0.into();
|
let signer = PublicKey::from(signer.0);
|
||||||
if System::providers(&signer) == 0 {
|
let mut info = frame_system::Account::<Runtime>::get(signer);
|
||||||
System::inc_providers(&signer);
|
if info.providers == 0 {
|
||||||
|
info.providers = 1;
|
||||||
|
frame_system::Account::<Runtime>::set(signer, info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Executive::apply_extrinsic(extrinsic)
|
Executive::apply_extrinsic(extrinsic)
|
||||||
@@ -432,9 +436,11 @@ sp_api::impl_runtime_apis! {
|
|||||||
block_hash: <Block as BlockT>::Hash,
|
block_hash: <Block as BlockT>::Hash,
|
||||||
) -> TransactionValidity {
|
) -> TransactionValidity {
|
||||||
if let Some(signer) = tx.signer() {
|
if let Some(signer) = tx.signer() {
|
||||||
let signer = signer.0.into();
|
let signer = PublicKey::from(signer.0);
|
||||||
if System::providers(&signer) == 0 {
|
let mut info = frame_system::Account::<Runtime>::get(signer);
|
||||||
System::inc_providers(&signer);
|
if info.providers == 0 {
|
||||||
|
info.providers = 1;
|
||||||
|
frame_system::Account::<Runtime>::set(signer, info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Executive::validate_transaction(source, tx, block_hash)
|
Executive::validate_transaction(source, tx, block_hash)
|
||||||
|
|||||||
Reference in New Issue
Block a user