diff --git a/api/test/test.go b/api/test/test.go index a1b82c590a8..c6a76e10b8d 100644 --- a/api/test/test.go +++ b/api/test/test.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "os" + "strings" "testing" "time" @@ -157,7 +158,11 @@ func (ts *testSuite) testVersion(t *testing.T) { if err != nil { t.Fatal(err) } - require.Equal(t, v.Version, build.BuildVersion) + versions := strings.Split(v.Version, "+") + if len(versions) <= 0 { + t.Fatal("empty version") + } + require.Equal(t, versions[0], build.BuildVersion) } func (ts *testSuite) testSearchMsg(t *testing.T) { diff --git a/build/params_calibnet.go b/build/params_calibnet.go index 670efa776a2..1ae0adfa830 100644 --- a/build/params_calibnet.go +++ b/build/params_calibnet.go @@ -55,6 +55,8 @@ func init() { SetAddressNetwork(address.Testnet) Devnet = true + + BuildType = BuildCalibnet } const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds) diff --git a/build/params_mainnet.go b/build/params_mainnet.go index a4c3ab04ff3..1f4cd570978 100644 --- a/build/params_mainnet.go +++ b/build/params_mainnet.go @@ -58,6 +58,8 @@ func init() { } Devnet = false + + BuildType = BuildMainnet } const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds) diff --git a/build/version.go b/build/version.go index 9500d30c018..fe9fc07c586 100644 --- a/build/version.go +++ b/build/version.go @@ -10,19 +10,25 @@ var CurrentCommit string var BuildType int const ( - BuildDefault = 0 - Build2k = 0x1 - BuildDebug = 0x3 + BuildDefault = 0 + BuildMainnet = 0x1 + Build2k = 0x2 + BuildDebug = 0x3 + BuildCalibnet = 0x4 ) func buildType() string { switch BuildType { case BuildDefault: return "" - case BuildDebug: - return "+debug" + case BuildMainnet: + return "+mainnet" case Build2k: return "+2k" + case BuildDebug: + return "+debug" + case BuildCalibnet: + return "+calibnet" default: return "+huh?" }