From 01b5d1bebb12298384f5683b7393ca53c6884990 Mon Sep 17 00:00:00 2001 From: Igor Sirotin Date: Wed, 13 Nov 2024 00:29:11 +0700 Subject: [PATCH] wip --- _assets/scripts/upgrade_module_version.sh | 16 ++++++++++++++++ .../generate_handlers_template.txt | 8 ++++---- .../server/parse-api/endpoints_template.txt | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100755 _assets/scripts/upgrade_module_version.sh diff --git a/_assets/scripts/upgrade_module_version.sh b/_assets/scripts/upgrade_module_version.sh new file mode 100755 index 000000000..b01007e83 --- /dev/null +++ b/_assets/scripts/upgrade_module_version.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +version=3 +oldVersion=$((version - 1)) + +rm extkeys/go.sum +rm extkeys/go.mod +rm exchanges/go.sum +rm exchanges/go.mod + +sed -i '' "s|github.com/status-im/status-go/v${oldVersion}|github.com/status-im/status-go/v${version}|g" cmd/generate_handlers/generate_handlers_template.txt +sed -i '' "s|github.com/status-im/status-go/v${oldVersion}|github.com/status-im/status-go/v${version}|g" cmd/status-backend/server/parse-api/endpoints_template.txt + +mod upgrade -tag ${version} + +find . -name "*.go" -exec sed -i '' "s/\/v${version}\/v${version}/\/v${version}/g" {} + \ No newline at end of file diff --git a/cmd/generate_handlers/generate_handlers_template.txt b/cmd/generate_handlers/generate_handlers_template.txt index 5384e2b73..1f5982db8 100644 --- a/cmd/generate_handlers/generate_handlers_template.txt +++ b/cmd/generate_handlers/generate_handlers_template.txt @@ -10,10 +10,10 @@ import ( "github.com/golang/protobuf/proto" "go.uber.org/zap" - "github.com/status-im/status-go/protocol/common" - "github.com/status-im/status-go/protocol/protobuf" - "github.com/status-im/status-go/protocol/transport" - v1protocol "github.com/status-im/status-go/protocol/v1" + "github.com/status-im/status-go/protocol/v2/common" + "github.com/status-im/status-go/protocol/v2/protobuf" + "github.com/status-im/status-go/protocol/v2/transport" + v1protocol "github.com/status-im/status-go/v3/protocol/v1" ) func (m *Messenger) dispatchToHandler(messageState *ReceivedMessageState, protoBytes []byte, msg *v1protocol.StatusMessage, filter transport.Filter, fromArchive bool) error { diff --git a/cmd/status-backend/server/parse-api/endpoints_template.txt b/cmd/status-backend/server/parse-api/endpoints_template.txt index 0cbafd32f..367031372 100644 --- a/cmd/status-backend/server/parse-api/endpoints_template.txt +++ b/cmd/status-backend/server/parse-api/endpoints_template.txt @@ -3,7 +3,7 @@ package server -import statusgo "github.com/status-im/status-go/mobile" +import statusgo "github.com/status-im/status-go/v3/mobile" var EndpointsWithRequest = map[string]func(string) string{ {{- range .FunctionsWithResp }}