Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[skip changelog] chore: types: buildconstants split post-cleanup #12246

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 31 additions & 9 deletions build/buildconstants/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,40 @@ package buildconstants

import "github.com/filecoin-project/go-state-types/network"

var BuildType int

const (
BuildDefault = 0
BuildMainnet = 0x1
Build2k = 0x2
BuildDebug = 0x3
BuildCalibnet = 0x4
BuildInteropnet = 0x5
BuildButterflynet = 0x7
BuildDefault = iota
BuildMainnet
Build2k
BuildDebug
BuildCalibnet
BuildInteropnet
unused1
aarshkshah1992 marked this conversation as resolved.
Show resolved Hide resolved
BuildButterflynet
)

var BuildType int

func BuildTypeString() string {
switch BuildType {
case BuildDefault:
return ""
case BuildMainnet:
return "+mainnet"
case Build2k:
return "+2k"
case BuildDebug:
return "+debug"
case BuildCalibnet:
return "+calibnet"
case BuildInteropnet:
return "+interopnet"
case BuildButterflynet:
return "+butterflynet"
default:
return "+huh?"
}
}

var Devnet = true

// Used by tests and some obscure tooling
Expand Down
46 changes: 14 additions & 32 deletions build/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,6 @@ import (
"github.com/filecoin-project/lotus/build/buildconstants"
)

type BuildVersion string

var CurrentCommit string
var BuildType = buildconstants.BuildType // Deprecated: Use buildconstants.BuildType instead
var BuildMainnet = buildconstants.BuildMainnet // Deprecated: Use buildconstants.BuildMainnet instead
var Build2k = buildconstants.Build2k // Deprecated: Use buildconstants.Build2k instead
var BuildDebug = buildconstants.BuildDebug // Deprecated: Use buildconstants.BuildDebug instead
var BuildCalibnet = buildconstants.BuildCalibnet // Deprecated: Use buildconstants.BuildCalibnet instead
var BuildInteropnet = buildconstants.BuildInteropnet // Deprecated: Use buildconstants.BuildInteropnet instead
var BuildButterflynet = buildconstants.BuildButterflynet // Deprecated: Use buildconstants.BuildButterflynet instead

func BuildTypeString() string {
switch BuildType {
case buildconstants.BuildDefault:
return ""
case buildconstants.BuildMainnet:
return "+mainnet"
case buildconstants.Build2k:
return "+2k"
case buildconstants.BuildDebug:
return "+debug"
case buildconstants.BuildCalibnet:
return "+calibnet"
case buildconstants.BuildInteropnet:
return "+interopnet"
case buildconstants.BuildButterflynet:
return "+butterflynet"
default:
return "+huh?"
}
}

// NodeBuildVersion is the local build version of the Lotus daemon
const NodeBuildVersion string = "1.28.1-dev"

Expand All @@ -59,3 +27,17 @@ func MinerUserVersion() BuildVersion {

return BuildVersion(MinerBuildVersion + BuildTypeString() + CurrentCommit)
}

var BuildType = buildconstants.BuildType // Deprecated: Use buildconstants.BuildType instead
var BuildMainnet = buildconstants.BuildMainnet // Deprecated: Use buildconstants.BuildMainnet instead
var Build2k = buildconstants.Build2k // Deprecated: Use buildconstants.Build2k instead
var BuildDebug = buildconstants.BuildDebug // Deprecated: Use buildconstants.BuildDebug instead
var BuildCalibnet = buildconstants.BuildCalibnet // Deprecated: Use buildconstants.BuildCalibnet instead
var BuildInteropnet = buildconstants.BuildInteropnet // Deprecated: Use buildconstants.BuildInteropnet instead
var BuildButterflynet = buildconstants.BuildButterflynet // Deprecated: Use buildconstants.BuildButterflynet instead

var BuildTypeString = buildconstants.BuildTypeString // Deprecated: Use buildconstants.BuildTypeString instead

type BuildVersion string

var CurrentCommit string