From 3b8e74b39356f2a4d8c4b4ccc751405d5e6d3af3 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 26 Aug 2025 17:45:10 +0200 Subject: [PATCH 1/2] require PortTokensNonce compact encoding --- porteer/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/porteer/src/lib.rs b/porteer/src/lib.rs index 7042720e..5aebbc7c 100644 --- a/porteer/src/lib.rs +++ b/porteer/src/lib.rs @@ -39,7 +39,7 @@ pub mod weights; pub use crate::weights::WeightInfo; use frame_support::{transactional, Parameter}; pub use pallet::*; -use parity_scale_codec::MaxEncodedLen; +use parity_scale_codec::{DecodeWithMemTracking, HasCompact, MaxEncodedLen}; use sp_runtime::{ traits::{AtLeast32BitUnsigned, MaybeSerializeDeserialize, Member}, DispatchError, @@ -450,7 +450,7 @@ pub mod pallet { beneficiary: AccountIdOf, amount: BalanceOf, forward_tokens_to_location: Option, - source_nonce: PortTokensNonceOf, + #[pallet::compact] source_nonce: PortTokensNonceOf, ) -> DispatchResult { let _signer = T::TokenSenderLocationOrigin::ensure_origin(origin)?; @@ -499,6 +499,7 @@ pub trait PortTokens { + Default + Copy + MaybeSerializeDeserialize + + HasCompact + MaxEncodedLen; type Location; From a8f4addfc221f839456910ad0fe306ca2a9f68e4 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 26 Aug 2025 17:56:31 +0200 Subject: [PATCH 2/2] more compact args --- porteer/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/porteer/src/lib.rs b/porteer/src/lib.rs index 5aebbc7c..d991930b 100644 --- a/porteer/src/lib.rs +++ b/porteer/src/lib.rs @@ -389,7 +389,7 @@ pub mod pallet { #[pallet::weight(< T as Config >::WeightInfo::port_tokens())] pub fn port_tokens( origin: OriginFor, - amount: BalanceOf, + #[pallet::compact] amount: BalanceOf, forward_tokens_to_location: Option, ) -> DispatchResult { let signer = ensure_signed(origin)?; @@ -448,7 +448,7 @@ pub mod pallet { pub fn mint_ported_tokens( origin: OriginFor, beneficiary: AccountIdOf, - amount: BalanceOf, + #[pallet::compact] amount: BalanceOf, forward_tokens_to_location: Option, #[pallet::compact] source_nonce: PortTokensNonceOf, ) -> DispatchResult {