From a504d8eb872d4163695181c7ad67421bae05ebde Mon Sep 17 00:00:00 2001 From: Uncle Stretch Date: Thu, 27 Nov 2025 17:08:16 +0300 Subject: [PATCH] trait to get exposure from external pallets such as staking Signed-off-by: Uncle Stretch --- pallets/traits/src/exposure.rs | 7 +++++++ pallets/traits/src/lib.rs | 1 + 2 files changed, 8 insertions(+) create mode 100644 pallets/traits/src/exposure.rs diff --git a/pallets/traits/src/exposure.rs b/pallets/traits/src/exposure.rs new file mode 100644 index 0000000..df8fe78 --- /dev/null +++ b/pallets/traits/src/exposure.rs @@ -0,0 +1,7 @@ +use sp_runtime::traits::AtLeast32BitUnsigned; + +pub trait ExposureListener { + fn get_current_era() -> EraIndex; + fn get_total_exposure(era: EraIndex) -> Balance; + fn get_validator_exposure(index: AuthIndex) -> Balance; +} diff --git a/pallets/traits/src/lib.rs b/pallets/traits/src/lib.rs index 4d8e9f7..619e5b1 100644 --- a/pallets/traits/src/lib.rs +++ b/pallets/traits/src/lib.rs @@ -1,3 +1,4 @@ #![cfg_attr(not(feature = "std"), no_std)] pub mod networks; +pub mod exposure;