Skip to content

Commit

Permalink
feat: refactor signer interface & remove gateway api that depends on …
Browse files Browse the repository at this point in the history
…account
  • Loading branch information
ta0li committed Aug 17, 2022
1 parent 64c38fa commit 78e276c
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 159 deletions.
2 changes: 0 additions & 2 deletions venus-shared/api/gateway/v0/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ Perms: admin
Inputs:
```json
[
"string value",
"f01234"
]
```
Expand All @@ -383,7 +382,6 @@ Perms: admin
Inputs:
```json
[
"string value",
"f01234",
"Ynl0ZSBhcnJheQ==",
{
Expand Down
16 changes: 8 additions & 8 deletions venus-shared/api/gateway/v0/mock/mock_igateway.go

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

16 changes: 8 additions & 8 deletions 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.

9 changes: 4 additions & 5 deletions venus-shared/api/gateway/v0/wallet_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ 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
WalletSign(ctx context.Context, account string, addr address.Address, toSign []byte, meta types.MsgMeta) (*crypto.Signature, error) //perm:admin

ListWalletInfo(ctx context.Context) ([]*gtypes.WalletDetail, error) //perm:admin
ListWalletInfoByWallet(ctx context.Context, wallet string) (*gtypes.WalletDetail, error) //perm:admin
WalletHas(ctx context.Context, addr address.Address) (bool, error) //perm:admin
WalletSign(ctx context.Context, addr address.Address, toSign []byte, meta types.MsgMeta) (*crypto.Signature, error) //perm:admin
}

type IWalletServiceProvider interface {
Expand Down
2 changes: 0 additions & 2 deletions venus-shared/api/gateway/v1/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ Perms: admin
Inputs:
```json
[
"string value",
"f01234"
]
```
Expand All @@ -386,7 +385,6 @@ Perms: admin
Inputs:
```json
[
"string value",
"f01234",
"Ynl0ZSBhcnJheQ==",
{
Expand Down
16 changes: 8 additions & 8 deletions venus-shared/api/gateway/v1/mock/mock_igateway.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/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
16 changes: 8 additions & 8 deletions 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.

8 changes: 4 additions & 4 deletions venus-shared/api/gateway/v1/wallet_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ 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
WalletSign(ctx context.Context, account string, addr address.Address, toSign []byte, meta types.MsgMeta) (*crypto.Signature, error) //perm:admin
ListWalletInfo(ctx context.Context) ([]*gtypes.WalletDetail, error) //perm:admin
ListWalletInfoByWallet(ctx context.Context, wallet string) (*gtypes.WalletDetail, error) //perm:admin
WalletHas(ctx context.Context, addr address.Address) (bool, error) //perm:admin
WalletSign(ctx context.Context, addr address.Address, toSign []byte, meta types.MsgMeta) (*crypto.Signature, error) //perm:admin
}

type IWalletServiceProvider interface {
Expand Down
2 changes: 0 additions & 2 deletions venus-shared/api/messager/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import (
type IMessager interface {
HasMessageByUid(ctx context.Context, id string) (bool, error) //perm:read
WaitMessage(ctx context.Context, id string, confidence uint64) (*mtypes.Message, error) //perm:read
ForcePushMessage(ctx context.Context, account string, msg *types.Message, meta *mtypes.SendSpec) (string, error) //perm:admin
ForcePushMessageWithId(ctx context.Context, id string, account string, msg *types.Message, meta *mtypes.SendSpec) (string, error) //perm:write
PushMessage(ctx context.Context, msg *types.Message, meta *mtypes.SendSpec) (string, error) //perm:write
PushMessageWithId(ctx context.Context, id string, msg *types.Message, meta *mtypes.SendSpec) (string, error) //perm:write
GetMessageByUid(ctx context.Context, id string) (*mtypes.Message, error) //perm:read
Expand Down
73 changes: 0 additions & 73 deletions venus-shared/api/messager/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
* [DeleteAddress](#DeleteAddress)
* [DeleteNode](#DeleteNode)
* [ForbiddenAddress](#ForbiddenAddress)
* [ForcePushMessage](#ForcePushMessage)
* [ForcePushMessageWithId](#ForcePushMessageWithId)
* [GetAddress](#GetAddress)
* [GetMessageByFromAndNonce](#GetMessageByFromAndNonce)
* [GetMessageBySignedCid](#GetMessageBySignedCid)
Expand Down Expand Up @@ -122,77 +120,6 @@ Inputs:

Response: `{}`

### ForcePushMessage


Perms: admin

Inputs:
```json
[
"string value",
{
"CID": {
"/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
},
"Version": 42,
"To": "f01234",
"From": "f01234",
"Nonce": 42,
"Value": "0",
"GasLimit": 9,
"GasFeeCap": "0",
"GasPremium": "0",
"Method": 1,
"Params": "Ynl0ZSBhcnJheQ=="
},
{
"expireEpoch": 10101,
"gasOverEstimation": 12.3,
"maxFee": "0",
"gasOverPremium": 12.3
}
]
```

Response: `"string value"`

### ForcePushMessageWithId


Perms: write

Inputs:
```json
[
"string value",
"string value",
{
"CID": {
"/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
},
"Version": 42,
"To": "f01234",
"From": "f01234",
"Nonce": 42,
"Value": "0",
"GasLimit": 9,
"GasFeeCap": "0",
"GasPremium": "0",
"Method": 1,
"Params": "Ynl0ZSBhcnJheQ=="
},
{
"expireEpoch": 10101,
"gasOverEstimation": 12.3,
"maxFee": "0",
"gasOverPremium": 12.3
}
]
```

Response: `"string value"`

### GetAddress


Expand Down
30 changes: 0 additions & 30 deletions venus-shared/api/messager/mock/mock_imessager.go

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

8 changes: 0 additions & 8 deletions venus-shared/api/messager/proxy_gen.go

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

0 comments on commit 78e276c

Please sign in to comment.