pub struct MultisigCommittee { /* private fields */ }
Expand description
A multisig committee
A MultisigCommittee
is a set of members who collectively control a single Address
on the
Sui blockchain. The number of required signautres to authorize the execution of a transaction
is determined by (signature_0_weight + signature_1_weight ..) >= threshold
.
§BCS
The BCS serialized form for this type is defined by the following ABNF:
multisig-committee = (vector multisig-member)
u16 ; threshold
There is also a legacy encoding for this type defined as:
legacy-multisig-committee = (vector legacy-multisig-member)
u16 ; threshold
Implementations§
Source§impl MultisigCommittee
impl MultisigCommittee
Sourcepub fn new(members: Vec<MultisigMember>, threshold: u16) -> Self
pub fn new(members: Vec<MultisigMember>, threshold: u16) -> Self
Construct a new committee from a list of MultisigMember
s and a threshold
.
Note that the order of the members is significant towards deriving the Address
governed
by this committee.
Sourcepub fn members(&self) -> &[MultisigMember]
pub fn members(&self) -> &[MultisigMember]
The members of the committee
Sourcepub fn threshold(&self) -> u16
pub fn threshold(&self) -> u16
The total signature weight required to authorize a transaction for the address
corresponding to this MultisigCommittee
.
Sourcepub fn scheme(&self) -> SignatureScheme
pub fn scheme(&self) -> SignatureScheme
Return the flag for this signature scheme
Source§impl MultisigCommittee
impl MultisigCommittee
Sourcepub fn derive_address(&self) -> Address
Available on crate feature hash
only.
pub fn derive_address(&self) -> Address
hash
only.Derive an Address
from this MultisigCommittee.
A MultiSig address
is defined as the 32-byte Blake2b hash of serializing the SignatureScheme
flag (0x03), the
threshold (in little endian), and the concatenation of all n flag, public keys and
its weight.
hash(0x03 || threshold || flag_1 || pk_1 || weight_1 || ... || flag_n || pk_n || weight_n)
.
When flag_i is ZkLogin, the pk_i for the ZkLoginPublicIdentifier
refers to the same
input used when deriving the address using the
ZkLoginPublicIdentifier::derive_address_padded
method (using the full 32-byte
address_seed
value).
Trait Implementations§
Source§impl Arbitrary for MultisigCommittee
impl Arbitrary for MultisigCommittee
Source§type Parameters = ()
type Parameters = ()
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.Source§type Strategy = BoxedStrategy<MultisigCommittee>
type Strategy = BoxedStrategy<MultisigCommittee>
Strategy
used to generate values of type Self
.Source§fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
Source§impl Clone for MultisigCommittee
impl Clone for MultisigCommittee
Source§fn clone(&self) -> MultisigCommittee
fn clone(&self) -> MultisigCommittee
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for MultisigCommittee
impl Debug for MultisigCommittee
Source§impl<'de> Deserialize<'de> for MultisigCommittee
impl<'de> Deserialize<'de> for MultisigCommittee
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>,
Source§impl PartialEq for MultisigCommittee
impl PartialEq for MultisigCommittee
Source§impl Serialize for MultisigCommittee
impl Serialize for MultisigCommittee
impl Eq for MultisigCommittee
impl StructuralPartialEq for MultisigCommittee
Auto Trait Implementations§
impl Freeze for MultisigCommittee
impl RefUnwindSafe for MultisigCommittee
impl Send for MultisigCommittee
impl Sync for MultisigCommittee
impl Unpin for MultisigCommittee
impl UnwindSafe for MultisigCommittee
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read more