Struct polymesh_api::polymesh::api::corporate_ballot::CallApi
source · pub struct CallApi<'api> { /* private fields */ }Implementations§
source§impl<'api> CallApi<'api>
impl<'api> CallApi<'api>
sourcepub fn attach_ballot(
&self,
ca_id: CAId,
range: BallotTimeRange,
meta: BallotMeta,
rcv: bool
) -> Result<WrappedCall<'api>>
pub fn attach_ballot(
&self,
ca_id: CAId,
range: BallotTimeRange,
meta: BallotMeta,
rcv: bool
) -> Result<WrappedCall<'api>>
Attach a corporate ballot to the CA identified by ca_id.
The ballot will admit votes within range.
The ballot’s metadata is provided by meta,
which includes the ballot title, the motions, their choices, etc.
See the BallotMeta for more.
Arguments
originis a signer that has permissions to act as an agent ofca_id.ticker.ca_ididentifies the CA to attach the ballot to.rangespecifies when voting starts and ends.metaspecifies the ballot’s metadata as aforementioned.rcvspecifies whether RCV is enabled for this ballot.
Errors
UnauthorizedAgentiforiginis not agent-permissioned forticker.NoSuchCAifca_iddoes not identify an existing CA.CANotNoticeif the CA is not of theIssuerNoticekind.StartAfterEndifrange.start > range.end.NowAfterEndifnow > range.endwherenowis the current timestamp.NoRecordDateif CA has no record date.RecordDateAfterStartifdate > range.startwheredateis the CA’s record date.AlreadyExistsif there’s a ballot already.NumberOfChoicesOverflowif the total choice inmetaoverflowsusize.TooLongif any of the embedded strings inmetaare too long.InsufficientBalanceif the protocol fee couldn’t be charged.
sourcepub fn vote(
&self,
ca_id: CAId,
votes: Vec<BallotVote>
) -> Result<WrappedCall<'api>>
pub fn vote(
&self,
ca_id: CAId,
votes: Vec<BallotVote>
) -> Result<WrappedCall<'api>>
Cast votes in the ballot attached to the CA identified by ca_id.
Arguments
originwhich must be a permissioned signer targeted by the CA.ca_ididentifies the attached ballot’s CA.votesspecifies the balances to assign to each choice in the ballot. The full voting power oforigin’s DID may be used for each motion in the ballot.
Errors
NoSuchBallotifca_iddoes not identify a ballot.VotingNotStartedif the voting period hasn’t commenced yet.VotingAlreadyEndedif the voting period has ended.WrongVoteCountif the number of choices in the ballot does not matchvotes.len().NoSuchCAifca_iddoes not identify an existing CA.NotTargetedByCAif the CA does not targetorigin’s DID.InsufficientVotesif the voting power used for any motion invotesexceedsorigin’s DID’s voting power.
sourcepub fn change_end(&self, ca_id: CAId, end: u64) -> Result<WrappedCall<'api>>
pub fn change_end(&self, ca_id: CAId, end: u64) -> Result<WrappedCall<'api>>
Amend the end date of the ballot of the CA identified by ca_id.
Arguments
originis a signer that has permissions to act as an agent ofca_id.ticker.ca_ididentifies the attached ballot’s CA.endspecifies the new end date of the ballot.
Errors
UnauthorizedAgentiforiginis not agent-permissioned forticker.NoSuchBallotifca_iddoes not identify a ballot.VotingAlreadyStartedifstart >= now, wherenowis the current time.StartAfterEndifstart > end.
sourcepub fn change_meta(
&self,
ca_id: CAId,
meta: BallotMeta
) -> Result<WrappedCall<'api>>
pub fn change_meta(
&self,
ca_id: CAId,
meta: BallotMeta
) -> Result<WrappedCall<'api>>
Amend the metadata (title, motions, etc.) of the ballot of the CA identified by ca_id.
Arguments
originis a signer that has permissions to act as an agent ofca_id.ticker.ca_ididentifies the attached ballot’s CA.metaspecifies the new metadata.
Errors
UnauthorizedAgentiforiginis not agent-permissioned forticker.NoSuchBallotifca_iddoes not identify a ballot.VotingAlreadyStartedifstart >= now, wherenowis the current time.NumberOfChoicesOverflowif the total choice inmetaoverflowsusize.TooLongif any of the embedded strings inmetaare too long.
sourcepub fn change_rcv(&self, ca_id: CAId, rcv: bool) -> Result<WrappedCall<'api>>
pub fn change_rcv(&self, ca_id: CAId, rcv: bool) -> Result<WrappedCall<'api>>
Amend RCV support for the ballot of the CA identified by ca_id.
Arguments
originis a signer that has permissions to act as an agent ofca_id.ticker.ca_ididentifies the attached ballot’s CA.rcvspecifies if RCV is to be supported or not.
Errors
UnauthorizedAgentiforiginis not agent-permissioned forticker.NoSuchBallotifca_iddoes not identify a ballot.VotingAlreadyStartedifstart >= now, wherenowis the current time.
sourcepub fn remove_ballot(&self, ca_id: CAId) -> Result<WrappedCall<'api>>
pub fn remove_ballot(&self, ca_id: CAId) -> Result<WrappedCall<'api>>
Remove the ballot of the CA identified by ca_id.
Arguments
originis a signer that has permissions to act as an agent ofca_id.ticker.ca_ididentifies the attached ballot’s CA.
Errors
UnauthorizedAgentiforiginis not agent-permissioned forticker.NoSuchBallotifca_iddoes not identify a ballot.VotingAlreadyStartedifstart >= now, wherenowis the current time.
Trait Implementations§
Auto Trait Implementations§
impl<'api> !RefUnwindSafe for CallApi<'api>
impl<'api> Send for CallApi<'api>
impl<'api> Sync for CallApi<'api>
impl<'api> Unpin for CallApi<'api>
impl<'api> !UnwindSafe for CallApi<'api>
Blanket Implementations§
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read more§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read moresource§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T. Read more§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T.