difftreelog
doc(pallet-evm-transaction-payment): document public api
in: master
2 files changed
pallets/evm-transaction-payment/README.mddiffbeforeafterbothno changes
pallets/evm-transaction-payment/src/lib.rsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.161617#![doc = include_str!("../README.md")]17#![cfg_attr(not(feature = "std"), no_std)]18#![cfg_attr(not(feature = "std"), no_std)]19#![deny(missing_docs)]182019use core::marker::PhantomData;21use core::marker::PhantomData;20use fp_evm::WithdrawReason;22use fp_evm::WithdrawReason;29pub mod pallet {31pub mod pallet {30 use super::*;32 use super::*;313332 use frame_support::traits::Currency;33 use sp_std::vec::Vec;34 use sp_std::vec::Vec;343535 #[pallet::config]36 #[pallet::config]36 pub trait Config: frame_system::Config + pallet_evm::account::Config {37 pub trait Config: frame_system::Config + pallet_evm::account::Config {38 /// Loosly-coupled handlers for evm call sponsoring37 type EvmSponsorshipHandler: SponsorshipHandler<Self::CrossAccountId, (H160, Vec<u8>)>;39 type EvmSponsorshipHandler: SponsorshipHandler<Self::CrossAccountId, (H160, Vec<u8>)>;38 type Currency: Currency<Self::AccountId>;39 }40 }404141 #[pallet::pallet]42 #[pallet::pallet]42 #[pallet::generate_store(pub(super) trait Store)]43 #[pallet::generate_store(pub(super) trait Store)]43 pub struct Pallet<T>(_);44 pub struct Pallet<T>(_);44}45}454647/// Implements [`fp_evm::TransactionValidityHack`], which provides sponsor address to pallet-evm46pub struct TransactionValidityHack<T: Config>(PhantomData<*const T>);48pub struct TransactionValidityHack<T: Config>(PhantomData<*const T>);47impl<T: Config> fp_evm::TransactionValidityHack<T::CrossAccountId> for TransactionValidityHack<T> {49impl<T: Config> fp_evm::TransactionValidityHack<T::CrossAccountId> for TransactionValidityHack<T> {48 fn who_pays_fee(origin: H160, reason: &WithdrawReason) -> Option<T::CrossAccountId> {50 fn who_pays_fee(origin: H160, reason: &WithdrawReason) -> Option<T::CrossAccountId> {