diff --git a/venus-shared/api/wallet/common.go b/venus-shared/api/wallet/common.go index baab87cc3c..1604f85b01 100644 --- a/venus-shared/api/wallet/common.go +++ b/venus-shared/api/wallet/common.go @@ -16,7 +16,7 @@ type ICommon interface { LogList(context.Context) ([]string, error) //perm:read LogSetLevel(context.Context, string, string) error //perm:write - QuerySignRecord(ctx context.Context, param *types.QuerySignRecordParams) ([]types.SignRecord, error) //perm:read + ListSignedRecord(ctx context.Context, param *types.QuerySignRecordParams) ([]types.SignRecord, error) //perm:read api.Version } diff --git a/venus-shared/api/wallet/method.md b/venus-shared/api/wallet/method.md index 2f00a40a06..99982e56cc 100644 --- a/venus-shared/api/wallet/method.md +++ b/venus-shared/api/wallet/method.md @@ -9,9 +9,9 @@ curl http://:/rpc/v0 -X POST -H "Content-Type: application/json" -H " * [Common](#common) * [AuthNew](#authnew) * [AuthVerify](#authverify) + * [ListSignedRecord](#listsignedrecord) * [LogList](#loglist) * [LogSetLevel](#logsetlevel) - * [QuerySignRecord](#querysignrecord) * [Version](#version) * [Wallet](#wallet) * [WalletDelete](#walletdelete) @@ -69,36 +69,7 @@ Response: ] ``` -### LogList - - -Perms: read - -Inputs: `[]` - -Response: -```json -[ - "string value" -] -``` - -### LogSetLevel - - -Perms: write - -Inputs: -```json -[ - "string value", - "string value" -] -``` - -Response: `{}` - -### QuerySignRecord +### ListSignedRecord Perms: read @@ -127,12 +98,45 @@ Response: "Type": "message", "Signer": "f01234", "Err": {}, - "Msg": "Ynl0ZSBhcnJheQ==", + "RawMsg": "Ynl0ZSBhcnJheQ==", + "Signature": { + "Type": 2, + "Data": "Ynl0ZSBhcnJheQ==" + }, "CreateAt": "0001-01-01T00:00:00Z" } ] ``` +### LogList + + +Perms: read + +Inputs: `[]` + +Response: +```json +[ + "string value" +] +``` + +### LogSetLevel + + +Perms: write + +Inputs: +```json +[ + "string value", + "string value" +] +``` + +Response: `{}` + ### Version Version provides information about API provider diff --git a/venus-shared/api/wallet/mock/mock_ifullapi.go b/venus-shared/api/wallet/mock/mock_ifullapi.go index db5d7d0025..4507bf1935 100644 --- a/venus-shared/api/wallet/mock/mock_ifullapi.go +++ b/venus-shared/api/wallet/mock/mock_ifullapi.go @@ -96,6 +96,21 @@ func (mr *MockIFullAPIMockRecorder) AuthVerify(arg0, arg1 interface{}) *gomock.C return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthVerify", reflect.TypeOf((*MockIFullAPI)(nil).AuthVerify), arg0, arg1) } +// ListSignedRecord mocks base method. +func (m *MockIFullAPI) ListSignedRecord(arg0 context.Context, arg1 *types.QuerySignRecordParams) ([]types.SignRecord, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListSignedRecord", arg0, arg1) + ret0, _ := ret[0].([]types.SignRecord) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListSignedRecord indicates an expected call of ListSignedRecord. +func (mr *MockIFullAPIMockRecorder) ListSignedRecord(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSignedRecord", reflect.TypeOf((*MockIFullAPI)(nil).ListSignedRecord), arg0, arg1) +} + // Lock mocks base method. func (m *MockIFullAPI) Lock(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() @@ -153,21 +168,6 @@ func (mr *MockIFullAPIMockRecorder) LogSetLevel(arg0, arg1, arg2 interface{}) *g return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LogSetLevel", reflect.TypeOf((*MockIFullAPI)(nil).LogSetLevel), arg0, arg1, arg2) } -// QuerySignRecord mocks base method. -func (m *MockIFullAPI) QuerySignRecord(arg0 context.Context, arg1 *types.QuerySignRecordParams) ([]types.SignRecord, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "QuerySignRecord", arg0, arg1) - ret0, _ := ret[0].([]types.SignRecord) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// QuerySignRecord indicates an expected call of QuerySignRecord. -func (mr *MockIFullAPIMockRecorder) QuerySignRecord(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QuerySignRecord", reflect.TypeOf((*MockIFullAPI)(nil).QuerySignRecord), arg0, arg1) -} - // SetPassword mocks base method. func (m *MockIFullAPI) SetPassword(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() diff --git a/venus-shared/api/wallet/proxy_gen.go b/venus-shared/api/wallet/proxy_gen.go index 9be83b1d81..f2b1c2eb06 100644 --- a/venus-shared/api/wallet/proxy_gen.go +++ b/venus-shared/api/wallet/proxy_gen.go @@ -74,12 +74,12 @@ type ILocalWalletStruct struct { type ICommonStruct struct { Internal struct { - AuthNew func(ctx context.Context, perms []auth.Permission) ([]byte, error) `perm:"admin"` - AuthVerify func(ctx context.Context, token string) ([]auth.Permission, error) `perm:"read"` - LogList func(context.Context) ([]string, error) `perm:"read"` - LogSetLevel func(context.Context, string, string) error `perm:"write"` - QuerySignRecord func(ctx context.Context, param *types.QuerySignRecordParams) ([]types.SignRecord, error) `perm:"read"` - Version func(ctx context.Context) (types.Version, error) `perm:"read"` + AuthNew func(ctx context.Context, perms []auth.Permission) ([]byte, error) `perm:"admin"` + AuthVerify func(ctx context.Context, token string) ([]auth.Permission, error) `perm:"read"` + ListSignedRecord func(ctx context.Context, param *types.QuerySignRecordParams) ([]types.SignRecord, error) `perm:"read"` + LogList func(context.Context) ([]string, error) `perm:"read"` + LogSetLevel func(context.Context, string, string) error `perm:"write"` + Version func(ctx context.Context) (types.Version, error) `perm:"read"` } } @@ -89,13 +89,13 @@ func (s *ICommonStruct) AuthNew(p0 context.Context, p1 []auth.Permission) ([]byt func (s *ICommonStruct) AuthVerify(p0 context.Context, p1 string) ([]auth.Permission, error) { return s.Internal.AuthVerify(p0, p1) } +func (s *ICommonStruct) ListSignedRecord(p0 context.Context, p1 *types.QuerySignRecordParams) ([]types.SignRecord, error) { + return s.Internal.ListSignedRecord(p0, p1) +} func (s *ICommonStruct) LogList(p0 context.Context) ([]string, error) { return s.Internal.LogList(p0) } func (s *ICommonStruct) LogSetLevel(p0 context.Context, p1 string, p2 string) error { return s.Internal.LogSetLevel(p0, p1, p2) } -func (s *ICommonStruct) QuerySignRecord(p0 context.Context, p1 *types.QuerySignRecordParams) ([]types.SignRecord, error) { - return s.Internal.QuerySignRecord(p0, p1) -} func (s *ICommonStruct) Version(p0 context.Context) (types.Version, error) { return s.Internal.Version(p0) } diff --git a/venus-shared/types/msg_meta.go b/venus-shared/types/msg_meta.go index 7e245f6e59..9f59b2f86e 100644 --- a/venus-shared/types/msg_meta.go +++ b/venus-shared/types/msg_meta.go @@ -4,6 +4,7 @@ import ( "time" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-state-types/crypto" ) type MsgType string @@ -59,10 +60,11 @@ type QuerySignRecordParams struct { } type SignRecord struct { - ID string - Type MsgType - Signer address.Address - Err error - Msg []byte - CreateAt time.Time + ID string + Type MsgType + Signer address.Address + Err error + RawMsg []byte + Signature *crypto.Signature + CreateAt time.Time }