Skip to content

Conversation

@tansawit
Copy link
Contributor

@tansawit tansawit commented Nov 3, 2025

Add comprehensive decoder support for Cosmos SDK authz and feegrant modules.

Changes:

  • Implement authz decoder for grant, revoke, and exec operations with nested message decoding
  • Implement feegrant decoder for allowance grant and revoke operations
  • Add schema definitions, message type constants, and comprehensive test coverage with fixtures

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for Cosmos Authz messages (MsgExec, MsgGrant, MsgRevoke) with recursive decoding of nested messages in MsgExec
    • Added support for Cosmos Feegrant messages (MsgGrantAllowance, MsgRevokeAllowance)
    • Expanded Move VM documentation with additional message types
  • Documentation

    • Enhanced README with comprehensive Authz and Feegrant message type documentation
  • Tests

    • Added extensive test coverage for Authz and Feegrant message decoding scenarios

Poafs1 and others added 9 commits June 30, 2025 14:46
Add decoders for Cosmos authz and feegrant modules with comprehensive test coverage.

- Implement authz decoder for grant, revoke, and exec operations
- Implement feegrant decoder for allowance grant and revoke operations
- Add schema definitions and message type constants
- Add comprehensive test fixtures and test cases
@tansawit tansawit requested a review from evilpeach as a code owner November 3, 2025 10:07
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 3, 2025

Walkthrough

This PR adds support for decoding Cosmos SDK authz and feegrant messages, including MsgExec, MsgGrant, MsgRevoke, MsgGrantAllowance, and MsgRevokeAllowance. The decoder selection logic has been refactored to use a helper method. New schemas, interfaces, decoders, and comprehensive tests are included.

Changes

Cohort / File(s) Change Summary
Documentation
README.md
Added authz and feegrant message documentation sections with details on MsgExec, MsgGrant, MsgRevoke, MsgGrantAllowance, and MsgRevokeAllowance; noted that MsgExec recursively decodes inner messages.
Decoder Registry & Core Refactoring
src/decoder-registry.ts
Introduced internal cosmosAuthDecoders array; updated three message decoder arrays (evm, wasm, move) to include authz/feegrant decoders; expanded Move decoders with additional entries.
src/decoder.ts
New Decoder Implementations
src/decoders/cosmos/authz.ts
Added three MessageDecoder objects: authzExecDecoder (handles nested message decoding), authzGrantDecoder, authzRevokeDecoder.
src/decoders/cosmos/feegrant.ts
src/decoders/cosmos/index.ts
Type Definitions
src/interfaces/cosmos.ts
Added five new DecodedMessage types: DecodedAuthzExecMessage, DecodedAuthzGrantMessage, DecodedAuthzRevokeMessage, DecodedFeegrantGrantAllowanceMessage, DecodedFeegrantRevokeAllowanceMessage.
src/interfaces/decoder.ts
Message Types & Schemas
src/message-types.ts
Added five message type mappings: MsgExec, MsgGrant, MsgRevoke, MsgGrantAllowance, MsgRevokeAllowance.
src/schema/cosmos/authz.ts
src/schema/cosmos/feegrant.ts
src/schema/cosmos/index.ts
Test Fixtures & Tests
src/tests/cosmos/move/authz.fixture.ts
Added extensive test fixtures covering MsgExec variants (multiple messages, different addresses, delegation, withdrawal), MsgGrant, and MsgRevoke scenarios with mocked API responses.
src/tests/cosmos/move/authz.test.ts
src/tests/cosmos/move/feegrant.test.ts
src/tests/cosmos/move/feegrant.fixture.ts
src/tests/cosmos/move/nft/nft-burn.fixture.ts

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant Decoder
    participant DecoderHelper
    participant AuthzExecDecoder
    participant InnerDecoders

    Caller->>Decoder: _decodeMessage(msg, vm)
    Decoder->>DecoderHelper: _getDecodersForVm(vm)
    DecoderHelper-->>Decoder: MessageDecoder[]
    
    alt Message is MsgExec
        Decoder->>AuthzExecDecoder: decode(msg, this._getDecodersForVm.bind(this))
        AuthzExecDecoder->>AuthzExecDecoder: validate with zMsgExec
        
        loop for each inner message in MsgExec.msgs
            AuthzExecDecoder->>AuthzExecDecoder: resolveDecoder(innerMsg)
            AuthzExecDecoder->>InnerDecoders: decode(innerMsg, getDecodersForVm)
            InnerDecoders-->>AuthzExecDecoder: DecodedMessage
        end
        
        AuthzExecDecoder-->>Decoder: DecodedAuthzExecMessage
    else Message is other Authz/Feegrant
        Decoder->>AuthzExecDecoder: decode(msg, getDecodersForVm)
        AuthzExecDecoder-->>Decoder: DecodedMessage
    end
    
    Decoder-->>Caller: DecodedMessage
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Core decoder refactoring: The changes to src/decoder.ts with the introduction of _getDecodersForVm helper and passing it as a bound function require careful review to ensure the recursive decoder resolution pattern works correctly for nested MsgExec messages.
  • New decoder implementations: While following existing patterns, the authz MsgExec decoder's recursive message decoding logic with fallback handling for unsupported types warrants specific attention.
  • Type consistency: Verify that all five new message types are consistently defined across interfaces, schemas, decoders, and the registry.
  • Test coverage comprehensiveness: Extensive test fixtures and test cases validate the feature thoroughly, reducing review complexity.

