Skip to content

Commit 8edc903

Browse files
acatangiubkchr
authored andcommitted
runtimes: fix call_size() test (#1245)
Signed-off-by: acatangiu <[email protected]>
1 parent b84d0e4 commit 8edc903

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

bridges/bin/millau/runtime/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,15 @@ mod tests {
922922

923923
#[test]
924924
fn call_size() {
925+
const BRIDGES_PALLETS_MAX_CALL_SIZE: usize = 200;
926+
assert!(
927+
core::mem::size_of::<pallet_bridge_grandpa::Call<Runtime>>() <=
928+
BRIDGES_PALLETS_MAX_CALL_SIZE
929+
);
930+
assert!(
931+
core::mem::size_of::<pallet_bridge_messages::Call<Runtime>>() <=
932+
BRIDGES_PALLETS_MAX_CALL_SIZE
933+
);
925934
const MAX_CALL_SIZE: usize = 230; // value from polkadot-runtime tests
926935
assert!(core::mem::size_of::<Call>() <= MAX_CALL_SIZE);
927936
}

bridges/bin/rialto/runtime/src/lib.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,10 +1229,19 @@ mod tests {
12291229

12301230
#[test]
12311231
fn call_size() {
1232-
const DOT_MAX_CALL_SZ: usize = 230;
1233-
assert!(core::mem::size_of::<pallet_bridge_grandpa::Call<Runtime>>() <= DOT_MAX_CALL_SZ);
1234-
// FIXME: get this down to 230. https://github.com/paritytech/grandpa-bridge-gadget/issues/359
1235-
const BEEFY_MAX_CALL_SZ: usize = 232;
1236-
assert!(core::mem::size_of::<pallet_bridge_messages::Call<Runtime>>() <= BEEFY_MAX_CALL_SZ);
1232+
const BRIDGES_PALLETS_MAX_CALL_SIZE: usize = 200;
1233+
assert!(
1234+
core::mem::size_of::<pallet_bridge_grandpa::Call<Runtime>>() <=
1235+
BRIDGES_PALLETS_MAX_CALL_SIZE
1236+
);
1237+
assert!(
1238+
core::mem::size_of::<pallet_bridge_messages::Call<Runtime>>() <=
1239+
BRIDGES_PALLETS_MAX_CALL_SIZE
1240+
);
1241+
// Largest inner Call is `pallet_session::Call` with a size of 224 bytes. This size is a
1242+
// result of large `SessionKeys` struct.
1243+
// Total size of Rialto runtime Call is 232.
1244+
const MAX_CALL_SIZE: usize = 232;
1245+
assert!(core::mem::size_of::<Call>() <= MAX_CALL_SIZE);
12371246
}
12381247
}

0 commit comments

Comments
 (0)