From 01c67bee1d825fe7160207a00f45df70793e69ef Mon Sep 17 00:00:00 2001 From: Adrian Catangiu Date: Wed, 8 Dec 2021 08:27:24 +0200 Subject: [PATCH] runtimes: fix call_size() test (#1245) Signed-off-by: acatangiu --- bridges/bin/millau/runtime/src/lib.rs | 9 +++++++++ bridges/bin/rialto/runtime/src/lib.rs | 19 ++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/bridges/bin/millau/runtime/src/lib.rs b/bridges/bin/millau/runtime/src/lib.rs index be186569961db..4400191d940c9 100644 --- a/bridges/bin/millau/runtime/src/lib.rs +++ b/bridges/bin/millau/runtime/src/lib.rs @@ -922,6 +922,15 @@ mod tests { #[test] fn call_size() { + const BRIDGES_PALLETS_MAX_CALL_SIZE: usize = 200; + assert!( + core::mem::size_of::>() <= + BRIDGES_PALLETS_MAX_CALL_SIZE + ); + assert!( + core::mem::size_of::>() <= + BRIDGES_PALLETS_MAX_CALL_SIZE + ); const MAX_CALL_SIZE: usize = 230; // value from polkadot-runtime tests assert!(core::mem::size_of::() <= MAX_CALL_SIZE); } diff --git a/bridges/bin/rialto/runtime/src/lib.rs b/bridges/bin/rialto/runtime/src/lib.rs index 59be1186b4093..8619cbade7934 100644 --- a/bridges/bin/rialto/runtime/src/lib.rs +++ b/bridges/bin/rialto/runtime/src/lib.rs @@ -1229,10 +1229,19 @@ mod tests { #[test] fn call_size() { - const DOT_MAX_CALL_SZ: usize = 230; - assert!(core::mem::size_of::>() <= DOT_MAX_CALL_SZ); - // FIXME: get this down to 230. https://github.com/paritytech/grandpa-bridge-gadget/issues/359 - const BEEFY_MAX_CALL_SZ: usize = 232; - assert!(core::mem::size_of::>() <= BEEFY_MAX_CALL_SZ); + const BRIDGES_PALLETS_MAX_CALL_SIZE: usize = 200; + assert!( + core::mem::size_of::>() <= + BRIDGES_PALLETS_MAX_CALL_SIZE + ); + assert!( + core::mem::size_of::>() <= + BRIDGES_PALLETS_MAX_CALL_SIZE + ); + // Largest inner Call is `pallet_session::Call` with a size of 224 bytes. This size is a + // result of large `SessionKeys` struct. + // Total size of Rialto runtime Call is 232. + const MAX_CALL_SIZE: usize = 232; + assert!(core::mem::size_of::() <= MAX_CALL_SIZE); } }