Special attention areas:

  • The getDecodersForVm binding mechanism in src/decoder.ts and how it's passed through the decoder chain
  • Recursive decoding logic in authzExecDecoder for nested message resolution
  • Consistency of message type URLs across SUPPORTED_MESSAGE_TYPES, schemas, and decoders

Poem

🐰 A warren of decoders, now authz-aware,
With feegrants and execs beyond compare,
When messages nest like burrows so deep,
Recursive decoding makes promises we keep!
From grant to revoke, the chain's every layer,
This rabbit rejoices—a decoder's sweet prayer! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add authz and feegrant support' accurately summarizes the main objective of the pull request, which adds comprehensive decoder support for Cosmos SDK authz and feegrant modules.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-add-authz-feegrant-support

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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

@tansawit tansawit changed the title cosmos: Add authz and feegrant support feat: add authz and feegrant support Nov 3, 2025
- Clarifies purpose of optional callback in authz exec decoder
- Explains recursive decoding of nested messages
Copy link
Contributor

@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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between a72a6ad and 77aa233.

📒 Files selected for processing (16)
  • README.md (1 hunks)
  • src/decoder-registry.ts (2 hunks)
  • src/decoder.ts (2 hunks)
  • src/decoders/cosmos/authz.ts (1 hunks)
  • src/decoders/cosmos/feegrant.ts (1 hunks)
  • src/decoders/cosmos/index.ts (1 hunks)
  • src/interfaces/cosmos.ts (2 hunks)
  • src/interfaces/decoder.ts (1 hunks)
  • src/message-types.ts (1 hunks)
  • src/schema/cosmos/authz.ts (1 hunks)
  • src/schema/cosmos/feegrant.ts (1 hunks)
  • src/schema/cosmos/index.ts (1 hunks)
  • src/tests/cosmos/move/authz-message-types.fixture.ts (1 hunks)
  • src/tests/cosmos/move/authz.fixture.ts (1 hunks)
  • src/tests/cosmos/move/authz.test.ts (1 hunks)
  • src/tests/cosmos/move/feegrant.test.ts (1 hunks)
🔇 Additional comments (9)
src/schema/cosmos/index.ts (2)

1-1: Authz schema export looks good.

Re-exporting the authz schemas here keeps downstream consumers in sync with the new decoders.


5-5: Feegrant schema export wired correctly.

Including the feegrant barrel ensures the new allowance schemas are available wherever the cosmos schemas are imported.

src/decoders/cosmos/index.ts (2)

