pub struct ContractDeployer<'a, W> { /* private fields */ }Expand description
Builder for deploying new contract instances.
Created with a contract artifact and wallet reference. Use
ContractDeployer::deploy to produce a DeployMethod for a
specific set of constructor arguments.
Implementations§
Source§impl<'a, W: Wallet> ContractDeployer<'a, W>
impl<'a, W: Wallet> ContractDeployer<'a, W>
Sourcepub fn new(artifact: ContractArtifact, wallet: &'a W) -> Self
pub fn new(artifact: ContractArtifact, wallet: &'a W) -> Self
Create a new deployer for the given artifact and wallet.
Sourcepub const fn with_public_keys(self, keys: PublicKeys) -> Self
pub const fn with_public_keys(self, keys: PublicKeys) -> Self
Set the public keys for the deployed instance.
Sourcepub fn with_constructor_name(self, name: impl Into<String>) -> Self
pub fn with_constructor_name(self, name: impl Into<String>) -> Self
Set the constructor function name (defaults to "constructor").
Sourcepub fn deploy(self, args: Vec<AbiValue>) -> Result<DeployMethod<'a, W>, Error>
pub fn deploy(self, args: Vec<AbiValue>) -> Result<DeployMethod<'a, W>, Error>
Create a DeployMethod for the given constructor arguments.
Validates the selected initializer, when present. Contracts with no initializer are allowed as long as no constructor arguments are passed.
Trait Implementations§
Auto Trait Implementations§
impl<'a, W> Freeze for ContractDeployer<'a, W>
impl<'a, W> RefUnwindSafe for ContractDeployer<'a, W>where
W: RefUnwindSafe,
impl<'a, W> Send for ContractDeployer<'a, W>where
W: Sync,
impl<'a, W> Sync for ContractDeployer<'a, W>where
W: Sync,
impl<'a, W> Unpin for ContractDeployer<'a, W>
impl<'a, W> UnwindSafe for ContractDeployer<'a, W>where
W: RefUnwindSafe,
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