pub struct ContractStore { /* private fields */ }Expand description
Stores contract artifacts, instances, and class registrations.
Implementations§
Source§impl ContractStore
impl ContractStore
pub fn new(kv: Arc<dyn KvStore>) -> ContractStore
Sourcepub async fn add_instance(
&self,
instance: &ContractInstanceWithAddress,
) -> Result<(), Error>
pub async fn add_instance( &self, instance: &ContractInstanceWithAddress, ) -> Result<(), Error>
Store a contract instance by its address.
Sourcepub async fn get_instance(
&self,
address: &AztecAddress,
) -> Result<Option<ContractInstanceWithAddress>, Error>
pub async fn get_instance( &self, address: &AztecAddress, ) -> Result<Option<ContractInstanceWithAddress>, Error>
Get a contract instance by address.
Sourcepub async fn get_contract_addresses(&self) -> Result<Vec<AztecAddress>, Error>
pub async fn get_contract_addresses(&self) -> Result<Vec<AztecAddress>, Error>
List all registered contract addresses.
Sourcepub async fn add_artifact(
&self,
class_id: &Fr,
artifact: &ContractArtifact,
) -> Result<(), Error>
pub async fn add_artifact( &self, class_id: &Fr, artifact: &ContractArtifact, ) -> Result<(), Error>
Store a contract artifact by class ID.
Sourcepub async fn get_artifact(
&self,
class_id: &Fr,
) -> Result<Option<ContractArtifact>, Error>
pub async fn get_artifact( &self, class_id: &Fr, ) -> Result<Option<ContractArtifact>, Error>
Get a contract artifact by class ID.
Sourcepub async fn update_artifact(
&self,
address: &AztecAddress,
artifact: &ContractArtifact,
) -> Result<(), Error>
pub async fn update_artifact( &self, address: &AztecAddress, artifact: &ContractArtifact, ) -> Result<(), Error>
Update a contract’s artifact (by address — looks up the class ID).
Auto Trait Implementations§
impl Freeze for ContractStore
impl !RefUnwindSafe for ContractStore
impl Send for ContractStore
impl Sync for ContractStore
impl Unpin for ContractStore
impl !UnwindSafe for ContractStore
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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