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

feat: 重构链服务的签名及消息推送接口 / refactor signer & push-msg api #5183

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 11 additions & 0 deletions venus-devtool/api-gen/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ func init() {
Version: 0,
},
},
util.APIMeta{
Type: reflect.TypeOf((*gatewayv1.IGateway)(nil)).Elem(),
ParseOpt: util.InterfaceParseOption{
ImportPath: "github.com/filecoin-project/venus/venus-shared/api/gateway/v2",
IncludeAll: true,
},
RPCMeta: util.RPCMeta{
Version: 2,
MethodNamespace: "Gateway",
},
},
util.APIMeta{
Type: reflect.TypeOf((*gatewayv1.IGateway)(nil)).Elem(),
ParseOpt: util.InterfaceParseOption{
Expand Down
2 changes: 0 additions & 2 deletions venus-devtool/api-gen/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@ func init() {
Receipt: ExampleValue("init", reflect.TypeOf(&types.MessageReceipt{}), nil).(*types.MessageReceipt),
TipSetKey: tsk,
Meta: ExampleValue("init", reflect.TypeOf(&messager.SendSpec{}), nil).(*messager.SendSpec),
WalletName: "test",
FromUser: "test",
State: messager.UnFillMsg,
})
addExample(ExampleValue("init", reflect.TypeOf(&messager.SendSpec{}), nil).(*messager.SendSpec))
Expand Down
4 changes: 3 additions & 1 deletion venus-shared/api/gateway/v0/market_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/specs-storage/storage"

"github.com/ipfs/go-cid"

"github.com/filecoin-project/venus/venus-shared/types"
gtypes "github.com/filecoin-project/venus/venus-shared/types/gateway"
"github.com/ipfs/go-cid"
)

type IMarketEvent interface {
Expand Down
1 change: 1 addition & 0 deletions venus-shared/api/gateway/v0/proof_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"

"github.com/filecoin-project/venus/venus-shared/actors/builtin"
gtypes "github.com/filecoin-project/venus/venus-shared/types/gateway"
)
Expand Down
2 changes: 1 addition & 1 deletion venus-shared/api/gateway/v0/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions venus-shared/api/gateway/v0/wallet_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ type IWalletEvent interface {
type IWalletClient interface {
ListWalletInfo(ctx context.Context) ([]*gtypes.WalletDetail, error) //perm:admin
ListWalletInfoByWallet(ctx context.Context, wallet string) (*gtypes.WalletDetail, error) //perm:admin
WalletHas(ctx context.Context, supportAccount string, addr address.Address) (bool, error) //perm:admin
WalletHas(ctx context.Context, account string, addr address.Address) (bool, error) //perm:admin
WalletSign(ctx context.Context, account string, addr address.Address, toSign []byte, meta types.MsgMeta) (*crypto.Signature, error) //perm:admin

}

type IWalletServiceProvider interface {
Expand Down
4 changes: 3 additions & 1 deletion venus-shared/api/gateway/v1/market_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/specs-storage/storage"

"github.com/ipfs/go-cid"

"github.com/filecoin-project/venus/venus-shared/types"
gtypes "github.com/filecoin-project/venus/venus-shared/types/gateway"
"github.com/ipfs/go-cid"
)

type IMarketEvent interface {
Expand Down
2 changes: 1 addition & 1 deletion venus-shared/api/gateway/v1/proof_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type IProofClient interface {
ListConnectedMiners(ctx context.Context) ([]address.Address, error) //perm:admin
ListMinerConnection(ctx context.Context, addr address.Address) (*gtypes.MinerState, error) //perm:admin
ComputeProof(ctx context.Context, miner address.Address, sectorInfos []builtin.ExtendedSectorInfo, rand abi.PoStRandomness, height abi.ChainEpoch, nwVersion network.Version) ([]builtin.PoStProof, error) //perm:admin

}

type IProofServiceProvider interface {
ResponseProofEvent(ctx context.Context, resp *gtypes.ResponseEvent) error //perm:read
ListenProofEvent(ctx context.Context, policy *gtypes.ProofRegisterPolicy) (<-chan *gtypes.RequestEvent, error) //perm:read
Expand Down
2 changes: 1 addition & 1 deletion venus-shared/api/gateway/v1/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion venus-shared/api/gateway/v1/wallet_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type IWalletEvent interface {
type IWalletClient interface {
ListWalletInfo(ctx context.Context) ([]*gtypes.WalletDetail, error) //perm:admin
ListWalletInfoByWallet(ctx context.Context, wallet string) (*gtypes.WalletDetail, error) //perm:admin
WalletHas(ctx context.Context, supportAccount string, addr address.Address) (bool, error) //perm:admin
WalletHas(ctx context.Context, account string, addr address.Address) (bool, error) //perm:admin
WalletSign(ctx context.Context, account string, addr address.Address, toSign []byte, meta types.MsgMeta) (*crypto.Signature, error) //perm:admin
}

Expand Down
13 changes: 13 additions & 0 deletions venus-shared/api/gateway/v2/api.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package gateway

import (
"github.com/filecoin-project/venus/venus-shared/api"
)

type IGateway interface {
IProofEvent
IWalletEvent
IMarketEvent

api.Version
}
54 changes: 54 additions & 0 deletions venus-shared/api/gateway/v2/client_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions venus-shared/api/gateway/v2/market_event.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package gateway

import (
"context"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/specs-storage/storage"

"github.com/ipfs/go-cid"

"github.com/filecoin-project/venus/venus-shared/types"
gtypes "github.com/filecoin-project/venus/venus-shared/types/gateway"
)

type IMarketEvent interface {
IMarketClient
IMarketServiceProvider
}

type IMarketClient interface {
ListMarketConnectionsState(ctx context.Context) ([]gtypes.MarketConnectionState, error) //perm:admin
IsUnsealed(ctx context.Context, miner address.Address, pieceCid cid.Cid, sector storage.SectorRef, offset types.PaddedByteIndex, size abi.PaddedPieceSize) (bool, error) //perm:admin
SectorsUnsealPiece(ctx context.Context, miner address.Address, pieceCid cid.Cid, sector storage.SectorRef, offset types.PaddedByteIndex, size abi.PaddedPieceSize, dest string) error //perm:admin
}

type IMarketServiceProvider interface {
ResponseMarketEvent(ctx context.Context, resp *gtypes.ResponseEvent) error //perm:read
ListenMarketEvent(ctx context.Context, policy *gtypes.MarketRegisterPolicy) (<-chan *gtypes.RequestEvent, error) //perm:read
}
Loading