Skip to main content

PocketIcBuilder

Struct PocketIcBuilder 

Source
pub struct PocketIcBuilder { /* private fields */ }

Implementations§

Source§

impl PocketIcBuilder

Source

pub fn new() -> PocketIcBuilder

Source

pub fn new_with_config( config: impl Into<ExtendedSubnetConfigSet>, ) -> PocketIcBuilder

Source

pub fn build(self) -> PocketIc

Source

pub async fn build_async(self) -> PocketIc

Source

pub fn with_server_binary(self, server_binary: PathBuf) -> PocketIcBuilder

Provide the path to the PocketIC server binary used instead of the environment variable POCKET_IC_BIN.

Source

pub fn with_server_url(self, server_url: Url) -> PocketIcBuilder

Use an already running PocketIC server.

Source

pub fn with_max_request_time_ms( self, max_request_time_ms: Option<u64>, ) -> PocketIcBuilder

Source

pub fn with_state_dir(self, state_dir: PathBuf) -> PocketIcBuilder

Source

pub fn with_state(self, state_dir: PocketIcState) -> PocketIcBuilder

Source

pub fn with_read_only_state( self, read_only_state_dir: &PocketIcState, ) -> PocketIcBuilder

Source

pub fn with_icp_config(self, icp_config: IcpConfig) -> PocketIcBuilder

Source

pub fn with_log_level(self, log_level: Level) -> PocketIcBuilder

Source

pub fn with_bitcoind_addr(self, bitcoind_addr: SocketAddr) -> PocketIcBuilder

Source

pub fn with_bitcoind_addrs( self, bitcoind_addrs: Vec<SocketAddr>, ) -> PocketIcBuilder

Source

pub fn with_dogecoind_addrs( self, dogecoind_addrs: Vec<SocketAddr>, ) -> PocketIcBuilder

Source

pub fn with_nns_subnet(self) -> PocketIcBuilder

Add an empty NNS subnet unless an NNS subnet has already been added.

Source

pub fn with_nns_state(self, path_to_state: PathBuf) -> PocketIcBuilder

Add an NNS subnet with state loaded from the given state directory. Note that the provided path must be accessible for the PocketIC server process.

path_to_state should lead to a directory which is expected to have the following structure:

path_to_state/ |– backups |– checkpoints |– diverged_checkpoints |– diverged_state_markers |– fs_tmp |– page_deltas |– states_metadata.pbuf |– tip `– tmp

Source

pub fn with_subnet_state( self, subnet_kind: SubnetKind, path_to_state: PathBuf, ) -> PocketIcBuilder

Add a subnet with state loaded from the given state directory. Note that the provided path must be accessible for the PocketIC server process.

path_to_state should point to a directory which is expected to have the following structure:

path_to_state/ |– backups |– checkpoints |– diverged_checkpoints |– diverged_state_markers |– fs_tmp |– page_deltas |– states_metadata.pbuf |– tip `– tmp

Source

pub fn with_sns_subnet(self) -> PocketIcBuilder

Add an empty sns subnet unless an SNS subnet has already been added.

Source

pub fn with_ii_subnet(self) -> PocketIcBuilder

Add an empty II subnet unless an II subnet has already been added.

Source

pub fn with_fiduciary_subnet(self) -> PocketIcBuilder

Add an empty fiduciary subnet unless a fiduciary subnet has already been added.

Source

pub fn with_bitcoin_subnet(self) -> PocketIcBuilder

Add an empty bitcoin subnet unless a bitcoin subnet has already been added.

Source

pub fn with_test_threshold_keys_subnet(self) -> PocketIcBuilder

Add an empty test threshold keys subnet unless a test threshold keys subnet has already been added.

Source

pub fn with_system_subnet(self) -> PocketIcBuilder

Add an empty generic system subnet.

Source

pub fn with_application_subnet(self) -> PocketIcBuilder

Add an empty generic application subnet.

Source

pub fn with_verified_application_subnet(self) -> PocketIcBuilder

Add an empty generic verified application subnet.

Source

pub fn with_benchmarking_application_subnet(self) -> PocketIcBuilder

Add an empty generic application subnet with benchmarking instruction configuration.

Source

pub fn with_benchmarking_system_subnet(self) -> PocketIcBuilder

Add an empty generic system subnet with benchmarking instruction configuration.

Source

pub fn with_icp_features(self, icp_features: IcpFeatures) -> PocketIcBuilder

Enables selected ICP features supported by PocketIC and implemented by system canisters (deployed to the PocketIC instance automatically when creating a new PocketIC instance). Subnets to which the system canisters are deployed are automatically declared as empty subnets, e.g., PocketIcBuilder::with_nns_subnet is implicitly implied by specifying the icp_token feature.

Source

pub fn with_initial_timestamp( self, initial_timestamp_nanos: u64, ) -> PocketIcBuilder

👎Deprecated:

Use with_initial_time instead

Sets the initial timestamp of the new instance to the provided value which must be at least

  • 10 May 2021 10:00:01 AM CEST if the cycles_minting feature is enabled in icp_features;
  • 06 May 2021 21:17:10 CEST otherwise.
Source

pub fn with_initial_time(self, initial_time: Time) -> PocketIcBuilder

Sets the initial time of the new instance to the provided value which must be at least

  • 10 May 2021 10:00:01 AM CEST if the cycles_minting feature is enabled in icp_features;
  • 06 May 2021 21:17:10 CEST otherwise.
Source

pub fn with_auto_progress(self) -> PocketIcBuilder

Configures the new instance to make progress automatically, i.e., periodically update the time of the IC instance to the real time and execute rounds on the subnets.

Source

pub fn with_http_gateway( self, http_gateway_config: InstanceHttpGatewayConfig, ) -> PocketIcBuilder

Source

pub fn with_mainnet_nns_subnet_id(self) -> PocketIcBuilder

Source

pub fn disable_ingress_validation(self) -> PocketIcBuilder

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more