Skip to content

Commit

Permalink
validator/utils: ultra minor tiny cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aggstam committed Oct 19, 2023
1 parent 276ab6a commit dcf8ce6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/validator/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ pub fn genesis_txs_total(txs: &[Transaction]) -> Result<u64> {
return Err(TxVerifyFailed::ErroneousTxs(vec![tx.clone()]).into())
}
let call = &tx.calls[0];
let function = call.data[0];
let data = &call.data;
let function = data[0];
if !(call.contract_id == *CONSENSUS_CONTRACT_ID || call.contract_id == *MONEY_CONTRACT_ID) ||
(call.contract_id == *CONSENSUS_CONTRACT_ID && function != 0x00_u8) ||
(call.contract_id == *MONEY_CONTRACT_ID && function != 0x01_u8)
Expand All @@ -205,7 +206,6 @@ pub fn genesis_txs_total(txs: &[Transaction]) -> Result<u64> {
// Consensus::GenesisStake uses ConsensusGenesisStakeParamsV1, while
// Money::GenesisMint uses MoneyGenesisMintParamsV1. Both params structs
// have the value at same position (1).
let data = &tx.calls[0].data;
let position = 1;
let mut decoder = Cursor::new(&data);
decoder.set_position(position);
Expand Down

0 comments on commit dcf8ce6

Please sign in to comment.