Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Oct 5, 2024
1 parent 772901c commit 6ff36bb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 24 deletions.
24 changes: 13 additions & 11 deletions app-libs/stf/src/getter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,27 +95,29 @@ impl PoolTransactionValidation for Getter {
#[derive(Encode, Decode, Clone, Debug, PartialEq, Eq)]
#[allow(non_camel_case_types)]
#[repr(u8)]
#[allow(clippy::unnecessary_cast)]
pub enum PublicGetter {
some_value = 0u8,
total_issuance = 1u8,
guess_the_number_last_lucky_number = 50u8,
guess_the_number_last_winning_distance = 51u8,
guess_the_number_info = 52u8,
some_value = 0,
total_issuance = 1,
guess_the_number_last_lucky_number = 50,
guess_the_number_last_winning_distance = 51,
guess_the_number_info = 52,
}

#[derive(Encode, Decode, Clone, Debug, PartialEq, Eq)]
#[allow(non_camel_case_types)]
#[repr(u8)]
#[allow(clippy::unnecessary_cast)]
pub enum TrustedGetter {
free_balance(AccountId) = 0u8,
reserved_balance(AccountId) = 1u8,
nonce(AccountId) = 2u8,
free_balance(AccountId) = 0,
reserved_balance(AccountId) = 1,
nonce(AccountId) = 2,
#[cfg(feature = "evm")]
evm_nonce(AccountId) = 80u8,
evm_nonce(AccountId) = 80,
#[cfg(feature = "evm")]
evm_account_codes(AccountId, H160) = 81u8,
evm_account_codes(AccountId, H160) = 81,
#[cfg(feature = "evm")]
evm_account_storages(AccountId, H160, H256) = 82u8,
evm_account_storages(AccountId, H160, H256) = 82,
}

impl TrustedGetter {
Expand Down
27 changes: 14 additions & 13 deletions app-libs/stf/src/trusted_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,18 @@ use std::{format, prelude::v1::*, sync::Arc};
#[derive(Encode, Decode, Clone, Debug, PartialEq, Eq)]
#[allow(non_camel_case_types)]
#[repr(u8)]
#[allow(clippy::unnecessary_cast)]
pub enum TrustedCall {
noop(AccountId) = 0u8,
timestamp_set(AccountId, Moment, ParentchainId) = 1u8, // (Root, now)
balance_transfer(AccountId, AccountId, Balance) = 2u8,
balance_unshield(AccountId, AccountId, Balance, ShardIdentifier) = 3u8, // (AccountIncognito, BeneficiaryPublicAccount, Amount, Shard)
balance_shield(AccountId, AccountId, Balance, ParentchainId) = 4u8, // (Root, AccountIncognito, Amount, origin parentchain)
guess_the_number_set_winnings(AccountId, Balance) = 50u8,
guess_the_number_push_by_one_day(AccountId) = 51u8,
guess_the_number(AccountId, GuessType) = 52u8,
noop(AccountId) = 0,
timestamp_set(AccountId, Moment, ParentchainId) = 1, // (Root, now)
balance_transfer(AccountId, AccountId, Balance) = 2,
balance_unshield(AccountId, AccountId, Balance, ShardIdentifier) = 3, // (AccountIncognito, BeneficiaryPublicAccount, Amount, Shard)
balance_shield(AccountId, AccountId, Balance, ParentchainId) = 4, // (Root, AccountIncognito, Amount, origin parentchain)
guess_the_number_set_winnings(AccountId, Balance) = 50,
guess_the_number_push_by_one_day(AccountId) = 51,
guess_the_number(AccountId, GuessType) = 52,
#[cfg(feature = "evm")]
evm_withdraw(AccountId, H160, Balance) = 90u8, // (Origin, Address EVM Account, Value)
evm_withdraw(AccountId, H160, Balance) = 90, // (Origin, Address EVM Account, Value)
// (Origin, Source, Target, Input, Value, Gas limit, Max fee per gas, Max priority fee per gas, Nonce, Access list)
#[cfg(feature = "evm")]
evm_call(
Expand All @@ -88,7 +89,7 @@ pub enum TrustedCall {
Option<U256>,
Option<U256>,
Vec<(H160, Vec<H256>)>,
) = 91u8,
) = 91,
// (Origin, Source, Init, Value, Gas limit, Max fee per gas, Max priority fee per gas, Nonce, Access list)
#[cfg(feature = "evm")]
evm_create(
Expand All @@ -101,7 +102,7 @@ pub enum TrustedCall {
Option<U256>,
Option<U256>,
Vec<(H160, Vec<H256>)>,
) = 92u8,
) = 92,
// (Origin, Source, Init, Salt, Value, Gas limit, Max fee per gas, Max priority fee per gas, Nonce, Access list)
#[cfg(feature = "evm")]
evm_create2(
Expand All @@ -115,9 +116,9 @@ pub enum TrustedCall {
Option<U256>,
Option<U256>,
Vec<(H160, Vec<H256>)>,
) = 93u8,
) = 93,
#[cfg(any(feature = "test", test))]
balance_set_balance(AccountId, AccountId, Balance, Balance) = 255u8,
balance_set_balance(AccountId, AccountId, Balance, Balance) = 255,
}

impl TrustedCall {
Expand Down

0 comments on commit 6ff36bb

Please sign in to comment.