diff --git a/app/submodule/apitypes/network.go b/app/submodule/apitypes/network.go index 30dd7ee616..9be3773b2d 100644 --- a/app/submodule/apitypes/network.go +++ b/app/submodule/apitypes/network.go @@ -1,6 +1,6 @@ package apitypes -import "github.com/filecoin-project/venus/pkg/constants" +import "github.com/filecoin-project/venus/venus-shared/api" // Version provides various build-time information type Version struct { @@ -10,5 +10,5 @@ type Version struct { // this api // // See APIVersion in build/version.go - APIVersion constants.Version + APIVersion api.Version } diff --git a/app/submodule/network/network_api.go b/app/submodule/network/network_api.go index af49be13dd..54b6b501e7 100644 --- a/app/submodule/network/network_api.go +++ b/app/submodule/network/network_api.go @@ -64,7 +64,7 @@ func (na *networkAPI) NetworkPeers(ctx context.Context, verbose, latency, stream func (na *networkAPI) Version(context.Context) (types.Version, error) { return types.Version{ Version: constants.UserVersion(), - APIVersion: api.Version(constants.FullAPIVersion1), + APIVersion: api.FullAPIVersion1, }, nil } diff --git a/app/submodule/network/v0api/v1_wrapper.go b/app/submodule/network/v0api/v1_wrapper.go index 64b0797fdf..aefa9d46d2 100644 --- a/app/submodule/network/v0api/v1_wrapper.go +++ b/app/submodule/network/v0api/v1_wrapper.go @@ -5,7 +5,6 @@ import ( "github.com/filecoin-project/venus/venus-shared/types" - "github.com/filecoin-project/venus/pkg/constants" "github.com/filecoin-project/venus/venus-shared/api" v1api "github.com/filecoin-project/venus/venus-shared/api/chain/v1" ) @@ -20,7 +19,7 @@ func (w *WrapperV1INetwork) Version(ctx context.Context) (types.Version, error) return types.Version{}, err } - ver.APIVersion = api.Version(constants.FullAPIVersion0) + ver.APIVersion = api.FullAPIVersion0 return ver, nil } diff --git a/pkg/constants/version.go b/pkg/constants/version.go index fb2133284f..abc41a9eeb 100644 --- a/pkg/constants/version.go +++ b/pkg/constants/version.go @@ -17,15 +17,3 @@ func UserVersion() string { return BuildVersion + flags.GitCommit } - -type Version uint32 - -func newVer(major, minor, patch uint8) Version { - return Version(uint32(major)<<16 | uint32(minor)<<8 | uint32(patch)) -} - -// semver versions of the rpc api exposed -var ( - FullAPIVersion0 = newVer(1, 5, 0) - FullAPIVersion1 = newVer(2, 2, 0) -) diff --git a/venus-shared/api/version.go b/venus-shared/api/version.go index b80a222e21..ff1f525d0a 100644 --- a/venus-shared/api/version.go +++ b/venus-shared/api/version.go @@ -2,6 +2,7 @@ package api import ( "fmt" + "golang.org/x/xerrors" ) @@ -53,8 +54,8 @@ func VersionForType(nodeType NodeType) (Version, error) { // semver versions of the rpc api exposed var ( - FullAPIVersion0 = NewVer(1, 4, 0) - FullAPIVersion1 = NewVer(2, 1, 0) + FullAPIVersion0 = NewVer(1, 5, 0) + FullAPIVersion1 = NewVer(2, 2, 0) MinerAPIVersion0 = NewVer(1, 2, 0) WorkerAPIVersion0 = NewVer(1, 5, 0)