Skip to content
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

feat: add coin types to core #23346

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

johnletey
Copy link
Contributor

@johnletey johnletey commented Jan 13, 2025

Description

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • New Features

    • Introduced a new coin package for precise cryptocurrency coin representation
    • Added support for handling multiple coins as a collection
    • Implemented conversion methods between core and SDK coin types
  • Improvements

    • Enhanced coin handling in bank module with new core coin types
    • Updated method signatures to support more flexible coin management
  • Technical Updates

    • Modified module dependencies to use local core package references
    • Updated coin transfer methods to work with new core coin types

@johnletey johnletey requested review from a team and julienrbrt as code owners January 13, 2025 11:15
Copy link
Contributor

coderabbitai bot commented Jan 13, 2025

📝 Walkthrough

Walkthrough

This pull request introduces a new coin package and modifies several modules to support a core coin representation. The changes primarily involve creating a new Coin struct in the core/coin package, updating go.mod files with local replace directives, and modifying bank module keeper methods to use the new core.Coins type. The modifications aim to standardize coin handling across the Cosmos SDK, replacing the existing sdk.Coins with a more flexible core coin implementation.

Changes

File Change Summary
core/coin/coin.go Added new Coin struct with Denom and Amount fields, created Coins type alias
go.mod Added local replace directive for cosmossdk.io/core module
simapp/v2/go.mod Added local replace directive for cosmossdk.io/core module
types/coin.go Added NewCoreCoin and NewCoreCoins conversion functions
x/bank/keeper/keeper.go Updated method signatures to use core.Coins instead of sdk.Coins
x/bank/keeper/msg_server.go Modified Send method to convert coin amounts to core.Coins
x/bank/keeper/send.go Updated SendCoins method signature to accept core.Coins

Sequence Diagram

sequenceDiagram
    participant Client
    participant MsgServer
    participant Keeper
    participant CoreCoin

    Client->>MsgServer: Send transaction
    MsgServer->>CoreCoin: Convert coins to core.Coins
    CoreCoin-->>MsgServer: Converted coins
    MsgServer->>Keeper: Call SendCoins with core.Coins
    Keeper->>Keeper: Process coin transfer
Loading

Possibly related PRs

Suggested Labels

C:x/accounts, C:x/mint, C:x/feegrant, C:x/distribution, C:x/slashing, C:x/gov, C:x/consensus, C:x/protocolpool, C:x/epochs, C:x/upgrade, C:x/authz, C:x/circuit, C:collections, C:server/v2, C:CLI, C:x/nft, C:x/staking, C:x/group, C:x/evidence, C:Simulations, backport/v0.52.x

Suggested Reviewers

  • tac0turtle
  • sontrinh16
  • julienrbrt
  • akhilkumarpilli
  • lucaslopezf

Finishing Touches

  • 📝 Generate Docstrings (Beta)

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 2

🧹 Nitpick comments (2)
x/bank/keeper/msg_server.go (1)

60-68: Refactor coin conversion for clarity and efficiency.

Converting msg.Amount to coreAmount using a loop can be refactored for better readability. Consider using a helper function to handle the conversion.

Example helper function:

func sdkCoinsToCoreCoins(sdkCoins sdk.Coins) core.Coins {
    coreCoins := make(core.Coins, len(sdkCoins))
    for i, coin := range sdkCoins {
        coreCoins[i] = core.Coin{
            Denom:  coin.Denom,
            Amount: *coin.Amount.BigInt(),
        }
    }
    return coreCoins
}

Updated code:

 var coreAmount core.Coins
-for _, coin := range msg.Amount {
-    coreAmount = append(coreAmount, core.Coin{
-        Denom:  coin.Denom,
-        Amount: *coin.Amount.BigInt(),
-    })
-}
+coreAmount := sdkCoinsToCoreCoins(msg.Amount)
types/coin.go (1)

212-223: Optimize slice allocation in NewCoreCoins

The current implementation grows the slice dynamically. Pre-allocating the slice would improve performance by avoiding reallocations.

Apply this diff to optimize the function:

 func NewCoreCoins(coins core.Coins) Coins {
-    var res Coins
+    res := make(Coins, 0, len(coins))

     for _, coin := range coins {
         res = append(res, Coin{
             Denom:  coin.Denom,
             Amount: math.NewIntFromBigInt(&coin.Amount),
         })
     }

     return NewCoins(res...)
 }
📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 064c9ba and 7a9160e.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (8)
  • core/coin/coin.go (1 hunks)
  • go.mod (1 hunks)
  • simapp/v2/go.mod (1 hunks)
  • types/coin.go (3 hunks)
  • x/bank/go.mod (1 hunks)
  • x/bank/keeper/keeper.go (5 hunks)
  • x/bank/keeper/msg_server.go (2 hunks)
  • x/bank/keeper/send.go (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • core/coin/coin.go
🧰 Additional context used
📓 Path-based instructions (4)
x/bank/keeper/msg_server.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

types/coin.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/bank/keeper/send.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/bank/keeper/keeper.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

🪛 GitHub Actions: CodeQL
go.mod

[warning] go mod tidy -e altered go.mod. Changes need to be checked into version control

x/bank/go.mod

[warning] Multiple go.mod files were modified after running 'go mod tidy -e'. Changes need to be reviewed and checked into version control.

simapp/v2/go.mod

[warning] Multiple go.mod files were modified after running 'go mod tidy -e'. Changes need to be reviewed and checked into version control.

types/coin.go

[error] 12-12: Missing required module dependency: package cosmossdk.io/core/coin is not provided by any module

🪛 GitHub Check: dependency-review
types/coin.go

[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:

🪛 GitHub Actions: Dependency Review
types/coin.go

[error] 12-12: Missing required module: no required module provides package cosmossdk.io/core/coin

🪛 GitHub Actions: Tests / Code Coverage
types/coin.go

[error] 12-12: Missing required module: no required module provides package cosmossdk.io/core/coin

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Summary
🔇 Additional comments (7)
x/bank/keeper/send.go (2)

30-30: Method signature updated appropriately.

The SendCoins method now correctly accepts amt of type core.Coins, aligning with the updated coin types in the system.


201-203: Verify the conversion function sdk.NewCoreCoins.

The function sdk.NewCoreCoins(rawAmt) is used to convert core.Coins to sdk.Coins. Please ensure that this function exists and correctly handles the conversion, including validation and handling of edge cases.

x/bank/keeper/keeper.go (2)

43-45: Ensure all implementations align with updated interface methods.

The methods now accept amt of type core.Coins. Verify that all implementations and calls to these methods are updated accordingly throughout the codebase.


255-257: Check internal handling of core.Coins in method bodies.

In the implementations of SendCoinsFromModuleToAccount, SendCoinsFromModuleToModule, and SendCoinsFromAccountToModule, ensure that amt is correctly processed as core.Coins, including any necessary conversions to sdk.Coins within the method logic.

Also applies to: 272-274, 290-292

x/bank/go.mod (1)

172-173: LGTM: Replace directive correctly added

The replace directive for the core module is properly configured to use the local version.

🧰 Tools
🪛 GitHub Actions: CodeQL

[warning] Multiple go.mod files were modified after running 'go mod tidy -e'. Changes need to be reviewed and checked into version control.

go.mod (1)

179-179: LGTM: Core module replacement properly configured

The replace directive is correctly added to the appropriate section, maintaining consistency with other module replacements.

🧰 Tools
🪛 GitHub Actions: CodeQL

[warning] go mod tidy -e altered go.mod. Changes need to be checked into version control

simapp/v2/go.mod (1)

286-286: LGTM: Core module replacement properly configured

The replace directive is correctly added to the SimApp SDK modules section, maintaining consistency with other module replacements.

🧰 Tools
🪛 GitHub Actions: CodeQL

[warning] Multiple go.mod files were modified after running 'go mod tidy -e'. Changes need to be reviewed and checked into version control.

@@ -9,6 +9,7 @@
"strings"
"unicode"

core "cosmossdk.io/core/coin"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add core module dependency to go.mod

The import of cosmossdk.io/core/coin requires adding the module to go.mod. This is currently causing build failures.

Add the following to your go.mod file:

require (
+    cosmossdk.io/core v1.0.0
)

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 GitHub Check: dependency-review

[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:

🪛 GitHub Actions: Dependency Review

[error] 12-12: Missing required module: no required module provides package cosmossdk.io/core/coin

🪛 GitHub Actions: CodeQL

[error] 12-12: Missing required module dependency: package cosmossdk.io/core/coin is not provided by any module

🪛 GitHub Actions: Tests / Code Coverage

[error] 12-12: Missing required module: no required module provides package cosmossdk.io/core/coin

Comment on lines +34 to +39
func NewCoreCoin(coin core.Coin) Coin {
return Coin{
Denom: coin.Denom,
Amount: math.NewIntFromBigInt(&coin.Amount),
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add validation in NewCoreCoin

The function directly converts core.Coin to Coin without validation. Consider validating the denomination and amount to maintain data integrity.

Apply this diff to add validation:

 func NewCoreCoin(coin core.Coin) Coin {
-    return Coin{
+    c := Coin{
         Denom:  coin.Denom,
         Amount: math.NewIntFromBigInt(&coin.Amount),
     }
+    if err := c.Validate(); err != nil {
+        panic(err)
+    }
+    return c
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func NewCoreCoin(coin core.Coin) Coin {
return Coin{
Denom: coin.Denom,
Amount: math.NewIntFromBigInt(&coin.Amount),
}
}
func NewCoreCoin(coin core.Coin) Coin {
c := Coin{
Denom: coin.Denom,
Amount: math.NewIntFromBigInt(&coin.Amount),
}
if err := c.Validate(); err != nil {
panic(err)
}
return c
}

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

🧹 Nitpick comments (3)
x/bank/keeper/send.go (1)

201-203: Consider adding validation before conversion

While the conversion looks correct, consider validating rawAmt before conversion to ensure all amounts are non-nil and positive.

 func (k BaseSendKeeper) SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccAddress, rawAmt core.Coins) error {
+    for _, coin := range rawAmt {
+        if coin.Amount.Sign() < 0 {
+            return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, "negative coin amount")
+        }
+    }
     amt := sdk.NewCoreCoins(rawAmt)
types/coin.go (2)

34-39: Add validation in NewCoreCoin

Consider adding validation for the input core.Coin to ensure we're not creating invalid coins.

 func NewCoreCoin(coin core.Coin) Coin {
+    if len(coin.Denom) == 0 {
+        panic("empty denom")
+    }
     return Coin{
         Denom:  coin.Denom,
         Amount: math.NewIntFromBigInt(&coin.Amount),
     }
 }

212-223: Consider optimizing NewCoreCoins allocation

The current implementation could be optimized by pre-allocating the result slice.

 func NewCoreCoins(coins core.Coins) Coins {
-    var res Coins
+    res := make(Coins, 0, len(coins))
     for _, coin := range coins {
         res = append(res, Coin{
             Denom:  coin.Denom,
             Amount: math.NewIntFromBigInt(&coin.Amount),
         })
     }
     return NewCoins(res...)
 }
📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 064c9ba and 7a9160e.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (8)
  • core/coin/coin.go (1 hunks)
  • go.mod (1 hunks)
  • simapp/v2/go.mod (1 hunks)
  • types/coin.go (3 hunks)
  • x/bank/go.mod (1 hunks)
  • x/bank/keeper/keeper.go (5 hunks)
  • x/bank/keeper/msg_server.go (2 hunks)
  • x/bank/keeper/send.go (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • core/coin/coin.go
🧰 Additional context used
📓 Path-based instructions (4)
x/bank/keeper/msg_server.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

types/coin.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/bank/keeper/send.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/bank/keeper/keeper.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

🪛 GitHub Actions: CodeQL
simapp/v2/go.mod

[warning] go mod tidy -e altered go.mod. Changes need to be checked into version control.

x/bank/go.mod

[warning] go mod tidy -e altered go.mod. Changes need to be checked into version control.

go.mod

[warning] go mod tidy -e altered go.mod. Changes need to be checked into version control.

types/coin.go

[error] 12-12: Missing required module dependency: no required module provides package cosmossdk.io/core/coin

🪛 GitHub Check: dependency-review
types/coin.go

[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:


[failure] 12-12:
no required module provides package cosmossdk.io/core/coin; to add it:

🪛 GitHub Actions: Dependency Review
types/coin.go

[error] 12-12: Missing required module: no required module provides package cosmossdk.io/core/coin

🪛 GitHub Actions: Tests / Code Coverage
types/coin.go

[error] 12-12: Missing required module dependency: no required module provides package cosmossdk.io/core/coin

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Summary
🔇 Additional comments (6)
x/bank/keeper/msg_server.go (1)

60-66: Verify amount conversion safety

The conversion from sdk.Coins to core.Coins looks correct, but we should ensure that BigInt() never returns nil to prevent potential panics.

✅ Verification successful

Conversion is properly validated and safe

The conversion from sdk.Coins to core.Coins is protected by:

  • Prior validation through IsSendEnabledCoins
  • Controlled iteration over msg.Amount
  • Standard Cosmos SDK protobuf initialization patterns
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for nil amount handling in the codebase
rg -A 2 "Amount: \*coin\.Amount\.BigInt\(\)"

Length of output: 172


Script:

#!/bin/bash
# Check the type definition and validation
ast-grep --pattern 'type $_ struct {
  $$$
  Amount $_
  $$$
}'

# Look for any validation in the msg_server
rg -B 5 "Amount\.BigInt\(\)" x/bank/keeper/msg_server.go

# Check for similar patterns
rg "Amount\.BigInt\(\)"

Length of output: 65933


Script:

#!/bin/bash
# Check the full context of the MsgServer implementation
rg -B 10 -A 10 "func \(k Keeper\) .*\(ctx context\.Context, msg \*" x/bank/keeper/msg_server.go

# Look for any validation of msg before this conversion
rg -B 10 "Amount\s*=\s*append\(coreAmount" x/bank/keeper/msg_server.go

Length of output: 503


Script:

#!/bin/bash
# Check the message type definition and any validation
rg -B 5 -A 5 "type.*Msg.*struct.*Amount" x/bank/keeper/
rg -B 5 -A 5 "type.*Msg.*struct.*Amount" x/bank/types/

Length of output: 114


Script:

#!/bin/bash
# Search for the message definition with a broader pattern
ast-grep --pattern 'message $_ {
  $$$
  repeated $_ Amount = $_;
  $$$
}'

# Also check for any validation rules
rg -B 5 -A 5 "validate.*Amount" x/bank/

Length of output: 118

x/bank/keeper/keeper.go (1)

43-45: Ensure consistent coin type usage across interfaces

The change to use core.Coins in these methods is good for consistency. However, ensure all callers are updated to use the new type.

x/bank/go.mod (2)

172-173: ⚠️ Potential issue

Run go mod tidy -e to resolve inconsistencies.

The pipeline indicates that go mod tidy -e has altered the file. Please run the command and commit the changes.

Run the following script to verify the module dependencies:

🧰 Tools
🪛 GitHub Actions: CodeQL

[warning] go mod tidy -e altered go.mod. Changes need to be checked into version control.


172-173: Replace directives are consistent across all files.

The addition of replace directives for cosmossdk.io/core is consistent across all three files, with correct relative paths:

  • x/bank/go.mod: ../../core
  • go.mod: ./core
  • simapp/v2/go.mod: ../../core

Also applies to: 179-179, 286-286

🧰 Tools
🪛 GitHub Actions: CodeQL

[warning] go mod tidy -e altered go.mod. Changes need to be checked into version control.

go.mod (1)

179-179: ⚠️ Potential issue

Run go mod tidy -e to resolve inconsistencies.

The pipeline indicates that go mod tidy -e has altered the file. Please run the command and commit the changes.

Run the following script to verify the module dependencies:

🧰 Tools
🪛 GitHub Actions: CodeQL

[warning] go mod tidy -e altered go.mod. Changes need to be checked into version control.

simapp/v2/go.mod (1)

286-286: ⚠️ Potential issue

Run go mod tidy -e to resolve inconsistencies.

The pipeline indicates that go mod tidy -e has altered the file. Please run the command and commit the changes.

Run the following script to verify the module dependencies:

🧰 Tools
🪛 GitHub Actions: CodeQL

[warning] go mod tidy -e altered go.mod. Changes need to be checked into version control.

@@ -2,7 +2,7 @@ package keeper

import (
"context"

core "cosmossdk.io/core/coin"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add missing module dependency

The cosmossdk.io/core/coin module is not available in the module requirements.

Add the following to your go.mod file:

+ require cosmossdk.io/core v0.1.0

Committable suggestion skipped: line range outside the PR's diff.

Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

We've discussed in our standup that for a better UX it is best to not add this to core.
This is because the type won't be exactly identical and requires an active migration at many place, without really getting rid of sdk.Coins from the SDK.

The proposal was to add it in math instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants