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
origin
is a signer that has permissions to act as an agent ofca_id.ticker
.ca_id
identifies the CA to attach the ballot to.range
specifies when voting starts and ends.meta
specifies the ballot’s metadata as aforementioned.rcv
specifies whether RCV is enabled for this ballot.
Errors
UnauthorizedAgent
iforigin
is not agent-permissioned forticker
.NoSuchCA
ifca_id
does not identify an existing CA.CANotNotice
if the CA is not of theIssuerNotice
kind.StartAfterEnd
ifrange.start > range.end
.NowAfterEnd
ifnow > range.end
wherenow
is the current timestamp.NoRecordDate
if CA has no record date.RecordDateAfterStart
ifdate > range.start
wheredate
is the CA’s record date.AlreadyExists
if there’s a ballot already.NumberOfChoicesOverflow
if the total choice inmeta
overflowsusize
.TooLong
if any of the embedded strings inmeta
are too long.InsufficientBalance
if 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
origin
which must be a permissioned signer targeted by the CA.ca_id
identifies the attached ballot’s CA.votes
specifies 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
NoSuchBallot
ifca_id
does not identify a ballot.VotingNotStarted
if the voting period hasn’t commenced yet.VotingAlreadyEnded
if the voting period has ended.WrongVoteCount
if the number of choices in the ballot does not matchvotes.len()
.NoSuchCA
ifca_id
does not identify an existing CA.NotTargetedByCA
if the CA does not targetorigin
’s DID.InsufficientVotes
if the voting power used for any motion invotes
exceedsorigin
’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
origin
is a signer that has permissions to act as an agent ofca_id.ticker
.ca_id
identifies the attached ballot’s CA.end
specifies the new end date of the ballot.
Errors
UnauthorizedAgent
iforigin
is not agent-permissioned forticker
.NoSuchBallot
ifca_id
does not identify a ballot.VotingAlreadyStarted
ifstart >= now
, wherenow
is the current time.StartAfterEnd
ifstart > 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
origin
is a signer that has permissions to act as an agent ofca_id.ticker
.ca_id
identifies the attached ballot’s CA.meta
specifies the new metadata.
Errors
UnauthorizedAgent
iforigin
is not agent-permissioned forticker
.NoSuchBallot
ifca_id
does not identify a ballot.VotingAlreadyStarted
ifstart >= now
, wherenow
is the current time.NumberOfChoicesOverflow
if the total choice inmeta
overflowsusize
.TooLong
if any of the embedded strings inmeta
are 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
origin
is a signer that has permissions to act as an agent ofca_id.ticker
.ca_id
identifies the attached ballot’s CA.rcv
specifies if RCV is to be supported or not.
Errors
UnauthorizedAgent
iforigin
is not agent-permissioned forticker
.NoSuchBallot
ifca_id
does not identify a ballot.VotingAlreadyStarted
ifstart >= now
, wherenow
is 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
origin
is a signer that has permissions to act as an agent ofca_id.ticker
.ca_id
identifies the attached ballot’s CA.
Errors
UnauthorizedAgent
iforigin
is not agent-permissioned forticker
.NoSuchBallot
ifca_id
does not identify a ballot.VotingAlreadyStarted
ifstart >= now
, wherenow
is 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
.§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
.§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.§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.source§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
.