1-1: Authz decoder export confirmed.

Adding the authz decoders to the barrel keeps the registry wiring simple and consistent.


4-4: Feegrant decoder export confirmed.

The feegrant decoder export ensures the new modules are reachable via the existing cosmos decoder surface.

src/decoder-registry.ts (1)

5-33: Decoder registry additions look correct.

Prepending the authz and feegrant decoders across the VM-specific registries ensures those messages are discoverable no matter which Cosmos VM path we're decoding.

src/decoder.ts (2)

227-240: Helper extraction enables recursive decoding.

Refactoring the VM switch into _getDecodersForVm and passing the bound helper to decoder.decode gives nested decoders everything they need without duplicating logic. Nice cleanup.


293-304: _getDecodersForVm helper looks solid.

Centralizing the VM→decoder mapping here reduces duplication and makes it easy to extend for new VM types later.

src/decoders/cosmos/authz.ts (1)

46-67: Thoughtful recursion wiring.

Passing getDecodersForVm through lets MsgExec peel nested payloads cleanly while still falling back to graceful “not supported” stubs when nothing matches, which keeps exec decoding resilient across VMs.

src/tests/cosmos/move/authz.test.ts (1)

499-646: Authz exec sender coverage is spot-on

Exercising the granter-as-sender case inside MsgExec nails the nuance that most regressions miss. Happy with this.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@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: 0

🧹 Nitpick comments (1)
src/decoders/cosmos/authz.ts (1)

54-67: Handle inner decoder failures gracefully.

If a nested decoder throws (e.g., schema drift on a known message type), the exception bubbles up and aborts the entire MsgExec decode. Wrapping the call and falling back to createNotSupportedMessage will preserve the remaining inner messages while still signalling the unsupported one.

