From a37e7f230aee9291eededc20814ac713f81a0e79 Mon Sep 17 00:00:00 2001 From: Gianguido Sora Date: Wed, 8 May 2024 14:27:58 +0200 Subject: [PATCH 1/2] app/version: v1.0-dev Instead of going with version v0.20, use v1.0. --- app/version/version.go | 6 ++---- app/version/version_test.go | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/version/version.go b/app/version/version.go index ebe21f0a0..8004579c8 100644 --- a/app/version/version.go +++ b/app/version/version.go @@ -15,7 +15,7 @@ import ( ) // version a string since it is overwritten at build-time with the git tag for official releases. -var version = "v0.20-dev" +var version = "v1.0-dev" // Version is the branch version of the codebase. // - Main branch: v0.X-dev @@ -25,9 +25,7 @@ var Version, _ = Parse(version) // Error is caught in tests. // Supported returns the supported minor versions in order of precedence. func Supported() []SemVer { return []SemVer{ - // Current minor version always goes first. - {major: 0, minor: 20}, - {major: 0, minor: 19}, + {major: 1, minor: 0}, } } diff --git a/app/version/version_test.go b/app/version/version_test.go index 614dbf209..e95a5a693 100644 --- a/app/version/version_test.go +++ b/app/version/version_test.go @@ -85,5 +85,5 @@ func TestSupportedAreminors(t *testing.T) { } func TestMultiSupported(t *testing.T) { - require.True(t, len(version.Supported()) > 1) + require.GreaterOrEqual(t, len(version.Supported()), 1) } From e749007d6ad5b52dda061e3824027dfa189c006a Mon Sep 17 00:00:00 2001 From: Gianguido Sora Date: Wed, 8 May 2024 14:40:17 +0200 Subject: [PATCH 2/2] app/peerinfo: fix peerinfo failing test Was assuming that charon is always compatible with at least two versions. --- app/peerinfo/peerinfo_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/peerinfo/peerinfo_test.go b/app/peerinfo/peerinfo_test.go index 3db32bd60..1210fcb8e 100644 --- a/app/peerinfo/peerinfo_test.go +++ b/app/peerinfo/peerinfo_test.go @@ -23,6 +23,12 @@ func TestPeerInfo(t *testing.T) { now := time.Now() const gitCommit = "1234567" + // when a major release happens, charon will only be compatible with a single version + versions := version.Supported() + if len(versions) < 2 { + versions = append(versions, versions...) + } + nodes := []struct { Version version.SemVer LockHash []byte @@ -30,15 +36,15 @@ func TestPeerInfo(t *testing.T) { Ignore bool }{ { - Version: version.Supported()[0], + Version: versions[0], LockHash: []byte("abcdef"), }, { - Version: version.Supported()[0], + Version: versions[0], LockHash: []byte("abcdef"), }, { - Version: version.Supported()[1], + Version: versions[1], LockHash: []byte("000000"), Offset: time.Minute, },