Struct pocket_ic::PocketIcBuilder
source · pub struct PocketIcBuilder { /* private fields */ }Implementations§
source§impl PocketIcBuilder
impl PocketIcBuilder
pub fn new() -> Self
pub fn build(self) -> PocketIc
sourcepub fn with_nns_subnet(self) -> Self
pub fn with_nns_subnet(self) -> Self
Add an empty NNS subnet
sourcepub fn with_nns_state(
self,
nns_subnet_id: SubnetId,
path_to_state: PathBuf
) -> Self
pub fn with_nns_state( self, nns_subnet_id: SubnetId, path_to_state: PathBuf ) -> Self
Add an NNS subnet loaded form the given state directory. Note that the provided path must be accessible for the PocketIC server process.
path_to_nns_state should lead to the ic_state directory which is expected to have
the following structure:
ic_state/ |– backups |– checkpoints |– diverged_checkpoints |– diverged_state_markers |– fs_tmp |– page_deltas |– states_metadata.pbuf |– tip `– tmp
nns_subnet_id should be the subnet ID of the NNS subnet in the state under
path_to_state, e.g.:
PrincipalId(
candid::Principal::from_text(
"tdb26-jop6k-aogll-7ltgs-eruif-6kk7m-qpktf-gdiqx-mxtrf-vb5e6-eqe",
)
.unwrap(),
)
.into();The value can be obtained, e.g., via the following command:
ic-regedit snapshot <path-to-ic_registry_local_store> | jq -r ".nns_subnet_id"
sourcepub fn with_sns_subnet(self) -> Self
pub fn with_sns_subnet(self) -> Self
Add an empty sns subnet
sourcepub fn with_ii_subnet(self) -> Self
pub fn with_ii_subnet(self) -> Self
Add an empty internet identity subnet
sourcepub fn with_fiduciary_subnet(self) -> Self
pub fn with_fiduciary_subnet(self) -> Self
Add an empty fiduciary subnet
sourcepub fn with_bitcoin_subnet(self) -> Self
pub fn with_bitcoin_subnet(self) -> Self
Add an empty bitcoin subnet
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