-      if (decoder) {
-        const decoded = await decoder.decode(
-          innerMessage,
-          log,
-          apiClient,
-          txResponse,
-          vm,
-          getDecodersForVm
-        );
-        decodedInnerMessages.push(decoded);
-      } else {
+      if (decoder) {
+        try {
+          const decoded = await decoder.decode(
+            innerMessage,
+            log,
+            apiClient,
+            txResponse,
+            vm,
+            getDecodersForVm
+          );
+          decodedInnerMessages.push(decoded);
+        } catch {
+          decodedInnerMessages.push(
+            createNotSupportedMessage(innerMessage["@type"])
+          );
+        }
+      } else {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between a72a6ad and d5f902c.

📒 Files selected for processing (16)
  • README.md (1 hunks)
  • src/decoder-registry.ts (2 hunks)
  • src/decoder.ts (2 hunks)
  • src/decoders/cosmos/authz.ts (1 hunks)
  • src/decoders/cosmos/feegrant.ts (1 hunks)
  • src/decoders/cosmos/index.ts (1 hunks)
  • src/interfaces/cosmos.ts (2 hunks)
  • src/interfaces/decoder.ts (1 hunks)
  • src/message-types.ts (1 hunks)
  • src/schema/cosmos/authz.ts (1 hunks)
  • src/schema/cosmos/feegrant.ts (1 hunks)
  • src/schema/cosmos/index.ts (1 hunks)
  • src/tests/cosmos/move/authz-message-types.fixture.ts (1 hunks)
  • src/tests/cosmos/move/authz.fixture.ts (1 hunks)
  • src/tests/cosmos/move/authz.test.ts (1 hunks)
  • src/tests/cosmos/move/feegrant.test.ts (1 hunks)
🧰 Additional context used
🪛 Gitleaks (8.28.0)
src/tests/cosmos/move/authz.fixture.ts

[high] 369-369: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


[high] 893-893: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


[high] 1386-1386: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🔇 Additional comments (23)
src/tests/cosmos/move/authz.fixture.ts (1)

1-1474: LGTM! Comprehensive test fixtures for authz scenarios.

The fixture file provides thorough test coverage with real blockchain transaction data. The Gitleaks warnings about "API keys" at lines 369, 893, and 1386 are false positives—these are public keys from blockchain transactions, which are safe to include in test fixtures.

src/decoders/cosmos/index.ts (1)

1-1: LGTM! Exports follow the existing pattern.

The new exports for authz and feegrant modules are properly integrated into the cosmos decoders index.

Also applies to: 4-4

README.md (1)

355-359: LGTM! Clear documentation of authz support.

The documentation accurately describes MsgExec's recursive decoding capability and follows the existing documentation structure.

src/interfaces/decoder.ts (1)

17-18: LGTM! Clean extension for recursive decoding.

The optional getDecodersForVm parameter enables nested message decoding (e.g., MsgExec) while maintaining backward compatibility with existing decoders.

src/schema/cosmos/index.ts (1)

1-1: LGTM! Schema exports properly integrated.

The authz and feegrant schema exports follow the existing pattern and are correctly positioned in the module hierarchy.

Also applies to: 5-5

src/schema/cosmos/feegrant.ts (1)

1-25: LGTM! Well-structured feegrant schemas.

The Zod schemas correctly model Cosmos SDK feegrant messages. The use of .passthrough() on zAllowance is appropriate for handling different allowance types (e.g., BasicAllowance, PeriodicAllowance) with varying fields.

src/decoder.ts (2)

227-227: LGTM! Clean refactoring for recursive decoding.

The refactoring to use _getDecodersForVm and pass a bound version to decoders enables recursive message decoding (for MsgExec) while keeping the code clean and maintainable.

Also applies to: 233-240


293-304: LGTM! Well-structured helper method.

The _getDecodersForVm helper provides clean VM-to-decoder mapping with appropriate error handling for unknown VM types.

src/message-types.ts (1)

26-35: LGTM! Message type constants properly defined.

The new authz and feegrant message type constants follow the existing pattern and correctly map to Cosmos SDK message type paths. The trailing comma on line 26 is a minor formatting improvement.

src/decoders/cosmos/feegrant.ts (1)

22-35: Solid validation path here.

The safeParse guard plus the direct handoff of the parsed fields keeps malformed feegrant payloads from ever leaking into the decoded output, which is exactly what we want for these modules.

src/tests/cosmos/move/feegrant.test.ts (1)

132-214: Great coverage on allowance variants.

Exercising both empty and populated spend limits ensures the decoder won’t regress when allowance shapes vary, and the expectations line up with the schema additions.

src/tests/cosmos/move/authz.test.ts (1)

174-356: Appreciate the multi-message authz scenario.

Validating multiple inner MsgSends—including the grantee/granter wiring—gives strong regression protection for nested decoding logic.

src/decoder-registry.ts (1)

5-33: Decoder ordering looks correct.

Placing the authz/feegrant handlers ahead of the generic banking decoders guarantees MsgExec and allowance messages short-circuit to the right implementation before the legacy fallbacks run.

src/schema/cosmos/authz.ts (3)

12-21: LGTM: Authorization and grant schemas are appropriately flexible.

The zAuthorization schema correctly uses .passthrough() to allow additional properties beyond @type, which is necessary since different authorization types have different fields. The zGrant schema properly makes expiration optional.


23-35: LGTM: Grant and revoke schemas look correct.

Both zMsgGrant and zMsgRevoke schemas properly validate their respective message structures with appropriate required fields.


1-10: Review comment is factually incorrect; no issues found.

The actual zMessage schema in src/schema/cosmos/bank.ts (lines 6-10) is:

z.object({ "@type": z.string() }).passthrough()

This is a generic, permissive schema that:

  • Accepts ANY Cosmos message type (not just bank messages)
  • Supports recursive messages via .passthrough()
  • Already handles extensibility for future message types

The review comment's concerns about being "too narrow," having "circular dependency risk," and "breaking extensibility" do not apply to the actual implementation. The schema correctly validates MsgExec.msgs as an array of any supported message type without architectural issues.

While the location of zMessage in bank.ts (rather than a dedicated shared schema file) is a minor organizational concern, the implementation is functionally correct as-is.

Likely an incorrect or invalid review comment.

src/interfaces/cosmos.ts (3)

9-11: LGTM: Union type properly extended.

The new authz and feegrant message interfaces are correctly added to the DecodedMessage union type.

Also applies to: 19-20


48-54: LGTM: Recursive message structure correctly implemented.

The DecodedAuthzExecMessage interface properly uses DecodedMessage[] for the nested messages, which correctly handles the recursive nature of authz exec operations where one message can contain other decoded messages of any type.


56-96: LGTM: Well-structured interface definitions.

All five new interfaces (DecodedAuthzGrantMessage, DecodedAuthzRevokeMessage, DecodedFeegrantGrantAllowanceMessage, DecodedFeegrantRevokeAllowanceMessage) follow consistent patterns:

  • Extend DecodedMessageBase appropriately
  • Use descriptive action names following the existing convention
  • Use index signatures ([key: string]: unknown) for authorization and allowance objects to allow flexibility for different types
  • Properly mark optional fields (like expiration)
src/tests/cosmos/move/authz-message-types.fixture.ts (4)

3-147: LGTM: Comprehensive delegate fixture.

The mockMsgExecWithDelegate fixture provides thorough test data including:

  • Complete transaction structure with auth_info and body
  • Detailed event logs with proper attributes (validator, delegator, amounts)
  • Correct authz_msg_index attributes in events for tracking nested messages
  • Realistic gas values and timestamps

149-220: LGTM: Complete API response mocks.

The mockApiResponsesForDelegate provides realistic mock responses for:

  • Account resources with proper Move resource structures
  • Metadata endpoint returning token information
  • Validator endpoint with commission and description details

222-428: LGTM: Comprehensive withdraw reward and undelegate fixtures.

Both mockMsgExecWithWithdrawReward and its API responses follow the same thorough pattern as the delegate fixture, covering:

  • Proper event structure for reward withdrawal
  • Correct coin transfer events
  • Appropriate validator and account data

430-527: LGTM: Undelegate fixture with proper completion time.

The mockMsgExecWithUndelegate fixture correctly includes:

  • completion_time in the unbond event (Line 453)
  • Proper event structure
  • Efficient reuse of API responses via mockApiResponsesForUndelegate = mockApiResponsesForDelegate (Line 527)

tansawit and others added 3 commits November 3, 2025 17:26
- Add mock API response for burned NFT token address
- Return empty resources array to simulate burned NFT state
- Fixes test failure where metadata resolver queries burned token
…nt-support

# Conflicts:
#	src/decoder-registry.ts
#	src/decoder.ts
#	src/interfaces/cosmos.ts
#	src/message-types.ts
Copy link
Contributor

@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: 0

🧹 Nitpick comments (3)
src/decoders/cosmos/authz.ts (3)

26-29: Consider more descriptive error messages.

The error message could include validation details to aid debugging. Consider using parsed.error to provide context.

     const parsed = zMsgExec.safeParse(message);
     if (!parsed.success) {
-      throw new Error("Invalid authz exec message");
+      throw new Error(`Invalid authz exec message: ${parsed.error.message}`);
     }

92-95: Consider more descriptive error messages.

Similar to the exec decoder, include validation details for easier debugging.

     const parsed = zMsgGrant.safeParse(message);
     if (!parsed.success) {
-      throw new Error("Invalid authz grant message");
+      throw new Error(`Invalid authz grant message: ${parsed.error.message}`);
     }

124-127: Consider more descriptive error messages.

Include validation details to maintain consistency with the other decoders.

     const parsed = zMsgRevoke.safeParse(message);
     if (!parsed.success) {
-      throw new Error("Invalid authz revoke message");
+      throw new Error(`Invalid authz revoke message: ${parsed.error.message}`);
     }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between b2c5597 and 2148565.

📒 Files selected for processing (5)
  • src/decoder.ts (3 hunks)
  • src/decoders/cosmos/authz.ts (1 hunks)
  • src/tests/cosmos/move/authz.fixture.ts (1 hunks)
  • src/tests/cosmos/move/authz.test.ts (1 hunks)
  • src/tests/cosmos/move/nft/nft-burn.fixture.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/tests/cosmos/move/authz.test.ts
  • src/tests/cosmos/move/nft/nft-burn.fixture.ts
  • src/decoder.ts
🧰 Additional context used
🪛 Gitleaks (8.28.0)
src/tests/cosmos/move/authz.fixture.ts

[high] 915-915: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


[high] 1438-1438: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


[high] 1930-1930: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🔇 Additional comments (1)
src/tests/cosmos/move/authz.fixture.ts (1)

915-915: Static analysis false positive - safe to ignore.

The flagged values are blockchain public keys used in transaction signatures, not secret API keys. Public keys are meant to be publicly visible and are part of the transaction data structure.

Also applies to: 1438-1438, 1930-1930

@tansawit tansawit requested a review from evilpeach November 10, 2025 05:46
Poafs1
Poafs1 previously approved these changes Nov 17, 2025
Copy link
Contributor

@Poafs1 Poafs1 left a comment

Choose a reason for hiding this comment

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

Everything look good now, but let's wait for @evilpeach to re-review again.

@evilpeach
Copy link
Collaborator

@Poafs1 please help me as follows

  1. separate fixture part from feegrant.test.ts
  2. use real txs as much as we can for both authz and feegrant
  3. combine authz.fixture.ts and authz-message-types.fixture.ts into one file
  4. update all variable names as what we have done before

Copy link
Contributor

@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: 8

🧹 Nitpick comments (1)
src/tests/cosmos/move/feegrant.fixture.ts (1)

242-329: Add source comment for transaction.

While the transaction hash appears to be in a valid format, it's unclear whether this is sourced from a real transaction. Add a source comment (e.g., // Source: https://scan-api.initia.xyz/v1/...) to document the origin of this fixture, consistent with the pattern used in authz.fixture.ts.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between d676ee6 and ccc5440.

📒 Files selected for processing (4)
  • src/tests/cosmos/move/authz.fixture.ts (1 hunks)
  • src/tests/cosmos/move/authz.test.ts (1 hunks)
  • src/tests/cosmos/move/feegrant.fixture.ts (1 hunks)
  • src/tests/cosmos/move/feegrant.test.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/tests/cosmos/move/authz.test.ts
🧰 Additional context used
🪛 Gitleaks (8.29.0)
src/tests/cosmos/move/authz.fixture.ts

[high] 485-485: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


[high] 977-977: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🔇 Additional comments (3)
src/tests/cosmos/move/authz.fixture.ts (2)

485-485: Static analysis false positives.

The static analysis tool flagged these lines as containing API keys, but these are actually public keys within test transaction data and pose no security risk. These warnings can be safely dismissed.

Also applies to: 977-977


1067-1199: Verify whether real transaction requirement applies to all fixtures or is context-specific.

The review correctly identifies that mockMsgExecWithMultiple uses a mock hash ("TEST789") while other fixtures use real sources. However, I could not find documented PR objectives stating that all fixtures must use real transactions. While mockRealMsgExecTransaction and mockRealMsgExecWithDifferentAddresses follow the real transaction pattern, mockMsgExecWithMultiple may intentionally use synthetic data since it tests a specific scenario with multiple inner messages that may not require a real blockchain transaction. Confirm whether using real transactions is a hard requirement for all fixtures or an acceptable approach for certain test cases.

src/tests/cosmos/move/feegrant.test.ts (1)

1-138: LGTM! Well-structured test suite.

The test file is cleanly organized with comprehensive coverage of feegrant message types, proper mocking setup, and clear assertions.

@evilpeach evilpeach merged commit 5a9dd63 into main Nov 23, 2025
5 checks passed
@evilpeach evilpeach deleted the feat-add-authz-feegrant-support branch November 23, 2025 15:45
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.

4 participants