pub struct PocketIcBuilder { /* private fields */ }Implementations§
Source§impl PocketIcBuilder
impl PocketIcBuilder
pub fn new() -> Self
pub fn new_with_config(config: impl Into<ExtendedSubnetConfigSet>) -> Self
pub fn build(self) -> Result<PocketIc, ClientError>
pub async fn build_async(self) -> Result<PocketIcAsync, ClientError>
Sourcepub fn with_server_url(self, server_url: Url) -> Self
pub fn with_server_url(self, server_url: Url) -> Self
Use an already running PocketIC server.
pub fn with_max_request_time_ms(self, max_request_time_ms: Option<u64>) -> Self
pub fn with_state_dir(self, state_dir: PathBuf) -> Self
pub fn with_state(self, state_dir: PocketIcState) -> Self
pub fn with_read_only_state(self, read_only_state_dir: &PocketIcState) -> Self
pub fn with_icp_config(self, icp_config: IcpConfig) -> Self
pub fn with_log_level(self, log_level: Level) -> Self
pub fn with_bitcoind_addr(self, bitcoind_addr: SocketAddr) -> Self
pub fn with_bitcoind_addrs(self, bitcoind_addrs: Vec<SocketAddr>) -> Self
pub fn with_dogecoind_addrs(self, dogecoind_addrs: Vec<SocketAddr>) -> Self
Sourcepub fn with_nns_subnet(self) -> Self
pub fn with_nns_subnet(self) -> Self
Add an empty NNS subnet unless an NNS subnet has already been added.
Sourcepub fn with_nns_state(self, path_to_state: PathBuf) -> Self
pub fn with_nns_state(self, path_to_state: PathBuf) -> Self
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,
) -> Self
pub fn with_subnet_state( self, subnet_kind: SubnetKind, path_to_state: PathBuf, ) -> Self
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) -> Self
pub fn with_sns_subnet(self) -> Self
Add an empty sns subnet unless an SNS subnet has already been added.
Sourcepub fn with_ii_subnet(self) -> Self
pub fn with_ii_subnet(self) -> Self
Add an empty II subnet unless an II subnet has already been added.
Sourcepub fn with_fiduciary_subnet(self) -> Self
pub fn with_fiduciary_subnet(self) -> Self
Add an empty fiduciary subnet unless a fiduciary subnet has already been added.
Sourcepub fn with_bitcoin_subnet(self) -> Self
pub fn with_bitcoin_subnet(self) -> Self
Add an empty bitcoin subnet unless a bitcoin subnet has already been added.
Sourcepub fn with_test_threshold_keys_subnet(self) -> Self
pub fn with_test_threshold_keys_subnet(self) -> Self
Add an empty test threshold keys subnet unless a test threshold keys subnet has already been added.
Sourcepub fn with_system_subnet(self) -> Self
pub fn with_system_subnet(self) -> Self
Add an empty generic system subnet.
Sourcepub fn with_application_subnet(self) -> Self
pub fn with_application_subnet(self) -> Self
Add an empty generic application subnet.
Sourcepub fn with_verified_application_subnet(self) -> Self
pub fn with_verified_application_subnet(self) -> Self
Add an empty generic verified application subnet.
Sourcepub fn with_benchmarking_application_subnet(self) -> Self
pub fn with_benchmarking_application_subnet(self) -> Self
Add an empty generic application subnet with benchmarking instruction configuration.
Sourcepub fn with_benchmarking_system_subnet(self) -> Self
pub fn with_benchmarking_system_subnet(self) -> Self
Add an empty generic system subnet with benchmarking instruction configuration.
Sourcepub fn with_icp_features(self, icp_features: IcpFeatures) -> Self
pub fn with_icp_features(self, icp_features: IcpFeatures) -> Self
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) -> Self
👎Deprecated: Use with_initial_time instead
pub fn with_initial_timestamp(self, initial_timestamp_nanos: u64) -> Self
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) -> Self
pub fn with_initial_time(self, initial_time: Time) -> Self
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) -> Self
pub fn with_auto_progress(self) -> Self
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. Building the instance only returns after the certified time of the IC instance has been updated for the first time.