feat: support initia 1.4.x with updated proto types and test fixes#159
feat: support initia 1.4.x with updated proto types and test fixes#159
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThis PR removes the auction subsystem (models, messages, REST surface, and tests), replaces Move whitelist/delist with four staking/gas-price message types and updates message unions/dispatch, and adjusts package/test tooling and dependency versions. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found. |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
src/core/move/msgs/MsgDelistGasPrice.ts (1)
73-80: Minor: Incomplete destructuring intoProto().Line 74 destructures
{ authority, metadata_lp }but then accessesthis.metadata_quotedirectly on line 78. For consistency, either destructure all three fields or access all viathis.♻️ Suggested fix
public toProto(): MsgDelistGasPrice.Proto { - const { authority, metadata_lp } = this + const { authority, metadata_quote, metadata_lp } = this return MsgDelistGasPrice_pb.fromPartial({ authority, - metadataQuote: this.metadata_quote, + metadataQuote: metadata_quote, metadataLp: metadata_lp, }) }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/core/move/msgs/MsgDelistGasPrice.ts` around lines 73 - 80, In MsgDelistGasPrice.toProto(), the destructuring only pulls { authority, metadata_lp } but the code then uses this.metadata_quote directly; make the access consistent by including metadata_quote in the destructuring (e.g., const { authority, metadata_lp, metadata_quote } = this) and then use metadata_quote in the MsgDelistGasPrice_pb.fromPartial call (or alternatively stop destructuring and reference all three as this.authority/this.metadata_lp/this.metadata_quote); update the toProto method accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/client/rest/api/GovAPI.spec.ts`:
- Around line 26-29: The test dereferences proposals[0].id without guarding for
an empty response from api.proposals; update the GovAPI.spec.ts test to assert
the proposals array is non-empty (e.g.,
expect(proposals.length).toBeGreaterThan(0)) or early-skip when proposals.length
=== 0 before computing proposalId, so the call to proposals({
'pagination.limit': '10', 'pagination.reverse': 'true' }) and subsequent access
of proposals[0].id is protected against empty live REST results.
In `@src/core/move/msgs/MsgWhitelistGasPrice.ts`:
- Around line 7-8: Update the JSDoc for MsgWhitelistGasPrice to accurately
describe its purpose instead of saying "registers a DEX pair in the staking
whitelist"; locate the comment block above the MsgWhitelistGasPrice declaration
and replace the incorrect description with one that mentions whitelisting gas
price (e.g., registering or whitelisting a gas price entry) and any expected
behavior or fields so the doc matches the MsgWhitelistGasPrice type and intent.
- Around line 28-36: fromAmino in MsgWhitelistGasPrice is passing constructor
args in the wrong order (it currently calls new MsgWhitelistGasPrice(authority,
metadata_lp, metadata_quote)) but the class constructor expects (authority,
metadata_quote, metadata_lp); change the call in MsgWhitelistGasPrice.fromAmino
to new MsgWhitelistGasPrice(authority, metadata_quote, metadata_lp) so the
metadata fields map correctly when deserializing from Amino.
- Around line 51-57: The fromData static method on MsgWhitelistGasPrice is
calling the constructor with swapped metadata arguments; update
MsgWhitelistGasPrice.fromData so it constructs the instance with (authority,
metadata_quote, metadata_lp) instead of (authority, metadata_lp,
metadata_quote), matching the constructor parameter order and the existing fix
in fromAmino(); ensure the returned new MsgWhitelistGasPrice(...) uses
metadata_quote as the second argument and metadata_lp as the third.
---
Nitpick comments:
In `@src/core/move/msgs/MsgDelistGasPrice.ts`:
- Around line 73-80: In MsgDelistGasPrice.toProto(), the destructuring only
pulls { authority, metadata_lp } but the code then uses this.metadata_quote
directly; make the access consistent by including metadata_quote in the
destructuring (e.g., const { authority, metadata_lp, metadata_quote } = this)
and then use metadata_quote in the MsgDelistGasPrice_pb.fromPartial call (or
alternatively stop destructuring and reference all three as
this.authority/this.metadata_lp/this.metadata_quote); update the toProto method
accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 34e002f1-91fd-4a48-b1b5-21f7406cd6c5
⛔ Files ignored due to path filters (2)
ledger-key/package-lock.jsonis excluded by!**/package-lock.jsonpackage-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (20)
package.jsonsrc/client/rest/RESTClient.tssrc/client/rest/api/AuctionAPI.spec.tssrc/client/rest/api/AuctionAPI.tssrc/client/rest/api/GovAPI.spec.tssrc/client/rest/api/index.tssrc/core/Msg.tssrc/core/auction/AuctionParams.tssrc/core/auction/index.tssrc/core/auction/msgs/MsgAuctionBid.tssrc/core/auction/msgs/MsgUpdateAuctionParams.tssrc/core/auction/msgs/index.tssrc/core/index.tssrc/core/move/msgs/MsgDelist.tssrc/core/move/msgs/MsgDelistGasPrice.tssrc/core/move/msgs/MsgDelistStaking.tssrc/core/move/msgs/MsgWhitelistGasPrice.tssrc/core/move/msgs/MsgWhitelistStaking.tssrc/core/move/msgs/index.tsvitest.config.mjs
💤 Files with no reviewable changes (11)
- src/core/index.ts
- src/client/rest/api/AuctionAPI.spec.ts
- src/core/auction/index.ts
- src/client/rest/api/index.ts
- src/client/rest/RESTClient.ts
- src/client/rest/api/AuctionAPI.ts
- src/core/auction/msgs/index.ts
- src/core/auction/msgs/MsgUpdateAuctionParams.ts
- src/core/move/msgs/MsgDelist.ts
- src/core/auction/AuctionParams.ts
- src/core/auction/msgs/MsgAuctionBid.ts
songwongtp
left a comment
There was a problem hiding this comment.
lgtm, but would be great to have andrew/jun double check this too
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/core/move/msgs/MsgWhitelistGasPrice.ts`:
- Around line 15-23: Update the JSDoc for the MsgWhitelistGasPrice constructor
so the `@param` tags match the actual parameter order (constructor(public
authority: AccAddress, public metadata_quote: string, public metadata_lp:
string)); specifically list `@param` authority, then `@param` metadata_quote, then
`@param` metadata_lp with correct brief descriptions to reflect the constructor
signature.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c01e1448-4be8-4643-ad57-d1c075c66cdb
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
src/core/move/msgs/MsgDelistGasPrice.tssrc/core/move/msgs/MsgWhitelistGasPrice.ts
Summary by CodeRabbit
New Features
Bug Fixes
Breaking Changes
Chores