pub struct DefaultCellDepResolver { /* private fields */ }Expand description
A cell_dep resolver use genesis info resolve system scripts and can register more cell_dep info.
Implementations§
Source§impl DefaultCellDepResolver
impl DefaultCellDepResolver
Sourcepub fn from_genesis(
genesis_block: &BlockView,
) -> Result<DefaultCellDepResolver, ParseGenesisInfoError>
pub fn from_genesis( genesis_block: &BlockView, ) -> Result<DefaultCellDepResolver, ParseGenesisInfoError>
You can customize the multisig script’s depgroup by these two env variables, for example:
- MULTISIG_LEGACY_DEP_GROUP=0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c,1
- MULTISIG_V2_DEP_GROUP=0x6888aa39ab30c570c2c30d9d5684d3769bf77265a7973211a3c087fe8efbf738,2
Sourcepub async fn from_genesis_async(
genesis_block: &BlockView,
) -> Result<DefaultCellDepResolver, ParseGenesisInfoError>
pub async fn from_genesis_async( genesis_block: &BlockView, ) -> Result<DefaultCellDepResolver, ParseGenesisInfoError>
You can customize the multisig script’s depgroup by these two env variables, for example:
- MULTISIG_LEGACY_DEP_GROUP=0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c,1
- MULTISIG_V2_DEP_GROUP=0x6888aa39ab30c570c2c30d9d5684d3769bf77265a7973211a3c087fe8efbf738,2
pub fn insert( &mut self, script_id: ScriptId, cell_dep: CellDep, name: String, ) -> Option<(CellDep, String)>
pub fn remove(&mut self, script_id: &ScriptId) -> Option<(CellDep, String)>
pub fn contains(&self, script_id: &ScriptId) -> bool
pub fn get(&self, script_id: &ScriptId) -> Option<&(CellDep, String)>
pub fn sighash_dep(&self) -> Option<&(CellDep, String)>
Sourcepub fn multisig_dep(
&self,
multisig_script: MultisigScript,
) -> Option<&(CellDep, String)>
pub fn multisig_dep( &self, multisig_script: MultisigScript, ) -> Option<&(CellDep, String)>
TODO: We have found MultisigScript::Legacy’s dep from genesis block. TODO: then need manually insert MultisigScript::V1’s deps to self.
pub fn dao_dep(&self) -> Option<&(CellDep, String)>
Trait Implementations§
Source§impl Clone for DefaultCellDepResolver
impl Clone for DefaultCellDepResolver
Source§fn clone(&self) -> DefaultCellDepResolver
fn clone(&self) -> DefaultCellDepResolver
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for DefaultCellDepResolver
impl RefUnwindSafe for DefaultCellDepResolver
impl Send for DefaultCellDepResolver
impl Sync for DefaultCellDepResolver
impl Unpin for DefaultCellDepResolver
impl UnwindSafe for DefaultCellDepResolver
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more