Skip to content

Commit

Permalink
chore: clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielMartinezRodriguez committed Nov 20, 2023
1 parent 63c2c06 commit aec4240
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
7 changes: 2 additions & 5 deletions client/authorship/src/authorship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,7 @@ where
};

// If we pull successfully from the zero gas transaction pool, we will try to push them to the block


let reason = if let Some(raw_zero_gas_transactions) = raw_zero_gas_transactions_option {
if let Some(raw_zero_gas_transactions) = raw_zero_gas_transactions_option {
let mut pending_raw_zero_gas_transactions = raw_zero_gas_transactions.transactions.into_iter();

let chain_id = self
Expand All @@ -495,7 +493,7 @@ where

let current_block = self.parent_number.saturated_into::<u32>().saturating_add(1);

let message: Vec<u8> = b"I consent to validate to execute zero gas transactions in block "
let message: Vec<u8> = b"I consent to validate zero gas transactions in block "
.iter()
.chain(current_block.to_string().as_bytes().iter())
.chain(b" on chain ")
Expand All @@ -522,7 +520,6 @@ where
let pending_hex_string_tx = if let Some(tx) = pending_raw_zero_gas_transactions.next() {
tx
} else {
debug!("No more transactions in the zero gas transaction pool");
break EndProposingReason::NoMoreTransactions;
};

Expand Down
6 changes: 2 additions & 4 deletions pallets/zero-gas-transactions/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,13 @@ pub mod pallet {
block_number: u32,
chain_id: u64,
) -> Vec<u8> {
let mut message: Vec<u8> = b"I consent to validate to execute zero gas transactions in block "
b"I consent to validate zero gas transactions in block "
.iter()
.chain(block_number.to_string().as_bytes().iter())
.chain(b" on chain ")
.chain(chain_id.to_string().as_bytes().iter())
.cloned()
.collect();

return message;
.collect()
}

fn get_zero_gas_trx_signer(signature: Vec<u8>, message: H256) -> Option<H160> {
Expand Down

0 comments on commit aec4240

Please sign in to comment.