mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 21:31:02 +00:00
Fix grumbles.
This commit is contained in:
@@ -51,11 +51,6 @@ pub use self::block::{Header, Block, Log, Digest};
|
|||||||
pub use self::block::Number as BlockNumber;
|
pub use self::block::Number as BlockNumber;
|
||||||
pub use self::transaction::{Transaction, UncheckedTransaction, Function, Proposal};
|
pub use self::transaction::{Transaction, UncheckedTransaction, Function, Proposal};
|
||||||
|
|
||||||
/// Virtual account ID that represents the idea of a dispatch/statement being signed by everybody
|
|
||||||
/// (who matters). Essentially this means that a majority of validators have decided it is
|
|
||||||
/// "correct".
|
|
||||||
pub const EVERYBODY: AccountId = [255u8; 32];
|
|
||||||
|
|
||||||
/// Alias to Ed25519 pubkey that identifies an account on the relay chain. This will almost
|
/// Alias to Ed25519 pubkey that identifies an account on the relay chain. This will almost
|
||||||
/// certainly continue to be the same as the substrate's `AuthorityId`.
|
/// certainly continue to be the same as the substrate's `AuthorityId`.
|
||||||
pub type AccountId = primitives::AuthorityId;
|
pub type AccountId = primitives::AuthorityId;
|
||||||
@@ -64,9 +59,6 @@ pub type AccountId = primitives::AuthorityId;
|
|||||||
/// exactly equivalent to what the substrate calls an "authority".
|
/// exactly equivalent to what the substrate calls an "authority".
|
||||||
pub type SessionKey = primitives::AuthorityId;
|
pub type SessionKey = primitives::AuthorityId;
|
||||||
|
|
||||||
/// Indentifier for a chain.
|
|
||||||
pub type ChainID = u64;
|
|
||||||
|
|
||||||
/// Index of a transaction in the relay chain.
|
/// Index of a transaction in the relay chain.
|
||||||
pub type TxOrder = u64;
|
pub type TxOrder = u64;
|
||||||
|
|
||||||
|
|||||||
@@ -183,6 +183,11 @@ impl FunctionId {
|
|||||||
use self::*;
|
use self::*;
|
||||||
let functions = [FunctionId::StakingStake, FunctionId::StakingUnstake,
|
let functions = [FunctionId::StakingStake, FunctionId::StakingUnstake,
|
||||||
FunctionId::StakingTransfer, FunctionId::SessionSetKey, FunctionId::TimestampSet,
|
FunctionId::StakingTransfer, FunctionId::SessionSetKey, FunctionId::TimestampSet,
|
||||||
|
FunctionId::CouncilVotePropose, FunctionId::CouncilVoteVote, FunctionId::CouncilVoteVeto,
|
||||||
|
FunctionId::CouncilSetApprovals, FunctionId::CouncilReapInactiveVoter,
|
||||||
|
FunctionId::CouncilRetractVoter, FunctionId::CouncilSubmitCandidacy,
|
||||||
|
FunctionId::CouncilPresentWinner, FunctionId::DemocracyPropose,
|
||||||
|
FunctionId::DemocracySecond, FunctionId::DemocracyVote,
|
||||||
];
|
];
|
||||||
functions.iter().map(|&f| f).find(|&f| value == f as u8)
|
functions.iter().map(|&f| f).find(|&f| value == f as u8)
|
||||||
}
|
}
|
||||||
@@ -218,7 +223,7 @@ pub enum Function {
|
|||||||
|
|
||||||
impl Slicable for Function {
|
impl Slicable for Function {
|
||||||
fn decode<I: Input>(input: &mut I) -> Option<Self> {
|
fn decode<I: Input>(input: &mut I) -> Option<Self> {
|
||||||
let id = try_opt!(u8::decode(input).and_then(FunctionId::from_u8));
|
let id = u8::decode(input).and_then(FunctionId::from_u8)?;
|
||||||
Some(match id {
|
Some(match id {
|
||||||
FunctionId::TimestampSet =>
|
FunctionId::TimestampSet =>
|
||||||
Function::TimestampSet(Slicable::decode(input)?),
|
Function::TimestampSet(Slicable::decode(input)?),
|
||||||
|
|||||||
@@ -258,11 +258,6 @@ pub fn leaderboard() -> Option<Vec<(Balance, AccountId)>> {
|
|||||||
pub mod public {
|
pub mod public {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
// CouncilVotePropose(AccountId, Proposal)
|
|
||||||
// CouncilVoteVote(AccountId, [u8; 32], bool)
|
|
||||||
// CouncilVoteVeto(AccountId, [u8; 32])
|
|
||||||
// CouncilSetApprovals(AccountId, Vec<bool>, u32)
|
|
||||||
// CouncilReapInactiveVoter(AccountId, u32, AccountId, u32, u32)
|
|
||||||
/// Set candidate approvals. Approval slots stay valid as long as candidates in those slots
|
/// Set candidate approvals. Approval slots stay valid as long as candidates in those slots
|
||||||
/// are registered.
|
/// are registered.
|
||||||
pub fn set_approvals(signed: &AccountId, votes: &Vec<bool>, index: VoteIndex) {
|
pub fn set_approvals(signed: &AccountId, votes: &Vec<bool>, index: VoteIndex) {
|
||||||
@@ -359,10 +354,6 @@ pub mod public {
|
|||||||
storage::put(&signed.to_keyed_vec(REGISTER_INFO_OF), &(vote_index(), slot));
|
storage::put(&signed.to_keyed_vec(REGISTER_INFO_OF), &(vote_index(), slot));
|
||||||
}
|
}
|
||||||
|
|
||||||
// CouncilRetractVoter(AccountId, u32)
|
|
||||||
// CouncilSubmitCandidacy(AccountId, u32)
|
|
||||||
// CouncilPresent(AccountId, u32)
|
|
||||||
|
|
||||||
/// Claim that `signed` is one of the top carry_count() + current_vote().1 candidates.
|
/// Claim that `signed` is one of the top carry_count() + current_vote().1 candidates.
|
||||||
/// Only works if the block number >= current_vote().0 and < current_vote().0 + presentation_duration()
|
/// Only works if the block number >= current_vote().0 and < current_vote().0 + presentation_duration()
|
||||||
/// `signed` should have at least
|
/// `signed` should have at least
|
||||||
|
|||||||
Reference in New Issue
Block a user