mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 04:09:23 +00:00
Give one weight per key share to validators in Tributary
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use sp_core::sr25519::{Public, Signature};
|
||||
|
||||
use serai_runtime::{validator_sets, ValidatorSets, Runtime};
|
||||
use serai_runtime::{primitives::Amount, validator_sets, ValidatorSets, Runtime};
|
||||
pub use validator_sets::primitives;
|
||||
use primitives::{Session, ValidatorSet, KeyPair};
|
||||
|
||||
@@ -47,6 +47,23 @@ impl Serai {
|
||||
self.storage(PALLET, "Participants", Some(vec![scale_value(network)]), at_hash).await
|
||||
}
|
||||
|
||||
pub async fn get_allocation_per_key_share(
|
||||
&self,
|
||||
network: NetworkId,
|
||||
at_hash: [u8; 32],
|
||||
) -> Result<Option<Amount>, SeraiError> {
|
||||
self.storage(PALLET, "AllocationPerKeyShare", Some(vec![scale_value(network)]), at_hash).await
|
||||
}
|
||||
|
||||
pub async fn get_allocation(
|
||||
&self,
|
||||
network: NetworkId,
|
||||
key: Public,
|
||||
at_hash: [u8; 32],
|
||||
) -> Result<Option<Amount>, SeraiError> {
|
||||
self.storage(PALLET, "Allocations", Some(vec![scale_value(network), scale_value(key)]), at_hash).await
|
||||
}
|
||||
|
||||
pub async fn get_validator_set_musig_key(
|
||||
&self,
|
||||
set: ValidatorSet,
|
||||
|
||||
Reference in New Issue
Block a user