git.delta.rocks / unique-network / refs/commits / 40ef8e0c0f72

difftreelog

doc(pallet-evm-transaction-payment): document public api

Yaroslav Bolyukin2022-07-12parent: #68058b4.patch.diff
in: master

2 files changed

addedpallets/evm-transaction-payment/README.mddiffbeforeafterboth

no changes

modifiedpallets/evm-transaction-payment/src/lib.rsdiffbeforeafterboth
--- 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 <http://www.gnu.org/licenses/>.
 
+#![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<Self::CrossAccountId, (H160, Vec<u8>)>;
-		type Currency: Currency<Self::AccountId>;
 	}
 
 	#[pallet::pallet]
@@ -43,6 +44,7 @@
 	pub struct Pallet<T>(_);
 }
 
+/// Implements [`fp_evm::TransactionValidityHack`], which provides sponsor address to pallet-evm
 pub struct TransactionValidityHack<T: Config>(PhantomData<*const T>);
 impl<T: Config> fp_evm::TransactionValidityHack<T::CrossAccountId> for TransactionValidityHack<T> {
 	fn who_pays_fee(origin: H160, reason: &WithdrawReason) -> Option<T::CrossAccountId> {