-
Notifications
You must be signed in to change notification settings - Fork 37
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
Apply updates from core #80
Conversation
Dependency ReviewThe following issues were found:
License Issuespackage-lock.json
package.json
Denied Licenses: GPL-1.0-or-later, LGPL-2.0-or-later OpenSSF Scorecard
Scanned Manifest Filespackage-lock.json
package.json
|
WalkthroughThe changes encompass updates to multiple files, primarily focusing on enhancements to API functionality, message handling, and parameter structures across various modules. Key modifications include the introduction of new methods and classes to facilitate interactions with Ethereum contracts, improvements to inter-blockchain communication (IBC) protocols, and adjustments to message serialization formats. Additionally, several parameters have been renamed or restructured to support new features and improve clarity. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant EvmAPI
participant IbcPermAPI
participant OpchildAPI
participant OphostAPI
User->>EvmAPI: Call erc20Factory()
EvmAPI->>User: Return ERC20 factory address
User->>IbcPermAPI: Call channelStates()
IbcPermAPI->>User: Return channel states
User->>OpchildAPI: Call nextL1Sequence()
OpchildAPI->>User: Return next L1 sequence number
User->>OphostAPI: Call withdrawalClaimed()
OphostAPI->>User: Return withdrawal claim status
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: 0
Outside diff range and nitpick comments (1)
src/core/ibc/applications/perm/msgs/MsgResumeChannel.ts (1)
6-101
: Add parameter validation and unit tests.The
MsgResumeChannel
class follows a consistent pattern for serialization and deserialization, and uses appropriate types and proto definitions. However, there are a few improvements that can be made:
- Add validation for the
authority
,channel_id
, andport_id
parameters in the constructor and deserialization methods (fromAmino
,fromData
,fromProto
).- Add a
validate
method to validate the parameters.- Add unit tests for the serialization and deserialization methods.
- Add unit tests for the packing and unpacking methods.
- Add unit tests for the validation of parameters.
Here are some suggestions for adding parameter validation and unit tests:
- Add validation for the parameters in the constructor and deserialization methods:
constructor( public authority: AccAddress, public channel_id: string, public port_id: string ) { super() this.validate() } public static fromAmino(data: MsgResumeChannel.Amino): MsgResumeChannel { const { value: { authority, channel_id, port_id }, } = data const msg = new MsgResumeChannel(authority, channel_id, port_id) msg.validate() return msg } public static fromData(data: MsgResumeChannel.Data): MsgResumeChannel { const { authority, channel_id, port_id } = data const msg = new MsgResumeChannel(authority, channel_id, port_id) msg.validate() return msg } public static fromProto(data: MsgResumeChannel.Proto): MsgResumeChannel { const msg = new MsgResumeChannel(data.authority, data.channelId, data.portId) msg.validate() return msg }
- Add a
validate
method to validate the parameters:public validate(): void { if (!this.authority) { throw new Error('authority is required') } if (!this.channel_id) { throw new Error('channel_id is required') } if (!this.port_id) { throw new Error('port_id is required') } }
- Add unit tests for the serialization and deserialization methods:
describe('MsgResumeChannel', () => { it('should serialize and deserialize to Amino', () => { const msg = new MsgResumeChannel( 'initia1z3t55m0l9h0eupuz3dp5t5cypyv674jj7mz2jw', 'channel-1', 'transfer' ) const amino = msg.toAmino() const msg2 = MsgResumeChannel.fromAmino(amino) expect(msg2).toEqual(msg) }) it('should serialize and deserialize to Data', () => { const msg = new MsgResumeChannel( 'initia1z3t55m0l9h0eupuz3dp5t5cypyv674jj7mz2jw', 'channel-1', 'transfer' ) const data = msg.toData() const msg2 = MsgResumeChannel.fromData(data) expect(msg2).toEqual(msg) }) it('should serialize and deserialize to Proto', () => { const msg = new MsgResumeChannel( 'initia1z3t55m0l9h0eupuz3dp5t5cypyv674jj7mz2jw', 'channel-1', 'transfer' ) const proto = msg.toProto() const msg2 = MsgResumeChannel.fromProto(proto) expect(msg2).toEqual(msg) }) })
- Add unit tests for the packing and unpacking methods:
describe('MsgResumeChannel', () => { it('should pack and unpack Any', () => { const msg = new MsgResumeChannel( 'initia1z3t55m0l9h0eupuz3dp5t5cypyv674jj7mz2jw', 'channel-1', 'transfer' ) const any = msg.packAny() const msg2 = MsgResumeChannel.unpackAny(any) expect(msg2).toEqual(msg) }) })
- Add unit tests for the validation of parameters:
describe('MsgResumeChannel', () => { it('should validate parameters', () => { expect( () => new MsgResumeChannel('', 'channel-1', 'transfer') ).toThrowError('authority is required') expect( () => new MsgResumeChannel('initia1z3t55m0l9h0eupuz3dp5t5cypyv674jj7mz2jw', '', 'transfer') ).toThrowError('channel_id is required') expect( () => new MsgResumeChannel('initia1z3t55m0l9h0eupuz3dp5t5cypyv674jj7mz2jw', 'channel-1', '') ).toThrowError('port_id is required') }) })
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
Files selected for processing (32)
- package.json (2 hunks)
- src/client/lcd/api/EvmAPI.ts (1 hunks)
- src/client/lcd/api/IbcPermAPI.ts (1 hunks)
- src/client/lcd/api/OpchildAPI.ts (1 hunks)
- src/client/lcd/api/OphostAPI.ts (2 hunks)
- src/core/Msg.ts (13 hunks)
- src/core/distribution/msgs/MsgDepositValidatorRewardsPool.ts (2 hunks)
- src/core/evm/EvmParams.ts (2 hunks)
- src/core/evm/msgs/MsgCall.ts (3 hunks)
- src/core/evm/msgs/MsgCreate.ts (2 hunks)
- src/core/evm/msgs/MsgCreate2.ts (1 hunks)
- src/core/evm/msgs/index.ts (1 hunks)
- src/core/gov/GovParams.ts (16 hunks)
- src/core/gov/Vesting.ts (1 hunks)
- src/core/ibc/applications/perm/msgs/MsgHaltChannel.ts (1 hunks)
- src/core/ibc/applications/perm/msgs/MsgResumeChannel.ts (1 hunks)
- src/core/ibc/applications/perm/msgs/MsgSetPermissionedRelayers.ts (5 hunks)
- src/core/ibc/applications/perm/msgs/index.ts (1 hunks)
- src/core/move/MoveParams.ts (10 hunks)
- src/core/opchild/OpchildParams.ts (14 hunks)
- src/core/opchild/msgs/MsgFinalizeTokenDeposit.ts (1 hunks)
- src/core/ophost/BatchInfo.ts (2 hunks)
- src/core/ophost/BatchInfoWithOutput.ts (1 hunks)
- src/core/ophost/BridgeConfig.ts (1 hunks)
- src/core/ophost/Output.ts (3 hunks)
- src/core/ophost/index.ts (1 hunks)
- src/core/ophost/msgs/MsgFinalizeTokenWithdrawal.ts (4 hunks)
- src/core/ophost/msgs/MsgProposeOutput.ts (5 hunks)
- src/core/ophost/msgs/MsgUpdateChallenger.ts (0 hunks)
- src/core/ophost/msgs/MsgUpdateChallengers.ts (1 hunks)
- src/core/ophost/msgs/MsgUpdateOracleConfig.ts (1 hunks)
- src/core/ophost/msgs/index.ts (6 hunks)
Files not reviewed due to no reviewable changes (1)
- src/core/ophost/msgs/MsgUpdateChallenger.ts
Files skipped from review due to trivial changes (4)
- package.json
- src/core/distribution/msgs/MsgDepositValidatorRewardsPool.ts
- src/core/ibc/applications/perm/msgs/MsgSetPermissionedRelayers.ts
- src/core/ophost/msgs/MsgFinalizeTokenWithdrawal.ts
Additional comments not posted (156)
src/core/ophost/index.ts (1)
6-6
: LGTM!The export statement for
BatchInfoWithOutput
is a straightforward addition that enhances the module's interface without modifying existing logic or control flow. This change is consistent with the PR objective of applying updates from core repositories and is unlikely to have any negative impact on the existing codebase.src/core/evm/msgs/index.ts (5)
7-7
: LGTM!The export statement for
MsgCreate2
is syntactically correct and consistent with the import statement.
11-11
: LGTM!The addition of
MsgCreate2
to theEvmMsg
union type is consistent with the import and export statements. It correctly expands the range of supported EVM message types.
14-18
: LGTM!The addition of
MsgCreate2.Amino
to theEvmMsg.Amino
union type is consistent with the updatedEvmMsg
type. It correctly includes the Amino encoding for the newMsgCreate2
message type.
19-28
: LGTM!The additions of
MsgCreate2.Data
andMsgCreate2.Proto
to theEvmMsg.Data
andEvmMsg.Proto
union types, respectively, are consistent with the updatedEvmMsg
type. They correctly include the data structure and Protocol Buffers encoding for the newMsgCreate2
message type.
2-2
: Verify the implementation ofMsgCreate2
.The import statement for
MsgCreate2
is syntactically correct. However, please ensure that the implementation ofMsgCreate2
in the./MsgCreate2
file is thoroughly tested and follows the expected behavior.Run the following script to verify the implementation of
MsgCreate2
:Verification successful
Implementation of
MsgCreate2
VerifiedThe
MsgCreate2
class is well-implemented with appropriate properties and methods for serialization and deserialization. It extendsJSONSerializable
and includes methods for handling Amino, Proto, and other formats, ensuring compatibility and functionality. No issues were found with the implementation.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation of `MsgCreate2`. # Test: Search for the implementation of `MsgCreate2`. Expect: A class or interface named `MsgCreate2` with appropriate properties and methods. fd MsgCreate2 --exec cat | rg --multiline $'(class|interface) MsgCreate2'Length of output: 124
Script:
#!/bin/bash # Description: Gather detailed information about the `MsgCreate2` class. # Search for the full implementation of the `MsgCreate2` class to understand its properties and methods. ast-grep --lang typescript --pattern $'class MsgCreate2 extends $_ { $$$ }'Length of output: 5181
src/core/ibc/applications/perm/msgs/index.ts (4)
2-3
: LGTM!The imports of
MsgHaltChannel
andMsgResumeChannel
are consistent with the AI-generated summary and are necessary for the subsequent changes in the file.
6-7
: LGTM!The exports of
MsgHaltChannel
andMsgResumeChannel
are consistent with the AI-generated summary and are necessary for the subsequent changes in the file and for the consumers of this module.
9-12
: LGTM!The update to the
IbcPermMsg
type to includeMsgHaltChannel
andMsgResumeChannel
is consistent with the AI-generated summary and is necessary for the subsequent changes in the file and for the consumers of this module.
14-25
: LGTM!The updates to the
Amino
,Data
, andProto
namespaces withinIbcPermMsg
to includeMsgHaltChannel
andMsgResumeChannel
are consistent with the AI-generated summary and are necessary for the serialization and deserialization of the new message types.src/client/lcd/api/IbcPermAPI.ts (6)
4-9
: LGTM!The renaming of the
PermissionedRelayers
interface toChannelState
and the addition of thehalt_state
property are appropriate changes that enhance the representation of channel state information.
11-14
: LGTM!The introduction of the
HaltState
interface is a valuable addition that provides a structured representation of the halted state of a channel. Thehalted
andhalted_by
properties capture the necessary information to determine the channel's operational status and the entity responsible for halting it.
17-25
: LGTM!The renaming of the
relayers
method tochannelStates
accurately reflects its updated functionality of retrieving channel state information. The changes to the endpoint and return type are consistent with the new data structure and provide the necessary information in the expected format.
28-36
: LGTM!The renaming of the
relayersByChannel
method tochannelState
accurately reflects its updated functionality of retrieving a specific channel state. The changes to the method parameters, endpoint, and return type are consistent with the new data structure and provide the necessary information in the expected format.
22-24
: LGTM!The updated property names in the response object,
channel_states
andpagination
, are consistent with the new data structure and naming conventions. Thechannel_states
property correctly holds an array ofChannelState
objects, and thepagination
property provides the necessary pagination information.
34-35
: LGTM!The updated property name in the response object,
channel_state
, is consistent with the new data structure and naming conventions. Thechannel_state
property correctly holds a singleChannelState
object.src/core/ophost/BatchInfo.ts (10)
2-7
: LGTM!The new imports are necessary to support the changes made to the
BatchInfo
class. They are correctly named and sourced from the appropriate locations.
17-21
: LGTM!The constructor parameter changes improve type safety and clarity:
- Using
AccAddress
type forsubmitter
ensures that only valid account addresses can be used.- Renaming
chain
tochain_type
and using theChainType
enum provides clarity and type safety for the chain type.
27-28
: LGTM!The
fromAmino
method is correctly updated to use the newchain_type
parameter andchainTypeFromJSON
function for deserialization, ensuring proper handling of thechain_type
field.
32-33
: LGTM!The
toAmino
method is correctly updated to use the newchain_type
parameter andchainTypeToJSON
function for serialization, ensuring proper handling of thechain_type
field.
37-38
: LGTM!The
fromData
method is correctly updated to use the newchain_type
parameter andchainTypeFromJSON
function for deserialization, ensuring proper handling of thechain_type
field.
42-43
: LGTM!The
toData
method is correctly updated to use the newchain_type
parameter andchainTypeToJSON
function for serialization, ensuring proper handling of thechain_type
field.
47-47
: LGTM!The
fromProto
method is correctly updated to use the newchainType
field from the proto message, ensuring proper handling of thechain_type
field.
51-54
: LGTM!The
toProto
method is correctly updated to use the newchain_type
parameter when creating the proto message, ensuring proper handling of thechain_type
field.
61-62
: LGTM!The
Amino
interface is correctly updated to useAccAddress
type forsubmitter
andstring
type forchain_type
, aligning with the changes made to the constructor parameters and ensuring type safety.
66-67
: LGTM!The
Data
interface is correctly updated to useAccAddress
type forsubmitter
andstring
type forchain_type
, aligning with the changes made to the constructor parameters and ensuring type safety.src/client/lcd/api/EvmAPI.ts (1)
38-44
: LGTM!The new
erc20Factory
method is a great addition to theEvmAPI
class. It follows the existing coding style and conventions, and its purpose is clearly conveyed through the method name. The implementation is correct, and the optionalparams
parameter provides flexibility for passing additional query parameters if needed.This method enhances the functionality of the
EvmAPI
class by enabling interaction with the ERC20 factory contract, expanding its capabilities in managing Ethereum-based tokens.src/client/lcd/api/OpchildAPI.ts (3)
41-47
: LGTM!The
nextL1Sequence
method is implemented correctly. It fetches the next Layer 1 sequence number from the appropriate API endpoint, expects the response to have anext_l1_sequence
property of type string, and correctly parses the string value to an integer usingparseInt
. The method signature and return type are accurately defined.
49-55
: LGTM!The
nextL2Sequence
method is implemented correctly. It fetches the next Layer 2 sequence number from the appropriate API endpoint, expects the response to have anext_l2_sequence
property of type string, and correctly parses the string value to an integer usingparseInt
. The method signature and return type are accurately defined.
57-66
: LGTM!The
baseDenom
method is implemented correctly. It fetches the base denomination for a given token from the appropriate API endpoint, expects the response to have abase_denom
property of type string, and returns the value as a string. The method signature and return type are accurately defined.src/core/evm/msgs/MsgCreate.ts (12)
14-14
: LGTM!The JSDoc comment accurately describes the purpose of the new
value
parameter.
18-19
: LGTM!The new
value
parameter is correctly added to the constructor.
26-26
: LGTM!The destructuring assignment correctly extracts the
value
property from thedata
object.
29-29
: LGTM!The
value
variable is correctly passed to theMsgCreate
constructor.
33-33
: LGTM!The destructuring assignment correctly extracts the
value
property fromthis
.
39-39
: LGTM!The
value
property is correctly added to the returned object.
45-46
: LGTM!The destructuring assignment correctly extracts the
value
property from thedata
object and passes it to theMsgCreate
constructor.
50-55
: LGTM!The destructuring assignment correctly extracts the
value
property fromthis
and adds it to the returned object.
60-60
: LGTM!The
data.value
property is correctly passed to theMsgCreate
constructor.
64-68
: LGTM!The destructuring assignment correctly extracts the
value
property fromthis
and adds it to the object passed toMsgCreate_pb.fromPartial
.
90-90
: LGTM!The
value
property is correctly added to theAmino
interface.
98-98
: LGTM!The
value
property is correctly added to theData
interface.src/core/gov/Vesting.ts (2)
5-66
: LGTM!The
Vesting
class is well-structured and follows a consistent pattern for serialization and deserialization. The class properties are clearly defined and match the constructor parameters. The use of TypeScript features like public constructor parameters and type annotations enhances the code readability and maintainability.
68-82
: LGTM!The
Vesting
namespace provides a clear separation of the serialization formats. The interfaces are correctly defined and match the properties of theVesting
class, ensuring consistency and type safety.src/core/ophost/BatchInfoWithOutput.ts (5)
1-5
: LGTM!The imports are correctly defined and no issues are found.
6-20
: LGTM!The class definition and constructor are correctly implemented.
22-71
: LGTM!The methods to convert to and from Amino, Data, and Proto formats are correctly implemented.
74-86
: LGTM!The namespace and interfaces for Amino, Data, and Proto formats are correctly defined.
1-86
: Overall, the code in this file looks great!
- The file follows a consistent structure and naming convention.
- The code is well-documented with JSDoc comments.
- The code follows best practices and is easy to understand.
Great job!
src/core/evm/msgs/MsgCall.ts (5)
15-21
: LGTM!The addition of the
value
parameter to theMsgCall
constructor is a valuable enhancement. It allows specifying the amount of tokens to transfer during the contract call, enabling more flexible interactions with the contracts.The code changes are consistent with the provided documentation, clearly explaining the purpose of the new parameter.
28-31
: Looks good!The updates to the
fromAmino
method correctly handle the newvalue
field. By destructuring thevalue
field from thedata
object and passing it to theMsgCall
constructor, the method ensures proper deserialization of Amino-encodedMsgCall
objects.These changes maintain consistency with the modifications made to the constructor.
35-42
: Looks good!The updates to the
toAmino
method correctly include the newvalue
field. By destructuring thevalue
field from the current instance and including it in the returned Amino-encoded object, the method ensures proper serialization ofMsgCall
objects to Amino format.These changes maintain consistency with the modifications made to the constructor.
48-49
: Looks good!The updates to the
fromData
method correctly handle the newvalue
field. By destructuring thevalue
field from thedata
object and passing it to theMsgCall
constructor, the method ensures proper deserialization of JSON-serializedMsgCall
objects.These changes maintain consistency with the modifications made to the constructor.
53-59
: Looks good!The updates to the
toData
method correctly include the newvalue
field. By destructuring thevalue
field from the current instance and including it in the returned JSON-serialized object, the method ensures proper serialization ofMsgCall
objects to JSON format.These changes maintain consistency with the modifications made to the constructor.
src/core/ophost/msgs/index.ts (5)
8-8
: LGTM!The import statement has been correctly renamed to
MsgUpdateChallengers
, which aligns with the AI-generated summary indicating support for multiple challengers. This change is consistent and enhances the functionality.
10-10
: LGTM!The new import statement for
MsgUpdateOracleConfig
has been correctly added, which aligns with the AI-generated summary indicating the introduction of new configuration options for oracles. This change enhances the system's capabilities.
21-21
: LGTM!The export statements for
MsgUpdateChallengers
andMsgUpdateOracleConfig
have been correctly added, which is consistent with the new import statements. These changes correctly expose the new message types for usage in other parts of the codebase.Also applies to: 23-23
35-35
: LGTM!The
OphostMsg
type and its associated type unions (Amino
,Data
,Proto
) have been correctly updated to includeMsgUpdateChallengers
andMsgUpdateOracleConfig
. These changes are consistent with the new import and export statements, ensuring that the new message types are properly recognized throughout the messaging system.Also applies to: 37-37, 50-50, 52-52, 64-64, 66-66, 78-78, 80-80
Line range hint
1-84
: Overall, the changes in this file look great!The modifications to support multiple challengers and introduce new configuration options for oracles are consistently applied across import statements, export statements, and type definitions. The changes enhance the functionality and capabilities of the Ophost messaging system, and the AI-generated summary accurately captures the essence of the updates.
No issues, inconsistencies, or areas for improvement are identified. The changes are well-structured and align with the project's objectives.
src/core/ibc/applications/perm/msgs/MsgHaltChannel.ts (7)
1-10
: LGTM!The imports and class definition are correctly specified and follow the expected patterns for the
@initia/initia.js
package.
11-29
: LGTM!The constructor and the
fromAmino
static method are correctly implemented and follow the expected patterns for the@initia/initia.js
package.
31-41
: LGTM!The
toAmino
method is correctly implemented and follows the expected pattern for the@initia/initia.js
package.
43-56
: LGTM!The
fromData
static method and thetoData
method are correctly implemented and follow the expected patterns for the@initia/initia.js
package.
58-69
: LGTM!The
fromProto
static method and thetoProto
method are correctly implemented and follow the expected patterns for the@initia/initia.js
package. The methods correctly handle the conversion between theMsgHaltChannel
class and its protocol buffer representation.
71-80
: LGTM!The
packAny
method and theunpackAny
static method are correctly implemented and follow the expected patterns for the@initia/initia.js
package. The methods correctly handle the conversion between theMsgHaltChannel
class and its packedAny
representation.
83-101
: LGTM!The interface definitions for
Amino
,Data
, andProto
are correctly specified and match the expected structures for the different encodings of theMsgHaltChannel
message.src/core/ophost/Output.ts (14)
12-12
: LGTM!The JSDoc comment accurately describes the new
l1_block_number
parameter.
18-18
: LGTM!The new
l1_block_number
property is correctly typed and aligns with the changes made to the constructor.
26-27
: LGTM!The destructuring of the new
l1_block_number
property in thefromAmino
method is correctly implemented and aligns with the changes made to theAmino
interface.
30-30
: LGTM!The parsing and passing of the
l1_block_number
property in thefromAmino
method are correctly implemented.
37-38
: LGTM!The destructuring of the new
l1_block_number
property in thetoAmino
method is correctly implemented and aligns with the changes made to theOutput
class.
41-41
: LGTM!The inclusion and conversion of the
l1_block_number
property in the returnedAmino
object are correctly implemented and align with theAmino
interface.
48-49
: LGTM!The destructuring of the new
l1_block_number
property in thefromData
method is correctly implemented and aligns with the changes made to theData
interface.
52-52
: LGTM!The parsing and passing of the
l1_block_number
property in thefromData
method are correctly implemented.
59-60
: LGTM!The destructuring of the new
l1_block_number
property in thetoData
method is correctly implemented and aligns with the changes made to theOutput
class.
63-63
: LGTM!The inclusion and conversion of the
l1_block_number
property in the returnedData
object are correctly implemented and align with theData
interface.
72-73
: LGTM!The passing and conversion of the
l1BlockNumber
property in thefromProto
method are correctly implemented and align with theProto
type.
79-80
: LGTM!The destructuring, inclusion, and conversion of the
l1_block_number
property in thetoProto
method are correctly implemented and align with theProto
type.Also applies to: 83-83
93-93
: LGTM!The addition of the
l1_block_number
property to theAmino
interface is correctly implemented and aligns with the changes made to thefromAmino
andtoAmino
methods.
100-100
: LGTM!The addition of the
l1_block_number
property to theData
interface is correctly implemented and aligns with the changes made to thefromData
andtoData
methods.src/core/ibc/applications/perm/msgs/MsgResumeChannel.ts (1)
1-5
: LGTM!The imports are correctly specified, sorted, grouped, and aliased.
src/core/evm/msgs/MsgCreate2.ts (8)
7-93
: LGTM!The
MsgCreate2
class is correctly implemented with appropriate serialization and deserialization methods for Amino, Data, and Proto formats. The constructor parameters are correctly typed and documented.
27-33
: LGTM!The
fromAmino
method is correctly implemented and handles the conversion ofsalt
from string to number usingNumber.parseInt
.
35-46
: LGTM!The
toAmino
method is correctly implemented and handles the conversion ofsalt
from number to string usingtoString
.
48-51
: LGTM!The
fromData
method is correctly implemented and handles the conversion ofsalt
from string to number usingNumber.parseInt
.
53-62
: LGTM!The
toData
method is correctly implemented and handles the conversion ofsalt
from number to string usingtoString
.
64-71
: LGTM!The
fromProto
method is correctly implemented and handles the conversion ofsalt
fromLong
to number usingtoNumber
.
73-81
: LGTM!The
toProto
method is correctly implemented and handles the conversion ofsalt
from number toLong
usingLong.fromNumber
.
83-92
: LGTM!The
packAny
andunpackAny
methods are correctly implemented and handle the packing and unpacking ofMsgCreate2
instances to/fromAny
objects.src/core/ophost/msgs/MsgUpdateOracleConfig.ts (2)
7-103
: LGTM!The
MsgUpdateOracleConfig
class is correctly implemented:
- It extends
JSONSerializable
and implements the required methods for serialization and deserialization to/from Amino, Data, and Proto formats.- The constructor parameters are correctly typed and match the fields in the Amino, Data, and Proto interfaces.
- The serialization and deserialization methods are correctly implemented and handle the type conversions appropriately.
105-123
: LGTM!The
MsgUpdateOracleConfig
namespace is correctly defined:
- It defines interfaces for Amino, Data, and Proto formats.
- The interfaces correctly match the fields in the
MsgUpdateOracleConfig
class.src/core/ophost/msgs/MsgUpdateChallengers.ts (7)
17-23
: LGTM!The constructor is correctly assigning the parameters to the class properties and calling the
super()
method.
25-37
: LGTM!The
fromAmino
method is correctly extracting the values from theAmino
object and returning a new instance ofMsgUpdateChallengers
.
39-49
: LGTM!The
toAmino
method is correctly returning anAmino
object with the class properties.
51-60
: LGTM!The
fromData
method is correctly extracting the values from theData
object and returning a new instance ofMsgUpdateChallengers
.
62-70
: LGTM!The
toData
method is correctly returning aData
object with the class properties.
72-89
: LGTM!The
fromProto
andtoProto
methods are correctly converting betweenProto
andMsgUpdateChallengers
instances. Thebridge_id
is also correctly converted betweenLong
and number.
91-102
: LGTM!The
packAny
andunpackAny
methods are correctly packing and unpacking theMsgUpdateChallengers
instance as anAny
proto. ThetypeUrl
is correctly set to the fully qualified name of the message type, and thevalue
is correctly encoded and decoded using theMsgUpdateChallengers_pb
methods.src/core/move/MoveParams.ts (6)
19-19
: LGTM!The constructor has been correctly updated to include the new
script_enabled
parameter.
31-31
: LGTM!The
fromAmino
method has been correctly updated to handle the deserialization of the newscript_enabled
property from the Amino format.Also applies to: 39-39
49-49
: LGTM!The
toAmino
method has been correctly updated to include thescript_enabled
property in the serialized Amino object.Also applies to: 58-58
69-69
: LGTM!The
fromData
method has been correctly updated to handle the deserialization of the newscript_enabled
property from the Data format.Also applies to: 76-76
86-86
: LGTM!The
toData
method has been correctly updated to include thescript_enabled
property in the serialized Data object.Also applies to: 94-94
104-104
: LGTM!The
fromProto
andtoProto
methods have been correctly updated to handle the serialization and deserialization of the newscript_enabled
property to and from the Proto format.The
Amino
andData
interfaces have been correctly updated to include the newscript_enabled
property, ensuring that the structure of the serialized objects is consistent with the class definition.Also applies to: 114-114, 121-121, 134-134, 144-144
src/core/evm/EvmParams.ts (9)
12-21
: LGTM!The addition of the new constructor parameters
allow_custom_erc20
,allowed_custom_erc20s
, andfee_denom
enhances the flexibility of theEvmParams
class. The parameter names are descriptive, and the JSDoc comments provide clear explanations of their purpose.
27-40
: LGTM!The updates to the
fromAmino
method correctly handle the deserialization of the new parametersallow_custom_erc20
,allowed_custom_erc20s
, andfee_denom
from the Amino format. The destructuring assignment and theEvmParams
constructor call are updated consistently to include the new parameters.
44-56
: LGTM!The updates to the
toAmino
method correctly handle the serialization of the new parametersallow_custom_erc20
,allowed_custom_erc20s
, andfee_denom
to the Amino format. The destructuring assignment and the returned object are updated consistently to include the new parameters.
61-74
: LGTM!The updates to the
fromData
method correctly handle the deserialization of the new parametersallow_custom_erc20
,allowed_custom_erc20s
, andfee_denom
from the Data format. The destructuring assignment and theEvmParams
constructor call are updated consistently to include the new parameters.
78-90
: LGTM!The updates to the
toData
method correctly handle the serialization of the new parametersallow_custom_erc20
,allowed_custom_erc20s
, andfee_denom
to the Data format. The destructuring assignment and the returned object are updated consistently to include the new parameters.
97-100
: LGTM!The updates to the
fromProto
method correctly handle the deserialization of the new parametersallowCustomErc20
,allowedCustomErc20s
, andfeeDenom
from the Proto format. TheEvmParams
constructor call is updated to pass the new parameters from the proto object.
105-117
: LGTM!The updates to the
toProto
method correctly handle the serialization of the new parametersallow_custom_erc20
,allowed_custom_erc20s
, andfee_denom
to the Proto format. The destructuring assignment and theParams_pb.fromPartial
call are updated consistently to include the new parameters.
126-128
: LGTM!The updates to the
Amino
interface correctly include the new propertiesallow_custom_erc20
,allowed_custom_erc20s
, andfee_denom
, matching the new parameters added to theEvmParams
class.
134-136
: LGTM!The updates to the
Data
interface correctly include the new propertiesallow_custom_erc20
,allowed_custom_erc20s
, andfee_denom
, matching the new parameters added to theEvmParams
class.src/core/ophost/msgs/MsgProposeOutput.ts (10)
15-15
: LGTM!The JSDoc comment has been updated to include the new
output_index
parameter, which is consistent with the changes made to the constructor.
22-22
: LGTM!The new
output_index
parameter has been added to the constructor, and it is used consistently throughout the class in various methods such asfromAmino
,toAmino
,fromData
,toData
, andtoProto
.
31-37
: LGTM!The
fromAmino
method has been updated to include theoutput_index
parameter, and it is correctly parsed as an integer usingNumber.parseInt
. These changes are consistent with the addition ofoutput_index
to the constructor.Also applies to: 42-42
49-50
: LGTM!The
toAmino
method has been updated to include theoutput_index
parameter, and it is correctly converted to a string using thetoString
method. These changes are consistent with the addition ofoutput_index
to the constructor and ensure proper serialization in the Amino format.Also applies to: 56-56
64-65
: LGTM!The
fromData
method has been updated to include theoutput_index
parameter, and it is correctly parsed as an integer usingNumber.parseInt
. These changes are consistent with the addition ofoutput_index
to the constructor.Also applies to: 69-69
76-77
: LGTM!The
toData
method has been updated to include theoutput_index
parameter, and it is correctly converted to a string using thetoString
method. These changes are consistent with the addition ofoutput_index
to the constructor and ensure proper serialization in the Data format.Also applies to: 82-82
92-92
: LGTM!The
fromProto
method has been updated to include theoutputIndex
parameter, and it is correctly converted from aLong
type to a number using thetoNumber
method. This change is consistent with the addition ofoutput_index
to the constructor and ensures proper deserialization from the Proto format.
99-100
: LGTM!The
toProto
method has been updated to include theoutput_index
parameter, and it is correctly converted to aLong
type using theLong.fromNumber
method. These changes are consistent with the addition ofoutput_index
to the constructor and ensure proper serialization in the Proto format.Also applies to: 104-104
128-128
: LGTM!The
Amino
interface has been updated to include theoutput_index
property of typestring
, which is consistent with the addition ofoutput_index
to the constructor and its usage in thetoAmino
method. This change ensures type safety and matches the serialization format.
138-138
: LGTM!The
Data
interface has been updated to include theoutput_index
property of typestring
, which is consistent with the addition ofoutput_index
to the constructor and its usage in thetoData
method. This change ensures type safety and matches the serialization format.src/core/opchild/OpchildParams.ts (6)
17-17
: LGTM!The documentation comment accurately reflects the change from a single bridge executor to an array of bridge executors.
25-25
: LGTM!The constructor parameter change from
bridge_executor
tobridge_executors
is consistent with the overall modifications to support multiple bridge executors.
39-39
: LGTM!The
bridge_executor
parameter has been consistently renamed tobridge_executors
in all the serialization and deserialization methods.Also applies to: 49-49, 60-60, 71-71, 83-83, 92-92, 103-103, 113-113
124-124
: LGTM!The
bridge_executor
parameter has been consistently renamed tobridge_executors
in thefromProto
andtoProto
methods that convert between theOpchildParams
object and the protobuf representation.Also applies to: 135-135, 144-144
158-158
: LGTM!The
bridge_executor
field has been consistently renamed tobridge_executors
in theAmino
interface that represents the amino encoding of theOpchildParams
object.
169-169
: LGTM!The
bridge_executor
field has been consistently renamed tobridge_executors
in theData
interface that represents the JSON encoding of theOpchildParams
object.src/core/opchild/msgs/MsgFinalizeTokenDeposit.ts (2)
Line range hint
21-31
: LGTM!The addition of the
base_denom
parameter to the constructor is a valid change. It provides more information about the token being deposited, which can be useful for handling multiple token types or currencies. The parameter is correctly typed and the JSDoc comment has been updated to include its description.
Line range hint
39-134
: LGTM!The methods
fromAmino
,toAmino
,fromData
,toData
,fromProto
, andtoProto
have been updated to handle the newbase_denom
parameter correctly. The parameter is passed to the constructor when creating a new instance ofMsgFinalizeTokenDeposit
in thefrom*
methods, and thebase_denom
field is included in the returned objects in theto*
methods. The changes are consistent and do not introduce any type mismatches or inconsistencies.Additionally, the
Amino
andData
interfaces in theMsgFinalizeTokenDeposit
namespace have been updated to include thebase_denom
field, which is in line with the changes made to the class.src/client/lcd/api/OphostAPI.ts (3)
143-156
: LGTM!The
withdrawalClaimed
method is implemented correctly. It follows the expected logic, has a clear naming convention, and properly handles the request and response.
158-167
: LGTM!The
nextL1Sequence
method is implemented correctly. It follows the expected logic, has a clear naming convention, and properly handles the request and response.
169-182
: LGTM!The
batchInfos
method is implemented correctly. It follows the expected logic, has a clear naming convention, and properly handles the request and response. The method appropriately utilizes theBatchInfoWithOutput.fromData
method to convert the raw data into instances of theBatchInfoWithOutput
class.src/core/ophost/BridgeConfig.ts (10)
6-6
: LGTM!The import statement for the
Long
library is correct and necessary for using theLong
type in the code.
14-20
: LGTM!The JSDoc comments have been updated to accurately reflect the changes made to the constructor parameters:
challengers
is now an array of addresses.submission_start_time
is renamed tosubmission_start_height
.- A new parameter
oracle_enabled
is added.
24-30
: LGTM!The constructor parameters have been updated to match the changes in the JSDoc comments:
challenger
is replaced withchallengers
, which is an array of addresses.submission_start_time
is renamed tosubmission_start_height
.- A new parameter
oracle_enabled
is added.
38-55
: LGTM!The
fromAmino
method has been updated to match the changes in the constructor parameters:
challenger
is replaced withchallengers
.submission_start_time
is renamed tosubmission_start_height
.- A new property
oracle_enabled
is added.
62-79
: LGTM!The
toAmino
method has been updated to match the changes in the constructor parameters:
challenger
is replaced withchallengers
.submission_start_time
is renamed tosubmission_start_height
.- A new property
oracle_enabled
is added.
86-103
: LGTM!The
fromData
method has been updated to match the changes in the constructor parameters:
challenger
is replaced withchallengers
.submission_start_time
is renamed tosubmission_start_height
.- A new property
oracle_enabled
is added.
110-127
: LGTM!The
toData
method has been updated to match the changes in the constructor parameters:
challenger
is replaced withchallengers
.submission_start_time
is renamed tosubmission_start_height
.- A new property
oracle_enabled
is added.
134-140
: LGTM!The
fromProto
method has been updated to match the changes in the constructor parameters:
challenger
is replaced withchallengers
.submission_start_time
is renamed tosubmission_start_height
.- A new property
oracle_enabled
is added.
147-164
: LGTM!The
toProto
method has been updated to match the changes in the constructor parameters:
challenger
is replaced withchallengers
.submission_start_time
is renamed tosubmission_start_height
.- A new property
oracle_enabled
is added.
172-189
: LGTM!The
Amino
andData
interfaces have been updated to match the changes in the constructor parameters:
challenger
is replaced withchallengers
.submission_start_time
is renamed tosubmission_start_height
.- A new property
oracle_enabled
is added.src/core/gov/GovParams.ts (6)
5-5
: LGTM!The import statement is necessary to use the
Vesting
type in theGovParams
class.
37-37
: LGTM!The new optional
vesting
parameter is properly typed and documented. It is used to hold information about the vesting contract related to the tally process in governance proposals.
58-59
: LGTM!
- The new
low_threshold_functions
parameter is properly typed and documented. It is used to specify the low threshold functions for emergency and expedited proposals.- The new optional
vesting
property is properly typed and matches the new optional constructor parameter.
88-88
: LGTM!The changes to the
fromAmino
method ensure that thevesting
information is properly deserialized from Amino format, maintaining compatibility with existing functionality while extending the class's capabilities to handle vesting-related data.Also applies to: 110-111
136-136
: LGTM!The changes to the
toAmino
method ensure that thevesting
information is properly serialized to Amino format, maintaining compatibility with existing functionality while extending the class's capabilities to handle vesting-related data.Also applies to: 159-159
184-184
: LGTM!The changes to the
fromData
,toData
,fromProto
, andtoProto
methods, as well as theAmino
andData
interfaces in theGovParams
namespace, ensure that thevesting
information is properly serialized and deserialized to and from Data and Proto formats, maintaining compatibility with existing functionality while extending the class's capabilities to handle vesting-related data.Also applies to: 206-207, 232-232, 255-255, 279-280, 305-305, 328-328, 354-354, 377-377
src/core/Msg.ts (6)
31-37
: LGTM!The imports are correctly added.
86-91
: LGTM!The imports are correctly added.
426-428
: LGTM!The case statement is correctly added to handle
MsgDepositValidatorRewardsPool
in thefromAmino
method.
436-437
: LGTM!The case statement is correctly added to handle
MsgCreate2
in thefromAmino
method.
520-523
: LGTM!The case statements are correctly added to handle
MsgHaltChannel
andMsgResumeChannel
in thefromAmino
method.
624-629
: Verify the usage ofMsgUpdateChallengers
andMsgUpdateOracleConfig
.The changes look good:
- The case statement for
MsgUpdateChallenger
is correctly renamed toMsgUpdateChallengers
.- The new case statement for
MsgUpdateOracleConfig
is correctly added.Run the following script to verify the usage of
MsgUpdateChallengers
andMsgUpdateOracleConfig
:Verification successful
Verification Successful: Usage of
MsgUpdateChallengers
andMsgUpdateOracleConfig
ConfirmedThe usage of
MsgUpdateChallengers
andMsgUpdateOracleConfig
is correctly implemented throughout the codebase. The oldMsgUpdateChallenger
is no longer present, confirming the successful transition.
MsgUpdateChallengers
is used in multiple locations, includingsrc/core/Msg.ts
andsrc/core/ophost/msgs/index.ts
.MsgUpdateOracleConfig
is also used in several places, such assrc/core/Msg.ts
andsrc/core/ophost/msgs/index.ts
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: # - Verify the usage of `MsgUpdateChallengers` and `MsgUpdateOracleConfig`. # - Expect: The messages are used correctly and the old `MsgUpdateChallenger` is not used anymore. # Test: Search for the usage of `MsgUpdateChallengers`. Expect: Should find occurrences. echo "Verifying usage of MsgUpdateChallengers:" rg --type typescript -A 5 $'MsgUpdateChallengers' # Test: Search for the usage of `MsgUpdateOracleConfig`. Expect: Should find occurrences. echo "Verifying usage of MsgUpdateOracleConfig:" rg --type typescript -A 5 $'MsgUpdateOracleConfig' # Test: Search for the usage of the old `MsgUpdateChallenger`. Expect: Should not find occurrences. echo "Verifying the old MsgUpdateChallenger is not used anymore:" rg --type typescript -A 5 $'MsgUpdateChallenger'Length of output: 562
Script:
#!/bin/bash # Description: # - Verify the usage of `MsgUpdateChallengers` and `MsgUpdateOracleConfig`. # - Expect: The messages are used correctly and the old `MsgUpdateChallenger` is not used anymore. # Test: Search for the usage of `MsgUpdateChallengers`. Expect: Should find occurrences. echo "Verifying usage of MsgUpdateChallengers:" rg --glob '*.ts' -A 5 $'MsgUpdateChallengers' # Test: Search for the usage of `MsgUpdateOracleConfig`. Expect: Should find occurrences. echo "Verifying usage of MsgUpdateOracleConfig:" rg --glob '*.ts' -A 5 $'MsgUpdateOracleConfig' # Test: Search for the usage of the old `MsgUpdateChallenger`. Expect: Should not find occurrences. echo "Verifying the old MsgUpdateChallenger is not used anymore:" rg --glob '*.ts' -A 5 $'MsgUpdateChallenger'Length of output: 32693
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.
LGTM
Summary by CodeRabbit
New Features
MsgHaltChannel
,MsgResumeChannel
, andMsgUpdateChallengers
.EvmParams
to include custom ERC20 token management and transaction fee specifications.MsgUpdateOracleConfig
.Bug Fixes
Documentation