-
Notifications
You must be signed in to change notification settings - Fork 105
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
[CT-1160] add relevant protos to dydxprotocol #2162
Conversation
WalkthroughThe changes introduce new protocol buffer messages and services within the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant AuthenticatorService
participant AccountManager
Client->>AuthenticatorService: AddAuthenticator(request)
AuthenticatorService->>AccountManager: Process addition
AccountManager-->>AuthenticatorService: Confirm addition
AuthenticatorService-->>Client: Respond with success
Client->>AuthenticatorService: RemoveAuthenticator(request)
AuthenticatorService->>AccountManager: Process removal
AccountManager-->>AuthenticatorService: Confirm removal
AuthenticatorService-->>Client: Respond with success
Client->>AuthenticatorService: GetAuthenticators(request)
AuthenticatorService->>AccountManager: Fetch all authenticators
AccountManager-->>AuthenticatorService: Return list of authenticators
AuthenticatorService-->>Client: Respond with list
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (5)
protocol/x/accountplus/types/genesis.pb.go
is excluded by!**/*.pb.go
protocol/x/accountplus/types/models.pb.go
is excluded by!**/*.pb.go
protocol/x/accountplus/types/query.pb.go
is excluded by!**/*.pb.go
protocol/x/accountplus/types/query.pb.gw.go
is excluded by!**/*.pb.gw.go
protocol/x/accountplus/types/tx.pb.go
is excluded by!**/*.pb.go
Files selected for processing (4)
- proto/dydxprotocol/accountplus/genesis.proto (1 hunks)
- proto/dydxprotocol/accountplus/models.proto (1 hunks)
- proto/dydxprotocol/accountplus/query.proto (1 hunks)
- proto/dydxprotocol/accountplus/tx.proto (1 hunks)
Additional context used
buf
proto/dydxprotocol/accountplus/models.proto
2-2: Files with package "dydxprotocol.accountplus" must be within a directory "dydxprotocol/accountplus" relative to root but were in directory "proto/dydxprotocol/accountplus".
(PACKAGE_DIRECTORY_MATCH)
proto/dydxprotocol/accountplus/query.proto
4-4: import "google/api/annotations.proto": file does not exist
(COMPILE)
proto/dydxprotocol/accountplus/tx.proto
4-4: import "cosmos/msg/v1/msg.proto": file does not exist
(COMPILE)
Additional comments not posted (11)
proto/dydxprotocol/accountplus/models.proto (1)
1-22
: LGTM!The
AccountAuthenticator
message is well-defined and follows protobuf conventions. The comments provide clear explanations of the fields and their purposes.The code changes are approved.
Tools
buf
2-2: Files with package "dydxprotocol.accountplus" must be within a directory "dydxprotocol/accountplus" relative to root but were in directory "proto/dydxprotocol/accountplus".
(PACKAGE_DIRECTORY_MATCH)
proto/dydxprotocol/accountplus/genesis.proto (2)
10-21
: LGTM!The
AuthenticatorData
message is well-defined and follows protobuf conventions. The comments provide clear explanations of the fields and their purposes.The code changes are approved.
27-33
: LGTM!The modifications to the
GenesisState
message enhance the structure of the protocol's genesis state. The comments provide clear explanations of the new fields and their purposes.The code changes are approved.
proto/dydxprotocol/accountplus/query.proto (3)
9-23
: LGTM!The service definition is well-structured and follows gRPC conventions. The comments provide clear explanations of the RPC methods and their purposes.
The code changes are approved.
26-32
: LGTM!The message definitions are well-structured and follow protobuf conventions. The comments provide clear explanations of the fields and their purposes.
The code changes are approved.
34-42
: LGTM!The message definitions are well-structured and follow protobuf conventions. The comments provide clear explanations of the fields and their purposes.
The code changes are approved.
proto/dydxprotocol/accountplus/tx.proto (5)
1-2
: LGTM!The syntax and package declarations are correct.
The code changes are approved.
7-7
: LGTM!The go_package option declaration is correct.
The code changes are approved.
9-17
: LGTM!The service definition and RPC methods are correctly defined.
The code changes are approved.
19-51
: LGTM!The message definitions are correctly defined.
The code changes are approved.
4-5
: Verify the existence of the imported file.The import
cosmos/msg/v1/msg.proto
does not exist according to the static analysis tool.Run the following script to verify the existence of the imported file:
Tools
buf
4-4: import "cosmos/msg/v1/msg.proto": file does not exist
(COMPILE)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- protocol/app/testdata/default_genesis_state.json (1 hunks)
- protocol/scripts/genesis/sample_pregenesis.json (1 hunks)
Additional comments not posted (4)
protocol/app/testdata/default_genesis_state.json (2)
133-133
: LGTM!The addition of the
next_authenticator_id
field is appropriate and correctly initialized with"0"
.The code changes are approved.
134-134
: LGTM!The addition of the
authenticator_data
field is appropriate and correctly initialized as an empty array.The code changes are approved.
protocol/scripts/genesis/sample_pregenesis.json (2)
641-641
: Addition ofauthenticator_data
field.The
authenticator_data
field is added as an empty array. Ensure that this field is populated correctly during runtime and that its structure is well-defined in the relevant documentation.Verify that the
authenticator_data
field is correctly populated and utilized in the codebase.
642-642
: Addition ofnext_authenticator_id
field.The
next_authenticator_id
field is added with an initial value of"0"
. Ensure that this field is incremented correctly during runtime and that its usage is well-documented.Verify that the
next_authenticator_id
field is correctly incremented and utilized in the codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (13)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/genesis.ts (4 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/models.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.lcd.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.rpc.Query.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/tx.rpc.msg.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/tx.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts (2 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.query.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/gogoproto/bundle.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/google/bundle.ts (1 hunks)
Files skipped from review due to trivial changes (2)
- indexer/packages/v4-protos/src/codegen/gogoproto/bundle.ts
- indexer/packages/v4-protos/src/codegen/google/bundle.ts
Additional comments not posted (69)
indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.lcd.ts (3)
6-14
: LGTM!The constructor is correctly initializing the
req
property and binding methods.The code changes are approved.
18-21
: LGTM!The method is correctly constructing the endpoint URL and making a GET request.
The code changes are approved.
25-28
: LGTM!The method is correctly constructing the endpoint URL and making a GET request.
The code changes are approved.
indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts (1)
8-8
: LGTM!The addition of the
accountplus
property enhances the functionality of thedydxprotocol
object. The dynamic import pattern is consistent with the existing code.The code changes are approved.
indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/tx.rpc.msg.ts (4)
6-12
: LGTM!The interface is correctly defining the methods for adding and removing authenticators.
The code changes are approved.
16-20
: LGTM!The constructor is correctly initializing the
rpc
property and binding methods.The code changes are approved.
22-26
: LGTM!The method is correctly encoding the request, making an RPC request, and decoding the response.
The code changes are approved.
28-32
: LGTM!The method is correctly encoding the request, making an RPC request, and decoding the response.
The code changes are approved.
indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts (1)
12-14
: LGTM!The addition of the
accountplus
property enhances the functionality of thecreateLCDClient
by integrating additional capabilities related to theaccountplus
module. The asynchronous import ensures that the module is loaded only when needed, which is efficient.The code changes are approved.
indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.rpc.Query.ts (1)
1-49
: LGTM!The file is well-structured and provides a clear implementation of the gRPC querier service for the
accountplus
module. The methods for querying authenticators are correctly implemented, and thecreateRpcQueryExtension
function ensures that the extension can be easily integrated with theQueryClient
.The code changes are approved.
indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.query.ts (1)
12-12
: LGTM!The addition of the
accountplus
property enhances the functionality of thecreateRPCQueryClient
by integrating an additional RPC query extension related to theaccountplus
feature. The dynamic import ensures that the module is loaded only when needed, which is efficient.The code changes are approved.
indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/models.ts (6)
9-26
: LGTM!The
AccountAuthenticator
interface is well-defined with necessary fields and appropriate comments.The code changes are approved.
34-51
: LGTM!The
AccountAuthenticatorSDKType
interface is well-defined with necessary fields and appropriate comments.The code changes are approved.
54-59
: LGTM!The
createBaseAccountAuthenticator
function correctly initializes the fields ofAccountAuthenticator
.The code changes are approved.
62-77
: LGTM!The
AccountAuthenticator.encode
function correctly encodes the fields ofAccountAuthenticator
.The code changes are approved.
79-107
: LGTM!The
AccountAuthenticator.decode
function correctly decodes the fields ofAccountAuthenticator
.The code changes are approved.
109-114
: LGTM!The
AccountAuthenticator.fromPartial
function correctly initializes the fields ofAccountAuthenticator
from a partial object.The code changes are approved.
indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/genesis.ts (12)
11-19
: LGTM!The
AuthenticatorData
interface is well-defined with necessary fields and appropriate comments.The code changes are approved.
27-35
: LGTM!The
AuthenticatorDataSDKType
interface is well-defined with necessary fields and appropriate comments.The code changes are approved.
40-49
: LGTM!The
GenesisState
interface is well-defined with necessary fields and appropriate comments.The code changes are approved.
54-63
: LGTM!The
GenesisStateSDKType
interface is well-defined with necessary fields and appropriate comments.The code changes are approved.
66-70
: LGTM!The
createBaseAuthenticatorData
function correctly initializes the fields ofAuthenticatorData
.The code changes are approved.
73-83
: LGTM!The
AuthenticatorData.encode
function correctly encodes the fields ofAuthenticatorData
.The code changes are approved.
86-109
: LGTM!The
AuthenticatorData.decode
function correctly decodes the fields ofAuthenticatorData
.The code changes are approved.
112-116
: LGTM!The
AuthenticatorData.fromPartial
function correctly initializes the fields ofAuthenticatorData
from a partial object.The code changes are approved.
120-125
: LGTM!The
createBaseGenesisState
function correctly initializes the fields ofGenesisState
.The code changes are approved.
Line range hint
128-142
: LGTM!The
GenesisState.encode
function correctly encodes the fields ofGenesisState
.The code changes are approved.
Line range hint
145-165
: LGTM!The
GenesisState.decode
function correctly decodes the fields ofGenesisState
.The code changes are approved.
178-180
: LGTM!The
GenesisState.fromPartial
function correctly initializes the fields ofGenesisState
from a partial object.The code changes are approved.
indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.ts (9)
6-8
: LGTM!The
GetAuthenticatorsRequest
interface is well-defined with necessary fields and appropriate comments.The code changes are approved.
18-19
: LGTM!The
GetAuthenticatorsResponse
interface is well-defined with necessary fields and appropriate comments.The code changes are approved.
28-30
: LGTM!The
GetAuthenticatorRequest
interface is well-defined with necessary fields and appropriate comments.The code changes are approved.
40-41
: LGTM!The
GetAuthenticatorResponse
interface is well-defined with necessary fields and appropriate comments.The code changes are approved.
49-52
: LGTM!The
createBaseGetAuthenticatorsRequest
function correctly initializes the fields ofGetAuthenticatorsRequest
.The code changes are approved.
56-62
: LGTM!The
GetAuthenticatorsRequest.encode
function correctly encodes the fields ofGetAuthenticatorsRequest
.The code changes are approved.
64-83
: LGTM!The
GetAuthenticatorsRequest.decode
function correctly decodes the fields ofGetAuthenticatorsRequest
.The code changes are approved.
86-90
: LGTM!The
GetAuthenticatorsRequest.fromPartial
function correctly initializes the fields ofGetAuthenticatorsRequest
from a partial object.The code changes are approved.
94-97
: LGTM!The
createBaseGetAuthenticatorsResponse
function correctly initializes the fields ofGetAuthenticatorsResponse
.The code changes are approved.
indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/tx.ts (26)
5-9
: LGTM!The
MsgAddAuthenticator
interface is correctly defined.The code changes are approved.
12-16
: LGTM!The
MsgAddAuthenticatorSDKType
interface is correctly defined.The code changes are approved.
19-22
: LGTM!The
MsgAddAuthenticatorResponse
interface is correctly defined.The code changes are approved.
25-28
: LGTM!The
MsgAddAuthenticatorResponseSDKType
interface is correctly defined.The code changes are approved.
34-37
: LGTM!The
MsgRemoveAuthenticator
interface is correctly defined.The code changes are approved.
43-45
: LGTM!The
MsgRemoveAuthenticatorSDKType
interface is correctly defined.The code changes are approved.
96-101
: LGTM!The
createBaseMsgAddAuthenticator
function is correctly implemented.The code changes are approved.
104-119
: LGTM!The
MsgAddAuthenticator.encode
function is correctly implemented.The code changes are approved.
121-149
: LGTM!The
MsgAddAuthenticator.decode
function is correctly implemented.The code changes are approved.
151-157
: LGTM!The
MsgAddAuthenticator.fromPartial
function is correctly implemented.The code changes are approved.
161-164
: LGTM!The
createBaseMsgAddAuthenticatorResponse
function is correctly implemented.The code changes are approved.
167-174
: LGTM!The
MsgAddAuthenticatorResponse.encode
function is correctly implemented.The code changes are approved.
176-196
: LGTM!The
MsgAddAuthenticatorResponse.decode
function is correctly implemented.The code changes are approved.
198-202
: LGTM!The
MsgAddAuthenticatorResponse.fromPartial
function is correctly implemented.The code changes are approved.
206-210
: LGTM!The
createBaseMsgRemoveAuthenticator
function is correctly implemented.The code changes are approved.
213-224
: LGTM!The
MsgRemoveAuthenticator.encode
function is correctly implemented.The code changes are approved.
226-250
: LGTM!The
MsgRemoveAuthenticator.decode
function is correctly implemented.The code changes are approved.
252-257
: LGTM!The
MsgRemoveAuthenticator.fromPartial
function is correctly implemented.The code changes are approved.
261-264
: LGTM!The
createBaseMsgRemoveAuthenticatorResponse
function is correctly implemented.The code changes are approved.
267-274
: LGTM!The
MsgRemoveAuthenticatorResponse.encode
function is correctly implemented.The code changes are approved.
276-296
: LGTM!The
MsgRemoveAuthenticatorResponse.decode
function is correctly implemented.The code changes are approved.
298-302
: LGTM!The
MsgRemoveAuthenticatorResponse.fromPartial
function is correctly implemented.The code changes are approved.
306-309
: LGTM!The
createBaseTxExtension
function is correctly implemented.The code changes are approved.
312-322
: LGTM!The
TxExtension.encode
function is correctly implemented.The code changes are approved.
324-352
: LGTM!The
TxExtension.decode
function is correctly implemented.The code changes are approved.
355-359
: LGTM!The
TxExtension.fromPartial
function is correctly implemented.The code changes are approved.
indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts (5)
3-5
: LGTM!The import statements for
accountplus
are correctly defined.The code changes are approved.
6-9
: LGTM!The import statements for
affiliates
are correctly defined.The code changes are approved.
10-13
: LGTM!The import statements for
assets
are correctly defined.The code changes are approved.
14-18
: LGTM!The import statements for
blocktime
are correctly defined.The code changes are approved.
19-24
: LGTM!The import statements for
bridge
are correctly defined.The code changes are approved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Outside diff range, codebase verification and nitpick comments (2)
indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/tx.ts (2)
85-85
: Consider using a type alias instead of an empty interface.An empty interface is equivalent to
{}
. For better readability, consider using a type alias instead:type MsgSetActiveStateResponse = Record<string, never>;Tools
Biome
[error] 85-85: An empty interface is equivalent to {}.
Safe fix: Use a type alias instead.
(lint/suspicious/noEmptyInterface)
88-88
: Consider using a type alias instead of an empty interface.An empty interface is equivalent to
{}
. For better readability, consider using a type alias instead:type MsgSetActiveStateResponseSDKType = Record<string, never>;Tools
Biome
[error] 88-88: An empty interface is equivalent to {}.
Safe fix: Use a type alias instead.
(lint/suspicious/noEmptyInterface)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (5)
protocol/x/accountplus/types/genesis.pb.go
is excluded by!**/*.pb.go
protocol/x/accountplus/types/params.pb.go
is excluded by!**/*.pb.go
protocol/x/accountplus/types/query.pb.go
is excluded by!**/*.pb.go
protocol/x/accountplus/types/query.pb.gw.go
is excluded by!**/*.pb.gw.go
protocol/x/accountplus/types/tx.pb.go
is excluded by!**/*.pb.go
Files selected for processing (17)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/genesis.ts (4 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/params.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.lcd.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.rpc.Query.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/tx.rpc.msg.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/tx.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts (2 hunks)
- indexer/packages/v4-protos/src/codegen/gogoproto/bundle.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/google/bundle.ts (1 hunks)
- proto/dydxprotocol/accountplus/genesis.proto (1 hunks)
- proto/dydxprotocol/accountplus/models.proto (1 hunks)
- proto/dydxprotocol/accountplus/params.proto (1 hunks)
- proto/dydxprotocol/accountplus/query.proto (1 hunks)
- proto/dydxprotocol/accountplus/tx.proto (1 hunks)
- protocol/app/testdata/default_genesis_state.json (1 hunks)
- protocol/scripts/genesis/sample_pregenesis.json (1 hunks)
Files skipped from review as they are similar to previous changes (8)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.lcd.ts
- indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.rpc.Query.ts
- indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/tx.rpc.msg.ts
- indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts
- indexer/packages/v4-protos/src/codegen/gogoproto/bundle.ts
- indexer/packages/v4-protos/src/codegen/google/bundle.ts
- protocol/app/testdata/default_genesis_state.json
- protocol/scripts/genesis/sample_pregenesis.json
Additional context used
buf
proto/dydxprotocol/accountplus/params.proto
4-4: import "gogoproto/gogo.proto": file does not exist
(COMPILE)
proto/dydxprotocol/accountplus/models.proto
2-2: Files with package "dydxprotocol.accountplus" must be within a directory "dydxprotocol/accountplus" relative to root but were in directory "proto/dydxprotocol/accountplus".
(PACKAGE_DIRECTORY_MATCH)
proto/dydxprotocol/accountplus/query.proto
4-4: import "gogoproto/gogo.proto": file does not exist
(COMPILE)
proto/dydxprotocol/accountplus/tx.proto
4-4: import "cosmos/msg/v1/msg.proto": file does not exist
(COMPILE)
Biome
indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.ts
[error] 7-7: An empty interface is equivalent to {}.
Safe fix: Use a type alias instead.
(lint/suspicious/noEmptyInterface)
[error] 10-10: An empty interface is equivalent to {}.
Safe fix: Use a type alias instead.
(lint/suspicious/noEmptyInterface)
indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/tx.ts
[error] 85-85: An empty interface is equivalent to {}.
Safe fix: Use a type alias instead.
(lint/suspicious/noEmptyInterface)
[error] 88-88: An empty interface is equivalent to {}.
Safe fix: Use a type alias instead.
(lint/suspicious/noEmptyInterface)
Additional comments not posted (32)
proto/dydxprotocol/accountplus/params.proto (1)
4-4
: Verify the existence of the imported file.The static analysis tool
buf
reports that the imported filegogoproto/gogo.proto
does not exist.Run the following script to verify the existence of the imported file:
Tools
buf
4-4: import "gogoproto/gogo.proto": file does not exist
(COMPILE)
proto/dydxprotocol/accountplus/models.proto (1)
9-23
: LGTM!The
AccountAuthenticator
message definition looks good. The comments provide a clear explanation of the message and its fields.proto/dydxprotocol/accountplus/genesis.proto (4)
6-6
: LGTM!The import statement is necessary to use the message types defined in the
models.proto
file.
14-22
: LGTM!The
AuthenticatorData
message is a well-defined message type that enhances the structure of the protocol's genesis state by allowing for a more organized representation of accounts and their associated authenticators.
32-32
: LGTM!The
next_authenticator_id
field is a useful addition to theGenesisState
message as it helps in managing the authenticator IDs.
36-37
: LGTM!The
authenticator_data
field is a useful addition to theGenesisState
message as it allows for a more organized representation of accounts and their associated authenticators within the genesis state.indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/params.ts (1)
1-67
: LGTM!The code segment follows the protocol buffer style guide and naming conventions. It is well-structured, modular, and provides clear and concise documentation for the parameters. The encoding, decoding, and creation of
Params
objects are handled correctly.proto/dydxprotocol/accountplus/query.proto (2)
12-31
: LGTM!The
Query
service definition looks good and follows the standard practices for defining gRPC services in proto files.
33-59
: LGTM!The request and response message definitions look good and follow the best practices for defining protocol buffer messages.
proto/dydxprotocol/accountplus/tx.proto (8)
10-21
: LGTM!The
Msg
service definition looks good:
- The service defines 3 RPC methods for managing account authenticators.
- Each RPC method has a request and response message type defined.
- The service definition follows the protocol buffer style guide.
The code changes are approved.
24-31
: LGTM!The
MsgAddAuthenticator
message definition looks good:
- The message has 3 fields for specifying the sender, authenticator type, and data.
- The message has
amino.name
andcosmos.msg.v1.signer
options set correctly.- The message definition follows the protocol buffer style guide.
The code changes are approved.
33-34
: LGTM!The
MsgAddAuthenticatorResponse
message definition looks good:
- The message has 1 field for indicating the success status of the operation.
- The message definition follows the protocol buffer style guide.
The code changes are approved.
38-44
: LGTM!The
MsgRemoveAuthenticator
message definition looks good:
- The message has 2 fields for specifying the sender and the ID of the authenticator to remove.
- The message has
amino.name
andcosmos.msg.v1.signer
options set correctly.- The message definition follows the protocol buffer style guide.
The code changes are approved.
46-48
: LGTM!The
MsgRemoveAuthenticatorResponse
message definition looks good:
- The message has 1 field for indicating the success status of the operation.
- The message definition follows the protocol buffer style guide.
The code changes are approved.
51-57
: LGTM!The
MsgSetActiveState
message definition looks good:
- The message has 2 fields for specifying the sender and the active state.
- The message has
amino.name
andcosmos.msg.v1.signer
options set correctly.- The message definition follows the protocol buffer style guide.
The code changes are approved.
59-60
: LGTM!The
MsgSetActiveStateResponse
message definition looks good:
- The message has no fields, which is acceptable for a response message that doesn't need to convey any information.
- The message definition follows the protocol buffer style guide.
The code changes are approved.
64-68
: LGTM!The
TxExtension
message definition looks good:
- The message has 1 repeated field for holding the IDs of the selected authenticators.
- The field type
uint64
is appropriate for representing authenticator IDs.- The message definition follows the protocol buffer style guide.
The code changes are approved.
indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/genesis.ts (6)
12-21
: LGTM!The
AuthenticatorData
interface is well-defined and serves the purpose of storing account authenticators data.
40-54
: LGTM!The modifications to the
GenesisState
interface are appropriate and enhance the state management of accounts by allowing the storage of multiple authenticators per account and tracking the next authenticator ID.
73-78
: LGTM!The
createBaseAuthenticatorData
function is correctly implemented and initializes theAuthenticatorData
object with default values.
81-91
: LGTM!The
AuthenticatorData.encode
function correctly encodes theaddress
andauthenticators
fields of theAuthenticatorData
message.
93-117
: LGTM!The
AuthenticatorData.decode
function correctly decodes theaddress
andauthenticators
fields of theAuthenticatorData
message.
119-124
: LGTM!The
AuthenticatorData.fromPartial
function correctly initializes theaddress
andauthenticators
fields of theAuthenticatorData
message from the partial object.indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.ts (1)
25-28
: LGTM!The code changes are approved.
indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/tx.ts (8)
1-2
: LGTM!The imports are necessary and look good.
5-16
: LGTM!The
MsgAddAuthenticator
interface and its SDK type are defined correctly.
19-28
: LGTM!The
MsgAddAuthenticatorResponse
interface and its SDK type are defined correctly.
34-46
: LGTM!The
MsgRemoveAuthenticator
interface and its SDK type are defined correctly.
52-70
: LGTM!The
MsgRemoveAuthenticatorResponse
interface and its SDK type are defined correctly.
73-82
: LGTM!The
MsgSetActiveState
interface and its SDK type are defined correctly.
94-112
: LGTM!The
TxExtension
interface and its SDK type are defined correctly.
114-468
: LGTM!The encoding, decoding, and utility functions for the defined interfaces are implemented correctly and follow the protocol buffer conventions.
syntax = "proto3"; | ||
package dydxprotocol.accountplus; | ||
|
||
import "cosmos/msg/v1/msg.proto"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the missing import cosmos/msg/v1/msg.proto
.
The static analysis tool buf
indicates that the import cosmos/msg/v1/msg.proto
does not exist, which will cause compilation errors.
Please check if the import path is correct. If the file exists in the repository, ensure that the path is specified relative to the root of the repository.
Do you want me to help find the correct import path or open a GitHub issue to track this problem?
Tools
buf
4-4: import "cosmos/msg/v1/msg.proto": file does not exist
(COMPILE)
export interface QueryParamsRequest {} | ||
/** QueryParamsRequest is request type for the Query/Params RPC method. */ | ||
|
||
export interface QueryParamsRequestSDKType {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a type alias instead of an empty interface.
An empty interface is equivalent to {}
and serves no purpose.
Use a type alias instead:
-export interface QueryParamsRequestSDKType {}
+export type QueryParamsRequestSDKType = Record<string, never>;
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
export interface QueryParamsRequestSDKType {} | |
export type QueryParamsRequestSDKType = Record<string, never>; |
Tools
Biome
[error] 10-10: An empty interface is equivalent to {}.
Safe fix: Use a type alias instead.
(lint/suspicious/noEmptyInterface)
import { DeepPartial, Long } from "../../helpers"; | ||
/** QueryParamsRequest is request type for the Query/Params RPC method. */ | ||
|
||
export interface QueryParamsRequest {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a type alias instead of an empty interface.
An empty interface is equivalent to {}
and serves no purpose.
Use a type alias instead:
-export interface QueryParamsRequest {}
+export type QueryParamsRequest = Record<string, never>;
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
export interface QueryParamsRequest {} | |
export type QueryParamsRequest = Record<string, never>; |
Tools
Biome
[error] 7-7: An empty interface is equivalent to {}.
Safe fix: Use a type alias instead.
(lint/suspicious/noEmptyInterface)
Changelist
[Describe or list the changes made in this PR]
Test Plan
[Describe how this PR was tested (if applicable)]
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.Summary by CodeRabbit
New Features
AuthenticatorData
message for enhanced account management.Enhancements