Skip to content

Commit

Permalink
chore: removed comment lines
Browse files Browse the repository at this point in the history
  • Loading branch information
riyasng12 committed Dec 22, 2023
1 parent 1f9da5a commit baf616c
Showing 1 changed file with 0 additions and 135 deletions.
135 changes: 0 additions & 135 deletions cli/cmd/chains/kusama/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,138 +332,3 @@ func GetIPAddress(cli *common.Cli, serviceConfig *utils.PolkadotServiceConfig, r
}
return "", nil
}

// func startParaChains(cli *common.Cli, serviceConfig *utils.PolkadotServiceConfig, enclaveContext *enclaves.EnclaveContext, params string, ipAddress string) (*common.DiveMultipleServiceResponse, error) {
// para := fmt.Sprintf(`{"args": %s, "relay_chain_ip":"%s"}`, params, ipAddress)

// runParaConfig := getParaRunConfig(serviceConfig, enclaveContext, para)
// paraResponse, _, err := enclaveContext.RunStarlarkRemotePackage(cli.Context().GetContext(), common.PolkadotRemotePackagePath, runParaConfig)
// if err != nil {
// return nil, common.WrapMessageToError(common.ErrStarlarkRunFailed, err.Error())
// }

// paraResponseData, paraServices, skippedParaInstructions, err := common.GetSerializedData(cli, paraResponse)
// if err != nil {

// errRemove := cli.Context().RemoveServicesByServiceNames(paraServices, common.EnclaveName)
// if errRemove != nil {
// return nil, common.WrapMessageToError(errRemove, "ParaChain Run Failed ")
// }

// return nil, common.WrapMessageToError(err, "ParaChain Run Failed ")
// }

// if cli.Context().CheckSkippedInstructions(skippedParaInstructions) {
// return nil, common.WrapMessageToError(common.ErrStarlarkResponse, "ParaChain already Running")
// }

// KusamaParaResponseData := &common.DiveMultipleServiceResponse{}

// resultPara, err := KusamaParaResponseData.Decode([]byte(paraResponseData))
// if err != nil {

// errRemove := cli.Context().RemoveServicesByServiceNames(paraServices, common.EnclaveName)
// if errRemove != nil {
// return nil, common.WrapMessageToError(errRemove, "ParaChain Run Failed ")
// }

// return nil, common.WrapMessageToErrorf(common.ErrDataUnMarshall, "%s.%s", err, "ParaChain Run Failed ")

// }

// return resultPara, nil
// }

// func startParaChainsLocal(cli *common.Cli, enclaveContext *enclaves.EnclaveContext, serviceConfig *utils.PolkadotServiceConfig, result *common.DiveMultipleServiceResponse, skippedInstructions map[string]bool, encodedServiceConfigDataString string) (*common.DiveMultipleServiceResponse, error) {
// paraResult := &common.DiveMultipleServiceResponse{}
// var err error

// if cli.Context().CheckSkippedInstructions(skippedInstructions) {
// if len(serviceConfig.Para) != 0 && serviceConfig.Para[0].Name != "" {
// nodename := serviceConfig.RelayChain.Nodes[0].Name
// ipAddress, err := GetIPAddress(cli, nodename)
// if err != nil {
// return nil, err
// }
// paraResult, err = startParaChains(cli, serviceConfig, enclaveContext, encodedServiceConfigDataString, ipAddress)
// if err != nil {
// return nil, err
// }
// }
// return nil, common.WrapMessageToError(common.ErrStarlarkResponse, "Kusama already Running")
// } else {
// if len(serviceConfig.Para) != 0 && serviceConfig.Para[0].Name != "" {
// servicename := fmt.Sprintf("rococo-local-%s", serviceConfig.RelayChain.Nodes[0].Name)
// ipAddress := result.Dive[servicename].IpAddress
// paraResult, err = startParaChains(cli, serviceConfig, enclaveContext, encodedServiceConfigDataString, ipAddress)
// if err != nil {
// return nil, err
// }
// }
// }

// return paraResult, nil
// }

// func startParaChainsTestAndMain(cli *common.Cli, enclaveContext *enclaves.EnclaveContext, serviceConfig *utils.PolkadotServiceConfig, result *common.DiveMultipleServiceResponse, skippedInstructions map[string]bool, encodedServiceConfigDataString string) {
// if cli.Context().CheckSkippedInstructions(skippedInstructions) {
// if len(serviceConfig.Para) != 0 && serviceConfig.Para[0].Name != "" {

// paraResult, err = runParaTestAndMain(cli, enclaveContext, serviceConfig, encodedServiceConfigDataString)
// if err != nil {
// return nil, err
// }
// }
// return nil, common.WrapMessageToError(common.ErrStarlarkResponse, "Kusama already Running")
// } else {
// if len(serviceConfig.Para) != 0 && serviceConfig.Para[0].Name != "" {
// servicename := fmt.Sprintf("rococo-local-%s", serviceConfig.RelayChain.Nodes[0].Name)
// ipAddress := result.Dive[servicename].IpAddress
// paraResult, err = runParaTestAndMain(cli, enclaveContext, serviceConfig, encodedServiceConfigDataString)
// if err != nil {
// return nil, err
// }
// }
// }
// }

// func runParaTestAndMain(cli *common.Cli, enclaveContext *enclaves.EnclaveContext, serviceConfig *utils.PolkadotServiceConfig, params string) (*common.DiveMultipleServiceResponse, error) {
// para := fmt.Sprintf(`{"parachain":"%s", "args":%s}`, paraChain, params)

// runParaConfig := getParaRunConfig(serviceConfig, enclaveContext, para)
// paraResponse, _, err := enclaveContext.RunStarlarkRemotePackage(cli.Context().GetContext(), common.PolkadotRemotePackagePath, runParaConfig)
// if err != nil {
// return nil, common.WrapMessageToError(common.ErrStarlarkRunFailed, err.Error())
// }

// paraResponseData, paraServices, skippedParaInstructions, err := common.GetSerializedData(cli, paraResponse)
// if err != nil {

// errRemove := cli.Context().RemoveServicesByServiceNames(paraServices, common.EnclaveName)
// if errRemove != nil {
// return nil, common.WrapMessageToError(errRemove, "ParaChain Run Failed ")
// }

// return nil, common.WrapMessageToError(err, "ParaChain Run Failed ")
// }

// if cli.Context().CheckSkippedInstructions(skippedParaInstructions) {
// return nil, common.WrapMessageToError(common.ErrStarlarkResponse, "ParaChain already Running")
// }

// KusamaParaResponseData := &common.DiveMultipleServiceResponse{}

// resultPara, err := KusamaParaResponseData.Decode([]byte(paraResponseData))
// if err != nil {

// errRemove := cli.Context().RemoveServicesByServiceNames(paraServices, common.EnclaveName)
// if errRemove != nil {
// return nil, common.WrapMessageToError(errRemove, "ParaChain Run Failed ")
// }

// return nil, common.WrapMessageToErrorf(common.ErrDataUnMarshall, "%s.%s", err, "ParaChain Run Failed ")

// }

// return resultPara, nil
// }

0 comments on commit baf616c

Please sign in to comment.