Skip to content

feat: support initia 1.4.x with updated proto types and test fixes#159

Merged
Vritra4 merged 8 commits intomainfrom
feat/support-initia-1_4_x
Apr 3, 2026
Merged

feat: support initia 1.4.x with updated proto types and test fixes#159
Vritra4 merged 8 commits intomainfrom
feat/support-initia-1_4_x

Conversation

@Vritra4
Copy link
Copy Markdown
Contributor

@Vritra4 Vritra4 commented Apr 2, 2026

  • Breaking: Remove auction module (dropped in initia 1.4.x)
  • Breaking: Rename MsgWhitelist → MsgWhitelistStaking, MsgDelist → MsgDelistStaking
  • Add MsgWhitelistGasPrice, MsgDelistGasPrice
  • Update Msg.ts dispatchers for new/renamed type URLs
  • Bump version to 1.1.0

Summary by CodeRabbit

  • New Features

    • Added four new move message types for staking and gas-price operations; renamed whitelist to staking.
  • Bug Fixes

    • Updated governance REST tests to request paginated proposals; removed obsolete auction REST test.
  • Breaking Changes

    • Removed auction API surface, auction messages, and auction parameters from the public API.
  • Chores

    • Bumped package version, pinned/updated dependencies, adjusted test script and test exclusions.

@Vritra4 Vritra4 self-assigned this Apr 2, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2026

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This 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

Cohort / File(s) Summary
Package & Test Config
package.json, ledger-key/package.json, vitest.config.mjs
Bumped package version to 1.1.0, changed test script to vitest run, upgraded @initia/initia.proto to ^1.0.5, pinned axios to 1.14.0 (exact) and removed axios from overrides, adjusted ledger-key "files" formatting, and added Vitest test.exclude patterns.
Auction Module Removal
src/core/auction/..., src/core/auction/msgs/..., src/client/rest/api/AuctionAPI.ts, src/client/rest/api/AuctionAPI.spec.ts, src/client/rest/api/index.ts
Deleted auction models (AuctionParams), auction messages (MsgAuctionBid, MsgUpdateAuctionParams, their index), REST AuctionAPI and its test, and removed auction re-exports from the API barrel.
Core Export Updates
src/core/index.ts, src/core/auction/index.ts
Removed export * from './auction' from core index and removed auction re-exports from auction barrel.
REST Client Update
src/client/rest/RESTClient.ts
Removed auction property and its instantiation from the REST client.
Move Messages — Additions
src/core/move/msgs/MsgWhitelistGasPrice.ts, src/core/move/msgs/MsgDelistGasPrice.ts, src/core/move/msgs/MsgDelistStaking.ts
Added three new Move message classes with Amino/Data/Proto conversions and Any pack/unpack: MsgWhitelistGasPrice, MsgDelistGasPrice, MsgDelistStaking.
Move Messages — Rename / Replace
src/core/move/msgs/MsgWhitelistStaking.ts, src/core/move/msgs/MsgDelist.ts
Renamed/rewired whitelist message to MsgWhitelistStaking (replacing former MsgWhitelist), and removed the legacy MsgDelist.
Move Messages Index & Dispatch
src/core/move/msgs/index.ts, src/core/Msg.ts
Updated move message exports and MoveMsg union to include four new variants; removed auction message variants from the Msg union and updated dispatch logic accordingly.
REST Tests
src/client/rest/api/GovAPI.spec.ts
Adjusted governance tests to request paginated proposals (pagination.limit: '10', pagination.reverse: 'true') and minor promise-style refactor.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐇 I hopped through trees and cleared the lawn,
Auctions gone by early dawn,
Four new paths where one once lay,
Version bumped — I scurried away.
🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main objective: upgrading to support initia 1.4.x with updated proto types and test fixes, which aligns with all major changes in the PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/support-initia-1_4_x

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
src/core/move/msgs/MsgDelistGasPrice.ts (1)

73-80: Minor: Incomplete destructuring in toProto().

Line 74 destructures { authority, metadata_lp } but then accesses this.metadata_quote directly on line 78. For consistency, either destructure all three fields or access all via this.

♻️ 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

📥 Commits

Reviewing files that changed from the base of the PR and between 40c4f3f and 151a48c.

⛔ Files ignored due to path filters (2)
  • ledger-key/package-lock.json is excluded by !**/package-lock.json
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (20)
  • package.json
  • src/client/rest/RESTClient.ts
  • src/client/rest/api/AuctionAPI.spec.ts
  • src/client/rest/api/AuctionAPI.ts
  • src/client/rest/api/GovAPI.spec.ts
  • src/client/rest/api/index.ts
  • src/core/Msg.ts
  • src/core/auction/AuctionParams.ts
  • src/core/auction/index.ts
  • src/core/auction/msgs/MsgAuctionBid.ts
  • src/core/auction/msgs/MsgUpdateAuctionParams.ts
  • src/core/auction/msgs/index.ts
  • src/core/index.ts
  • src/core/move/msgs/MsgDelist.ts
  • src/core/move/msgs/MsgDelistGasPrice.ts
  • src/core/move/msgs/MsgDelistStaking.ts
  • src/core/move/msgs/MsgWhitelistGasPrice.ts
  • src/core/move/msgs/MsgWhitelistStaking.ts
  • src/core/move/msgs/index.ts
  • vitest.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

Copy link
Copy Markdown

@songwongtp songwongtp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, but would be great to have andrew/jun double check this too

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between c3584cc and 7249ac7.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • src/core/move/msgs/MsgDelistGasPrice.ts
  • src/core/move/msgs/MsgWhitelistGasPrice.ts

@Vritra4 Vritra4 merged commit da6db00 into main Apr 3, 2026
5 checks passed
@Vritra4 Vritra4 deleted the feat/support-initia-1_4_x branch April 3, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants