MCPcopy Create free account
hub / github.com/consensus-shipyard/ipc / create_subnet

Method create_subnet

fendermint/testing/materializer/src/validation.rs:285–306  ·  view source on GitHub ↗
(
        &'s mut self,
        parent_submit_config: &SubmitConfig<'a, ValidationMaterials>,
        subnet_name: &SubnetName,
        subnet_config: &SubnetConfig<'a, ValidationMaterials>,
    )

Source from the content-addressed store, hash-verified

283 }
284
285 async fn create_subnet<'s, 'a>(
286 &'s mut self,
287 parent_submit_config: &SubmitConfig<'a, ValidationMaterials>,
288 subnet_name: &SubnetName,
289 subnet_config: &SubnetConfig<'a, ValidationMaterials>,
290 ) -> anyhow::Result<VSubnet>
291 where
292 's: 'a,
293 {
294 self.ensure_contains(subnet_name)?;
295 // Check that the submitter has balance on the parent subnet to create the child.
296 let parent = parent_submit_config.subnet;
297 self.ensure_balance(&parent.name, subnet_config.creator)?;
298 // Insert child subnet balances entry.
299 self.balances
300 .insert(subnet_name.clone(), Default::default());
301
302 Ok(ValidatedSubnet {
303 name: subnet_name.clone(),
304 owner: subnet_config.creator.0.id(),
305 })
306 }
307
308 async fn approve_subnet<'s, 'a>(
309 &'s mut self,

Callers

nothing calls this directly

Calls 4

ensure_containsMethod · 0.80
ensure_balanceMethod · 0.80
insertMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected