From 4fe5724b5701273b3e0c336992dae8550b6a8c69 Mon Sep 17 00:00:00 2001 From: shreyasbhat0 Date: Mon, 14 Aug 2023 13:00:22 +0530 Subject: [PATCH 1/3] fix: bridge error issues --- cli/commands/bridge/bridge.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cli/commands/bridge/bridge.go b/cli/commands/bridge/bridge.go index 9e43d455..2c089104 100644 --- a/cli/commands/bridge/bridge.go +++ b/cli/commands/bridge/bridge.go @@ -137,7 +137,14 @@ func btpBridgeCmd(diveContext *common.DiveContext) *cobra.Command { if err != nil { diveContext.FatalError("Failed To read ServiceFile", err.Error()) } - runBtpSetupForAlreadyRunningNodes(diveContext, enclaveCtx, runbridgeicon2ethhardhat, chains.chainA, chains.chainB, chains.chainAServiceName, chains.chainBServiceName, bridge, srcChainServiceResponse, dstChainServiceResponse) + + if chains.chainB == "icon" { + runBtpSetupForAlreadyRunningNodes(diveContext, enclaveCtx, runbridgeicon2ethhardhat, chains.chainB, chains.chainA, chains.chainBServiceName, chains.chainAServiceName, bridge, dstChainServiceResponse, srcChainServiceResponse) + } else { + + runBtpSetupForAlreadyRunningNodes(diveContext, enclaveCtx, runbridgeicon2ethhardhat, chains.chainA, chains.chainB, chains.chainAServiceName, chains.chainBServiceName, bridge, srcChainServiceResponse, dstChainServiceResponse) + + } } else if (chains.chainAServiceName == "" && chains.chainBServiceName != "") || (chains.chainAServiceName != "" && chains.chainBServiceName == "") { var chainAServiceResponse string @@ -285,7 +292,7 @@ func (chains *Chains) getServicesResponse() (string, string, error) { if !OK { return "", "", fmt.Errorf("service name not found") } - chainBServiceResponse, OK := serviceConfig[chains.chainAServiceName] + chainBServiceResponse, OK := serviceConfig[chains.chainBServiceName] if !OK { return "", "", fmt.Errorf("service name not found") } From b6fa7562e1ca528b50b8abf52718f5cafa264273 Mon Sep 17 00:00:00 2001 From: shreyasbhat0 Date: Mon, 14 Aug 2023 13:26:54 +0530 Subject: [PATCH 2/3] fix: typo in error message --- cli/commands/bridge/bridge.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cli/commands/bridge/bridge.go b/cli/commands/bridge/bridge.go index 2c089104..a2407644 100644 --- a/cli/commands/bridge/bridge.go +++ b/cli/commands/bridge/bridge.go @@ -135,7 +135,7 @@ func btpBridgeCmd(diveContext *common.DiveContext) *cobra.Command { srcChainServiceResponse, dstChainServiceResponse, err := chains.getServicesResponse() if err != nil { - diveContext.FatalError("Failed To read ServiceFile", err.Error()) + diveContext.FatalError("failed to get service data", err.Error()) } if chains.chainB == "icon" { @@ -154,35 +154,35 @@ func btpBridgeCmd(diveContext *common.DiveContext) *cobra.Command { serviceConfig, err := common.ReadServiceJsonFile() if err != nil { - diveContext.FatalError("Failed To Get Service Data", err.Error()) + diveContext.FatalError("failed to get service data", err.Error()) } if chains.chainAServiceName == "" { chainBserviceresponse, OK := serviceConfig[chains.chainBServiceName] if !OK { - diveContext.FatalError("Failed To Get Service Data", fmt.Sprint("service name not found:", chains.chainBServiceName)) + diveContext.FatalError("failed to get service data", fmt.Sprint("service name not found:", chains.chainBServiceName)) } chainBServiceName = chainBserviceresponse.ServiceName chainBServiceResponse, err = chainBserviceresponse.EncodeToString() if err != nil { - diveContext.FatalError("Failed To Get Service Data", err.Error()) + diveContext.FatalError("failed to get service data", err.Error()) } response := runChain[chains.chainA](diveContext) chainAServiceName = response.ServiceName chainAServiceResponse, err = response.EncodeToString() if err != nil { - diveContext.FatalError("Failed To Get Service Data", err.Error()) + diveContext.FatalError("failed to get service data", err.Error()) } } else if chains.chainBServiceName == "" { chainAserviceresponse, OK := serviceConfig[chains.chainAServiceName] if !OK { - diveContext.FatalError("Failed To Get Service Data", fmt.Sprint("service name not found:", chains.chainAServiceName)) + diveContext.FatalError("failed to get service data", fmt.Sprint("service name not found:", chains.chainAServiceName)) } chainAServiceName = chainAserviceresponse.ServiceName @@ -190,14 +190,14 @@ func btpBridgeCmd(diveContext *common.DiveContext) *cobra.Command { chainAServiceResponse, err = chainAserviceresponse.EncodeToString() if err != nil { - diveContext.FatalError("Failed To Get Service Data", err.Error()) + diveContext.FatalError("failed to get service data", err.Error()) } response := runChain[chains.chainB](diveContext) chainBServiceName = response.ServiceName chainBServiceResponse, err = response.EncodeToString() if err != nil { - diveContext.FatalError("Failed To Get Service Data", err.Error()) + diveContext.FatalError("failed to get service data", err.Error()) } } From f14a69aa51e6140856b5cb77b6d60468e805959b Mon Sep 17 00:00:00 2001 From: shreyasbhat0 Date: Mon, 14 Aug 2023 13:28:21 +0530 Subject: [PATCH 3/3] chore: bump dive cli version for release --- cli/common/constants.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/common/constants.go b/cli/common/constants.go index 533162d3..f7f341f7 100644 --- a/cli/common/constants.go +++ b/cli/common/constants.go @@ -3,7 +3,7 @@ package common var DiveLogs bool // !!!!!!!!!!! DO NOT UPDATE! WILL BE UPDATED DURING THE RELEASE PROCESS !!!!!!!!!!!!!!!!!!!!!! -var DiveVersion = "v0.0.5-beta" +var DiveVersion = "v0.0.6-beta" const ( DiveEnclave = "dive"