MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / join_subnet

Method join_subnet

fendermint/testing/materializer/src/docker/mod.rs:884–918  ·  view source on GitHub ↗
(
        &'s mut self,
        parent_submit_config: &SubmitConfig<'a, DockerMaterials>,
        account: &'a DefaultAccount,
        subnet: &'a DefaultSubnet,
        collateral: fendermint_vm_gene

Source from the content-addressed store, hash-verified

882 }
883
884 async fn join_subnet<'s, 'a>(
885 &'s mut self,
886 parent_submit_config: &SubmitConfig<'a, DockerMaterials>,
887 account: &'a DefaultAccount,
888 subnet: &'a DefaultSubnet,
889 collateral: fendermint_vm_genesis::Collateral,
890 balance: Balance,
891 reference: Option<ResourceHash>,
892 ) -> anyhow::Result<()>
893 where
894 's: 'a,
895 {
896 if self.has_reference(&subnet.name, &reference) {
897 return Ok(());
898 }
899
900 let cmd = format!(
901 "ipc-cli subnet join \
902 --subnet {} \
903 --from {:?} \
904 --collateral {} \
905 --initial-balance {} \
906 ",
907 subnet.subnet_id,
908 account.eth_addr(),
909 collateral.0,
910 balance.0
911 );
912
913 self.ipc_cli_run_cmd(parent_submit_config, account, cmd)
914 .await
915 .context("failed to join subnet")?;
916
917 self.add_reference(&subnet.name, &reference)
918 }
919
920 async fn create_subnet_genesis<'s, 'a>(
921 &'s mut self,

Callers

nothing calls this directly

Calls 4

has_referenceMethod · 0.80
contextMethod · 0.80
ipc_cli_run_cmdMethod · 0.80
add_referenceMethod · 0.80

Tested by

no test coverage detected