Skip to content

Commit

Permalink
fix: fix decentralisation error
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyasbhat0 committed Jul 27, 2023
1 parent c226f24 commit ea6451d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ jobs:
with:
distribution: goreleaser
tag: ${{ env.GITHUB_REF_NAME }}
args: release --rm-dist
args: release --snapshot --clean --skip-validate
env:
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
1 change: 1 addition & 0 deletions cli/.goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ before:
builds:
- id: cli
binary: "dive"
main: .
env:
- CGO_ENABLED={{ if eq .Os "windows" }}0{{ else }}1{{ end }}
# Only override compilers if we are on CI, otherwise use the locally available C/C++ toolchain
Expand Down
2 changes: 1 addition & 1 deletion cli/commands/chain/types/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ It establishes a connection to the Ethereum network and allows the node in execu
data := RunEthNode(diveContext)

diveContext.SetSpinnerMessage("Execution Completed")
err := data.WriteDiveResponse(diveContext)
err := data.WriteDiveResponse()
if err != nil {
diveContext.FatalError("Failed To Write To File", err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion cli/commands/chain/types/hardhat.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ It establishes a connection to the hardhat network and allows the node in execut

diveContext.SetSpinnerMessage("Execution Completed")

err := data.WriteDiveResponse(diveContext)
err := data.WriteDiveResponse()
if err != nil {
diveContext.FatalError("Failed To Write To File", err.Error())
}
Expand Down
7 changes: 3 additions & 4 deletions cli/commands/chain/types/icon.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ It establishes a connection to the Icon network and allows the node in executing
diveContext.SetSpinnerMessage("Starting Decentralisation")
Decentralisation(diveContext, params)

err := nodeResponse.WriteDiveResponse(diveContext)
err := nodeResponse.WriteDiveResponse()

if err != nil {
diveContext.FatalError("Failed To Write To File", err.Error())
Expand All @@ -87,7 +87,7 @@ It establishes a connection to the Icon network and allows the node in executing

nodeResponse := RunIconNode(diveContext)

err := nodeResponse.WriteDiveResponse(diveContext)
err := nodeResponse.WriteDiveResponse()

if err != nil {
diveContext.FatalError("Failed To Write To File", err.Error())
Expand All @@ -99,7 +99,6 @@ It establishes a connection to the Icon network and allows the node in executing
},
}

iconCmd.Flags().StringVarP(&id, "id", "i", "", "custom chain id for icon node")
iconCmd.Flags().StringVarP(&genesis, "genesis", "g", "", "path to custom genesis file")
iconCmd.Flags().StringVarP(&configFilePath, "config", "c", "", "path to custom config json file")
iconCmd.Flags().BoolP("decentralisation", "d", false, "decentralise Icon Node")
Expand All @@ -120,7 +119,7 @@ func IconDecentralisationCmd(diveContext *common.DiveContext) *cobra.Command {
Run: func(cmd *cobra.Command, args []string) {

params := GetDecentralizeParms(serviceName, nodeEndpoint, keystorePath, keystorepassword, networkID)

diveContext.InitKurtosisContext()
Decentralisation(diveContext, params)

diveContext.StopSpinner(fmt.Sprintln("Decentralisation Completed.Please find service details in dive.json"))
Expand Down
4 changes: 2 additions & 2 deletions cli/common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ func (dive *DiveserviceResponse) Decode(responseData []byte) (*DiveserviceRespon
return dive, nil
}
func (dive *DiveserviceResponse) EncodeToString() (string, error) {

encodedBytes, err := json.Marshal(dive)
if err != nil {
return "", nil
}

return string(encodedBytes), nil
}
func (dive *DiveserviceResponse) WriteDiveResponse(diveContext *DiveContext) error {
func (dive *DiveserviceResponse) WriteDiveResponse() error {

serialisedData, err := dive.EncodeToString()

Expand Down Expand Up @@ -105,7 +106,6 @@ func ReadConfigFile(filePath string) ([]byte, error) {
return file, nil
}
func WriteToFile(data string) error {

pwd, err := os.Getwd()

if err != nil {
Expand Down

0 comments on commit ea6451d

Please sign in to comment.