From 40ef8e0c0f72257454ae794755a865a5a352a34e Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 12 Jul 2022 17:00:52 +0000 Subject: [PATCH] doc(pallet-evm-transaction-payment): document public api --- --- /dev/null +++ b/pallets/evm-transaction-payment/README.md @@ -0,0 +1,5 @@ +# Evm transaction payment pallet + +pallet-evm-transaction-payment is a bridge between pallet-evm substrate calls and pallet-sponsoring. +It doesn't provide any sponsoring logic by itself, instead all sponsoring handlers +are loosly coupled via [`Config::EvmSponsorshipHandler`] trait. \ No newline at end of file --- a/pallets/evm-transaction-payment/src/lib.rs +++ b/pallets/evm-transaction-payment/src/lib.rs @@ -14,7 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +#![doc = include_str!("../README.md")] #![cfg_attr(not(feature = "std"), no_std)] +#![deny(missing_docs)] use core::marker::PhantomData; use fp_evm::WithdrawReason; @@ -29,13 +31,12 @@ pub mod pallet { use super::*; - use frame_support::traits::Currency; use sp_std::vec::Vec; #[pallet::config] pub trait Config: frame_system::Config + pallet_evm::account::Config { + /// Loosly-coupled handlers for evm call sponsoring type EvmSponsorshipHandler: SponsorshipHandler)>; - type Currency: Currency; } #[pallet::pallet] @@ -43,6 +44,7 @@ pub struct Pallet(_); } +/// Implements [`fp_evm::TransactionValidityHack`], which provides sponsor address to pallet-evm pub struct TransactionValidityHack(PhantomData<*const T>); impl fp_evm::TransactionValidityHack for TransactionValidityHack { fn who_pays_fee(origin: H160, reason: &WithdrawReason) -> Option { -- gitstuff