Struct cw4::Cw4Contract
source · pub struct Cw4Contract(pub Addr);
Expand description
Cw4Contract is a wrapper around Addr that provides a lot of helpers for working with cw4 contracts
If you wish to persist this, convert to Cw4CanonicalContract via .canonical()
Tuple Fields§
§0: Addr
Implementations§
source§impl Cw4Contract
impl Cw4Contract
pub fn new(addr: Addr) -> Self
pub fn addr(&self) -> Addr
pub fn add_hook<T: Into<String>>(&self, addr: T) -> StdResult<CosmosMsg>
pub fn remove_hook<T: Into<String>>(&self, addr: T) -> StdResult<CosmosMsg>
pub fn update_admin<T: Into<String>>( &self, admin: Option<T> ) -> StdResult<CosmosMsg>
sourcepub fn hooks<Q: CustomQuery>(
&self,
querier: &QuerierWrapper<'_, Q>
) -> StdResult<Vec<String>>
pub fn hooks<Q: CustomQuery>( &self, querier: &QuerierWrapper<'_, Q> ) -> StdResult<Vec<String>>
Show the hooks
sourcepub fn total_weight(&self, querier: &QuerierWrapper<'_>) -> StdResult<u64>
pub fn total_weight(&self, querier: &QuerierWrapper<'_>) -> StdResult<u64>
Read the total weight
sourcepub fn is_member(
&self,
querier: &QuerierWrapper<'_>,
member: &Addr,
height: Option<u64>
) -> StdResult<Option<u64>>
pub fn is_member( &self, querier: &QuerierWrapper<'_>, member: &Addr, height: Option<u64> ) -> StdResult<Option<u64>>
Check if this address is a member and returns its weight
sourcepub fn is_voting_member(
&self,
querier: &QuerierWrapper<'_>,
member: &Addr,
height: impl Into<Option<u64>>
) -> StdResult<Option<u64>>
pub fn is_voting_member( &self, querier: &QuerierWrapper<'_>, member: &Addr, height: impl Into<Option<u64>> ) -> StdResult<Option<u64>>
Check if this address is a member, and if its weight is >= 1 Returns member’s weight in positive case
sourcepub fn member_at_height(
&self,
querier: &QuerierWrapper<'_>,
member: impl Into<String>,
at_height: Option<u64>
) -> StdResult<Option<u64>>
pub fn member_at_height( &self, querier: &QuerierWrapper<'_>, member: impl Into<String>, at_height: Option<u64> ) -> StdResult<Option<u64>>
Return the member’s weight at the given snapshot - requires a smart query
pub fn list_members( &self, querier: &QuerierWrapper<'_>, start_after: Option<String>, limit: Option<u32> ) -> StdResult<Vec<Member>>
Trait Implementations§
source§impl Clone for Cw4Contract
impl Clone for Cw4Contract
source§fn clone(&self) -> Cw4Contract
fn clone(&self) -> Cw4Contract
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Cw4Contract
impl Debug for Cw4Contract
source§impl<'de> Deserialize<'de> for Cw4Contract
impl<'de> Deserialize<'de> for Cw4Contract
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl JsonSchema for Cw4Contract
impl JsonSchema for Cw4Contract
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl PartialEq for Cw4Contract
impl PartialEq for Cw4Contract
source§fn eq(&self, other: &Cw4Contract) -> bool
fn eq(&self, other: &Cw4Contract) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Cw4Contract
impl Serialize for Cw4Contract
impl StructuralPartialEq for Cw4Contract
Auto Trait Implementations§
impl Freeze for Cw4Contract
impl RefUnwindSafe for Cw4Contract
impl Send for Cw4Contract
impl Sync for Cw4Contract
impl Unpin for Cw4Contract
impl UnwindSafe for Cw4Contract
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more