pub struct PocketIcBuilder { /* private fields */ }Implementations§
Source§impl PocketIcBuilder
impl PocketIcBuilder
pub fn new() -> PocketIcBuilder
pub fn new_with_config( config: impl Into<ExtendedSubnetConfigSet>, ) -> PocketIcBuilder
pub fn build(self) -> PocketIc
pub async fn build_async(self) -> PocketIc
Sourcepub fn with_server_binary(self, server_binary: PathBuf) -> PocketIcBuilder
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.
Sourcepub fn with_server_url(self, server_url: Url) -> PocketIcBuilder
pub fn with_server_url(self, server_url: Url) -> PocketIcBuilder
Use an already running PocketIC server.
pub fn with_max_request_time_ms( self, max_request_time_ms: Option<u64>, ) -> PocketIcBuilder
pub fn with_state_dir(self, state_dir: PathBuf) -> PocketIcBuilder
pub fn with_state(self, state_dir: PocketIcState) -> PocketIcBuilder
pub fn with_read_only_state( self, read_only_state_dir: &PocketIcState, ) -> PocketIcBuilder
pub fn with_icp_config(self, icp_config: IcpConfig) -> PocketIcBuilder
pub fn with_log_level(self, log_level: Level) -> PocketIcBuilder
pub fn with_bitcoind_addr(self, bitcoind_addr: SocketAddr) -> PocketIcBuilder
pub fn with_bitcoind_addrs( self, bitcoind_addrs: Vec<SocketAddr>, ) -> PocketIcBuilder
pub fn with_dogecoind_addrs( self, dogecoind_addrs: Vec<SocketAddr>, ) -> PocketIcBuilder
Sourcepub fn with_nns_subnet(self) -> PocketIcBuilder
pub fn with_nns_subnet(self) -> PocketIcBuilder
Add an empty NNS subnet unless an NNS subnet has already been added.
Sourcepub fn with_nns_state(self, path_to_state: PathBuf) -> PocketIcBuilder
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
Sourcepub fn with_subnet_state(
self,
subnet_kind: SubnetKind,
path_to_state: PathBuf,
) -> PocketIcBuilder
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
Sourcepub fn with_sns_subnet(self) -> PocketIcBuilder
pub fn with_sns_subnet(self) -> PocketIcBuilder
Add an empty sns subnet unless an SNS subnet has already been added.
Sourcepub fn with_ii_subnet(self) -> PocketIcBuilder
pub fn with_ii_subnet(self) -> PocketIcBuilder
Add an empty II subnet unless an II subnet has already been added.
Sourcepub fn with_fiduciary_subnet(self) -> PocketIcBuilder
pub fn with_fiduciary_subnet(self) -> PocketIcBuilder
Add an empty fiduciary subnet unless a fiduciary subnet has already been added.
Sourcepub fn with_bitcoin_subnet(self) -> PocketIcBuilder
pub fn with_bitcoin_subnet(self) -> PocketIcBuilder
Add an empty bitcoin subnet unless a bitcoin subnet has already been added.
Sourcepub fn with_test_threshold_keys_subnet(self) -> PocketIcBuilder
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.
Sourcepub fn with_system_subnet(self) -> PocketIcBuilder
pub fn with_system_subnet(self) -> PocketIcBuilder
Add an empty generic system subnet.
Sourcepub fn with_application_subnet(self) -> PocketIcBuilder
pub fn with_application_subnet(self) -> PocketIcBuilder
Add an empty generic application subnet.
Sourcepub fn with_verified_application_subnet(self) -> PocketIcBuilder
pub fn with_verified_application_subnet(self) -> PocketIcBuilder
Add an empty generic verified application subnet.
Sourcepub fn with_benchmarking_application_subnet(self) -> PocketIcBuilder
pub fn with_benchmarking_application_subnet(self) -> PocketIcBuilder
Add an empty generic application subnet with benchmarking instruction configuration.
Sourcepub fn with_benchmarking_system_subnet(self) -> PocketIcBuilder
pub fn with_benchmarking_system_subnet(self) -> PocketIcBuilder
Add an empty generic system subnet with benchmarking instruction configuration.
Sourcepub fn with_icp_features(self, icp_features: IcpFeatures) -> PocketIcBuilder
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.
Sourcepub fn with_initial_timestamp(
self,
initial_timestamp_nanos: u64,
) -> PocketIcBuilder
👎Deprecated: Use with_initial_time instead
pub fn with_initial_timestamp( self, initial_timestamp_nanos: u64, ) -> PocketIcBuilder
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_mintingfeature is enabled inicp_features; - 06 May 2021 21:17:10 CEST otherwise.
Sourcepub fn with_initial_time(self, initial_time: Time) -> PocketIcBuilder
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_mintingfeature is enabled inicp_features; - 06 May 2021 21:17:10 CEST otherwise.
Sourcepub fn with_auto_progress(self) -> PocketIcBuilder
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.