Skip to content

Commit

Permalink
update api version
Browse files Browse the repository at this point in the history
  • Loading branch information
simlecode committed Jan 13, 2022
1 parent 15a1e72 commit ba876f3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 19 deletions.
4 changes: 2 additions & 2 deletions app/submodule/apitypes/network.go
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -10,5 +10,5 @@ type Version struct {
// this api
//
// See APIVersion in build/version.go
APIVersion constants.Version
APIVersion api.Version
}
2 changes: 1 addition & 1 deletion app/submodule/network/network_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
3 changes: 1 addition & 2 deletions app/submodule/network/v0api/v1_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
}
Expand Down
12 changes: 0 additions & 12 deletions pkg/constants/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
5 changes: 3 additions & 2 deletions venus-shared/api/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package api

import (
"fmt"

"golang.org/x/xerrors"
)

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ba876f3

Please sign in to comment.