diff --git a/app-libs/stf/src/getter.rs b/app-libs/stf/src/getter.rs index 420132625..7f09ee1e3 100644 --- a/app-libs/stf/src/getter.rs +++ b/app-libs/stf/src/getter.rs @@ -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 { diff --git a/app-libs/stf/src/trusted_call.rs b/app-libs/stf/src/trusted_call.rs index 1eaef4561..ba72842ef 100644 --- a/app-libs/stf/src/trusted_call.rs +++ b/app-libs/stf/src/trusted_call.rs @@ -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( @@ -88,7 +89,7 @@ pub enum TrustedCall { Option, Option, Vec<(H160, Vec)>, - ) = 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( @@ -101,7 +102,7 @@ pub enum TrustedCall { Option, Option, Vec<(H160, Vec)>, - ) = 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( @@ -115,9 +116,9 @@ pub enum TrustedCall { Option, Option, Vec<(H160, Vec)>, - ) = 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 {