pub struct LocalEnvironmentBuilder { /* private fields */ }
Implementations§
Source§impl LocalEnvironmentBuilder
impl LocalEnvironmentBuilder
Sourcepub fn set_creation_time(&mut self, unix_timestamp: UnixTimestamp) -> &mut Self
pub fn set_creation_time(&mut self, unix_timestamp: UnixTimestamp) -> &mut Self
Sets the creation time of the network
Sourcepub fn add_account(&mut self, pubkey: Pubkey, account: Account) -> &mut Self
pub fn add_account(&mut self, pubkey: Pubkey, account: Account) -> &mut Self
Adds the account into the environment.
Sourcepub fn add_program<P: AsRef<Path>>(
&mut self,
pubkey: Pubkey,
path: P,
) -> &mut Self
pub fn add_program<P: AsRef<Path>>( &mut self, pubkey: Pubkey, path: P, ) -> &mut Self
Reads the program from the path and add it at the address into the environment.
pub fn add_account_with_data( &mut self, pubkey: Pubkey, owner: Pubkey, data: &[u8], executable: bool, ) -> &mut Self
pub fn add_account_with_lamports( &mut self, pubkey: Pubkey, owner: Pubkey, lamports: u64, ) -> &mut Self
pub fn add_account_with_packable<P: Pack>( &mut self, pubkey: Pubkey, owner: Pubkey, data: P, ) -> &mut Self
pub fn add_token_mint( &mut self, pubkey: Pubkey, mint_authority: Option<Pubkey>, supply: u64, decimals: u8, freeze_authority: Option<Pubkey>, ) -> &mut Self
pub fn add_account_with_tokens( &mut self, pubkey: Pubkey, mint: Pubkey, owner: Pubkey, amount: u64, ) -> &mut Self
pub fn add_associated_account_with_tokens( &mut self, owner: Pubkey, mint: Pubkey, amount: u64, ) -> &mut Self
Sourcepub fn clone_account_from_cluster(
&mut self,
pubkey: Pubkey,
client: &RpcClient,
) -> &mut Self
pub fn clone_account_from_cluster( &mut self, pubkey: Pubkey, client: &RpcClient, ) -> &mut Self
Clone an account from a cluster using the given rpc client. Use [clone_upgradable_program_from_cluster] if you want to clone a upgradable program, as this requires multiple accounts.
Sourcepub fn clone_accounts_from_cluster(
&mut self,
pubkeys: &[Pubkey],
client: &RpcClient,
) -> &mut Self
pub fn clone_accounts_from_cluster( &mut self, pubkeys: &[Pubkey], client: &RpcClient, ) -> &mut Self
Clone multiple accounts from a cluster using the given rpc client.
Sourcepub fn clone_upgradable_program_from_cluster(
&mut self,
client: &RpcClient,
pubkey: Pubkey,
) -> &mut Self
pub fn clone_upgradable_program_from_cluster( &mut self, client: &RpcClient, pubkey: Pubkey, ) -> &mut Self
Clones all accounts required to execute the given executable program from the cluster, using the given rpc client.
Sourcepub fn build(&mut self) -> LocalEnvironment
pub fn build(&mut self) -> LocalEnvironment
Finalizes the environment.
Auto Trait Implementations§
impl Freeze for LocalEnvironmentBuilder
impl RefUnwindSafe for LocalEnvironmentBuilder
impl Send for LocalEnvironmentBuilder
impl Sync for LocalEnvironmentBuilder
impl Unpin for LocalEnvironmentBuilder
impl UnwindSafe for LocalEnvironmentBuilder
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> 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