-
Notifications
You must be signed in to change notification settings - Fork 40
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
release/v1.51 chain upgrade 1.13 to master #231
Conversation
…ries feat/tendermint_module_queries
…ry gRPC response received
…factoring feat/cookies_management_refactoring
feat/add_ibc_transfer_support
…example scripts for all the queries
…le_queries (feat) Added support for IBC Core Channel module queries. Added also …
…ries (feat) Added script examples for the IBC Core Client module queries
…_queries feat/ibc_connection_module_queries
…mismatch. Added configuration for local network.
…atch_fixing (feat) Added a new config option to disable the auto fix of sequence …
…ll go.mod dependencies to sync with injective-core dependencies
…use from the go.mod file
… that makes the workflow fail
…om the official tokens lists for each environment
…list feat/load_official_tokens_list
…ll go.mod dependencies to sync with injective-core dependencies
…ermissions module's messages and queries
… indexer. Updated example scripts
….com/InjectiveLabs/sdk-go into feat/update_dependencies_chain_v1_13
fix: make PrepareFactory public so chilliass can re-use it
…e and injective-indexer (v1.13 chain upgrade candidates)
…ermissions module's messages and queries
…/InjectiveLabs/sdk-go into feat/permissions_module_messages
…ssages Feat/permissions module messages
…ript. Updated all markets and tokens INI files
…hain_v1_13 Feat/update dependencies chain v1 13
… release/v1_51_chain_upgrade_1_13_master
Important Review skippedReview was skipped as selected files did not have any reviewable changes. Files selected but had no reviewable changes (4)
You can disable this status message by setting the Warning Walkthrough skippedFile diffs could not be summarized. 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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #231 +/- ##
==========================================
- Coverage 25.01% 15.82% -9.20%
==========================================
Files 17 25 +8
Lines 3022 4784 +1762
==========================================
+ Hits 756 757 +1
- Misses 2234 3992 +1758
- Partials 32 35 +3 ☔ View full report in Codecov by Sentry. |
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: 3
Outside diff range, codebase verification and nitpick comments (11)
chain/auction/types/key.go (1)
14-14
: The new keyKeyLastAuctionResult
is declared but not used anywhere else in the codebase. Please ensure it is integrated where necessary to avoid dead code.Analysis chain
LGTM! But verify the usage of the new key.
The addition of
KeyLastAuctionResult
follows the existing pattern for keys.However, ensure that the new key is used correctly in the codebase.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the new key `KeyLastAuctionResult`. # Test: Search for the key usage. Expect: Occurrences of the new key. rg --type go 'KeyLastAuctionResult'Length of output: 99
.github/workflows/run-tests.yml (1)
11-11
: Consider using a specific version for the checkout action.Using the master branch for the checkout action can introduce instability as it pulls the latest changes. Consider using a specific version for stability.
- - uses: actions/checkout@master + - uses: actions/checkout@v3.pre-commit-config.yaml (1)
16-16
: Consider using a specific version for the repository reference.Using the master branch can introduce instability as it pulls the latest changes. Consider using a specific version for stability.
- rev: master + rev: v0.5.0chain/oracle/types/stork.go (1)
7-19
:NewPriceState
does not handle errors.The
NewPriceState
function initializes aPriceState
struct without any error handling. It assumes that the provided parameters are always valid. This could lead to issues if invalid data is passed to the function.
- Location:
chain/oracle/types/oracle.go
, lines 1-7Analysis chain
Verify error handling in
NewPriceState
.Ensure that
NewPriceState
properly handles any potential errors or edge cases.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify error handling in `NewPriceState`. # Test: Search for the function implementation. Expect: Proper error handling. ast-grep --lang go --pattern $'func NewPriceState(price math.LegacyDec, blockTime int64) *PriceState { $$$ }'Length of output: 112
Script:
#!/bin/bash # Description: Verify error handling in `NewPriceState`. # Search for the definition of the `NewPriceState` function in the Go codebase. rg "func NewPriceState" -A 10 --multilineLength of output: 708
chain/insurance/types/expected_keepers.go (2)
14-14
: Inconsistent context type forSendCoinsFromModuleToModule
.The method
SendCoinsFromModuleToModule
inchain/exchange/types/expected_keepers.go
still usessdk.Context
instead of the updatedcontext.Context
. Please update the context type to ensure consistency across the codebase.
chain/exchange/types/expected_keepers.go
: Updatectx sdk.Context
toctx context.Context
.Analysis chain
Verify method usage for
SendCoinsFromModuleToModule
.Ensure that all function calls to
SendCoinsFromModuleToModule
correctly handle the updated context type.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `SendCoinsFromModuleToModule` handle the updated context type. # Test: Search for the method usage. Expect: Correct handling of the updated context type. rg --type go 'SendCoinsFromModuleToModule'Length of output: 1075
15-15
: Update context type inSendCoinsFromModuleToAccount
method.The
SendCoinsFromModuleToAccount
method inchain/exchange/types/expected_keepers.go
should be updated to usecontext.Context
instead ofsdk.Context
to maintain consistency across the codebase.
chain/exchange/types/expected_keepers.go
: UpdateSendCoinsFromModuleToAccount
method to usecontext.Context
.Analysis chain
Verify method usage for
SendCoinsFromModuleToAccount
.Ensure that all function calls to
SendCoinsFromModuleToAccount
correctly handle the updated context type.
Verify method usage for
SendCoinsFromModuleToAccount
inchain/exchange
.Ensure that the
SendCoinsFromModuleToAccount
function inchain/exchange/types/expected_keepers.go
correctly handles the context type.
Verify method calls to
SendCoinsFromModuleToAccount
inchain/exchange
.Ensure that all calls to
SendCoinsFromModuleToAccount
in thechain/exchange
directory handle the context type correctly.
Verify method calls to
SendCoinsFromModuleToAccount
inchain/exchange
.Ensure that all calls to
SendCoinsFromModuleToAccount
in thechain/exchange
directory handle the context type correctly.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `SendCoinsFromModuleToAccount` handle the updated context type. # Test: Search for the method usage. Expect: Correct handling of the updated context type. rg --type go 'SendCoinsFromModuleToAccount'Length of output: 1509
Script:
#!/bin/bash # Description: Verify all function calls to `SendCoinsFromModuleToAccount` in the `chain/exchange` directory handle the context type correctly. # Test: Search for the method usage in the `chain/exchange` directory. Expect: Correct handling of the context type. rg --type go 'SendCoinsFromModuleToAccount' chain/exchangeLength of output: 218
Script:
#!/bin/bash # Description: Verify all function calls to `SendCoinsFromModuleToAccount` in the `chain/exchange` directory handle the context type correctly. # Test: Search for the method calls in the `chain/exchange` directory. Expect: Correct handling of the context type. rg --type go 'SendCoinsFromModuleToAccount(' chain/exchangeLength of output: 170
Script:
#!/bin/bash # Description: Verify all function calls to `SendCoinsFromModuleToAccount` in the `chain/exchange` directory handle the context type correctly. # Test: Search for the method calls in the `chain/exchange` directory. Expect: Correct handling of the context type. rg --type go 'SendCoinsFromModuleToAccount\(' chain/exchangeLength of output: 222
chain/ocr/types/expected_keepers.go (1)
Inconsistent interface update:
The
BankKeeper
interface in thechain/exchange/types/expected_keepers.go
file still usessdk.Context
instead ofcontext.Context
. Please update the following methods to usecontext.Context
for consistency:
SendCoinsFromModuleToModule
SendCoinsFromModuleToAccount
SendCoinsFromAccountToModule
GetSupply
Location:
chain/exchange/types/expected_keepers.go
Analysis chain
Line range hint
4-28
:
Verify consistency of interface changes.Ensure that all implementations of the
BankKeeper
interface are updated to usecontext.Context
instead ofsdk.Context
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all implementations of the `BankKeeper` interface are updated to use `context.Context` instead of `sdk.Context`. # Test: Search for the interface implementations. Expect: Only occurrences of the new context type. rg --type go -A 5 $'BankKeeper'Length of output: 7040
Script:
#!/bin/bash # Description: Verify that all `BankKeeper` interface methods use `context.Context` instead of `sdk.Context`. # Search for `BankKeeper` interface methods that still use `sdk.Context`. rg --type go 'BankKeeper' -A 5 | rg 'sdk.Context'Length of output: 591
chain/exchange/types/fee_discounts.go (1)
13-14
: Incomplete Migration ofsdkmath.Int
tomath.Int
The migration from
sdkmath.Int
tomath.Int
is incomplete. The following files still contain instances ofsdkmath.Int
:
chain/peggy/types/types.go
chain/exchange/types/expected_keepers.go
Please ensure that all instances of
sdkmath.Int
are replaced withmath.Int
for consistency across the codebase.Analysis chain
LGTM! But verify the usage of
math.Int
andmath.LegacyDec
in the codebase.The code changes are approved.
However, ensure that all instances of
sdkmath.Int
andsdk.Dec
have been replaced withmath.Int
andmath.LegacyDec
for consistency.Also applies to: 33-34
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all instances of `sdkmath.Int` and `sdk.Dec` have been replaced with `math.Int` and `math.LegacyDec`. # Test: Search for the old types. Expect: No occurrences. rg --type go 'sdkmath.Int' rg --type go 'sdk.Dec' # Test: Search for the new types. Expect: Multiple occurrences. rg --type go 'math.Int' rg --type go 'math.LegacyDec'Length of output: 104281
chain/peggy/types/params_legacy.go (1)
70-70
: Add a comment to explain the purpose ofParamStoreAdmins
.Adding a brief comment to explain the purpose of
ParamStoreAdmins
will improve code readability and maintainability.+ // ParamStoreAdmins stores the admin-related settings ParamStoreAdmins = []byte("Admins")
chain/exchange/types/params.go (2)
24-25
: Update comments to reflect new fee structure.The comment should be updated to reflect the new listing fee values.
- // SpotMarketInstantListingFee is 20 INJ + // SpotMarketInstantListingFee is 20 INJ (reduced from 1000 INJ)
27-28
: Update comments to reflect new fee structure.The comment should be updated to reflect the new listing fee values.
- // DerivativeMarketInstantListingFee is 20 INJ + // DerivativeMarketInstantListingFee is 20 INJ (reduced from 1000 INJ)
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (54)
chain/auction/types/auction.pb.go
is excluded by!**/*.pb.go
chain/auction/types/genesis.pb.go
is excluded by!**/*.pb.go
chain/auction/types/query.pb.go
is excluded by!**/*.pb.go
chain/auction/types/tx.pb.go
is excluded by!**/*.pb.go
chain/crypto/ethsecp256k1/keys.pb.go
is excluded by!**/*.pb.go
chain/exchange/types/authz.pb.go
is excluded by!**/*.pb.go
chain/exchange/types/events.pb.go
is excluded by!**/*.pb.go
chain/exchange/types/exchange.pb.go
is excluded by!**/*.pb.go
chain/exchange/types/genesis.pb.go
is excluded by!**/*.pb.go
chain/exchange/types/proposal.pb.go
is excluded by!**/*.pb.go
chain/exchange/types/query.pb.go
is excluded by!**/*.pb.go
chain/exchange/types/tx.pb.go
is excluded by!**/*.pb.go
chain/insurance/types/insurance.pb.go
is excluded by!**/*.pb.go
chain/insurance/types/tx.pb.go
is excluded by!**/*.pb.go
chain/ocr/types/ocr.pb.go
is excluded by!**/*.pb.go
chain/ocr/types/tx.pb.go
is excluded by!**/*.pb.go
chain/oracle/types/events.pb.go
is excluded by!**/*.pb.go
chain/oracle/types/genesis.pb.go
is excluded by!**/*.pb.go
chain/oracle/types/oracle.pb.go
is excluded by!**/*.pb.go
chain/oracle/types/proposal.pb.go
is excluded by!**/*.pb.go
chain/oracle/types/query.pb.go
is excluded by!**/*.pb.go
chain/oracle/types/tx.pb.go
is excluded by!**/*.pb.go
chain/peggy/types/attestation.pb.go
is excluded by!**/*.pb.go
chain/peggy/types/events.pb.go
is excluded by!**/*.pb.go
chain/peggy/types/msgs.pb.go
is excluded by!**/*.pb.go
chain/peggy/types/params.pb.go
is excluded by!**/*.pb.go
chain/peggy/types/pool.pb.go
is excluded by!**/*.pb.go
chain/peggy/types/types.pb.go
is excluded by!**/*.pb.go
chain/permissions/types/events.pb.go
is excluded by!**/*.pb.go
chain/permissions/types/genesis.pb.go
is excluded by!**/*.pb.go
chain/permissions/types/params.pb.go
is excluded by!**/*.pb.go
chain/permissions/types/permissions.pb.go
is excluded by!**/*.pb.go
chain/permissions/types/query.pb.go
is excluded by!**/*.pb.go
chain/permissions/types/tx.pb.go
is excluded by!**/*.pb.go
chain/stream/types/query.pb.go
is excluded by!**/*.pb.go
chain/tokenfactory/types/genesis.pb.go
is excluded by!**/*.pb.go
chain/tokenfactory/types/gov.pb.go
is excluded by!**/*.pb.go
chain/tokenfactory/types/params.pb.go
is excluded by!**/*.pb.go
chain/tokenfactory/types/tx.pb.go
is excluded by!**/*.pb.go
chain/types/account.pb.go
is excluded by!**/*.pb.go
chain/wasmx/types/proposal.pb.go
is excluded by!**/*.pb.go
chain/wasmx/types/tx.pb.go
is excluded by!**/*.pb.go
chain/wasmx/types/wasmx.pb.go
is excluded by!**/*.pb.go
exchange/accounts_rpc/pb/goadesign_goagen_injective_accounts_rpc.pb.go
is excluded by!**/*.pb.go
exchange/accounts_rpc/pb/goadesign_goagen_injective_accounts_rpc_grpc.pb.go
is excluded by!**/*.pb.go
exchange/accounts_rpc/pb/injective_accounts_rpc.pb.go
is excluded by!**/*.pb.go
exchange/accounts_rpc/pb/injective_accounts_rpc.pb.gw.go
is excluded by!**/*.pb.gw.go
exchange/accounts_rpc/pb/pb/goadesign_goagen_injective_accounts_rpc.pb.go
is excluded by!**/*.pb.go
exchange/accounts_rpc/pb/pb/goadesign_goagen_injective_accounts_rpc_grpc.pb.go
is excluded by!**/*.pb.go
exchange/accounts_rpc/pb/pb/injective_accounts_rpc.pb.gw.go
is excluded by!**/*.pb.gw.go
exchange/auction_rpc/pb/goadesign_goagen_injective_auction_rpc.pb.go
is excluded by!**/*.pb.go
exchange/auction_rpc/pb/goadesign_goagen_injective_auction_rpc_grpc.pb.go
is excluded by!**/*.pb.go
exchange/auction_rpc/pb/injective_auction_rpc.pb.gw.go
is excluded by!**/*.pb.gw.go
exchange/campaign_rpc/pb/goadesign_goagen_injective_campaign_rpc.pb.go
is excluded by!**/*.pb.go
Files selected for processing (71)
- .github/workflows/pre-commit.yml (1 hunks)
- .github/workflows/run-tests.yml (1 hunks)
- .golangci.yml (1 hunks)
- .pre-commit-config.yaml (1 hunks)
- Makefile (4 hunks)
- README.md (1 hunks)
- auth_vote/authz_vote.go (2 hunks)
- chain/auction/types/codec.go (2 hunks)
- chain/auction/types/expected_keepers.go (1 hunks)
- chain/auction/types/key.go (1 hunks)
- chain/auction/types/params.go (5 hunks)
- chain/codec/types/types.go (1 hunks)
- chain/crypto/ethsecp256k1/ethsecp256k1.go (2 hunks)
- chain/exchange/types/authz_common.go (2 hunks)
- chain/exchange/types/authz_derivative.go (6 hunks)
- chain/exchange/types/authz_spot.go (6 hunks)
- chain/exchange/types/codec.go (5 hunks)
- chain/exchange/types/common_order.go (3 hunks)
- chain/exchange/types/common_utils.go (6 hunks)
- chain/exchange/types/deposit.go (3 hunks)
- chain/exchange/types/derivative_orders.go (14 hunks)
- chain/exchange/types/errors.go (2 hunks)
- chain/exchange/types/events.go (1 hunks)
- chain/exchange/types/exchange.go (5 hunks)
- chain/exchange/types/expected_keepers.go (4 hunks)
- chain/exchange/types/fee_discounts.go (4 hunks)
- chain/exchange/types/fee_validation.go (1 hunks)
- chain/exchange/types/key.go (7 hunks)
- chain/exchange/types/market.go (8 hunks)
- chain/exchange/types/market_admin.go (1 hunks)
- chain/exchange/types/msgs.go (23 hunks)
- chain/exchange/types/orderbook.go (4 hunks)
- chain/exchange/types/params.go (19 hunks)
- chain/exchange/types/positions.go (16 hunks)
- chain/exchange/types/proposal.go (35 hunks)
- chain/exchange/types/spot_orders.go (7 hunks)
- chain/exchange/types/stake_grants.go (1 hunks)
- chain/exchange/types/subaccount.go (2 hunks)
- chain/exchange/types/trading_rewards.go (2 hunks)
- chain/exchange/types/volume_record.go (3 hunks)
- chain/exchange/types/wasm_trade_summary.go (1 hunks)
- chain/exchange/types/wasm_trades.go (2 hunks)
- chain/insurance/types/codec.go (2 hunks)
- chain/insurance/types/expected_keepers.go (1 hunks)
- chain/insurance/types/msgs.go (1 hunks)
- chain/insurance/types/params.go (2 hunks)
- chain/ocr/types/codec.go (3 hunks)
- chain/ocr/types/expected_keepers.go (2 hunks)
- chain/ocr/types/hooks.go (2 hunks)
- chain/ocr/types/types.go (1 hunks)
- chain/oracle/bandchain/oracle/types/error.go (1 hunks)
- chain/oracle/types/codec.go (7 hunks)
- chain/oracle/types/errors.go (1 hunks)
- chain/oracle/types/expected_keepers.go (1 hunks)
- chain/oracle/types/key.go (2 hunks)
- chain/oracle/types/msgs.go (5 hunks)
- chain/oracle/types/oracle.go (5 hunks)
- chain/oracle/types/params.go (1 hunks)
- chain/oracle/types/proposal.go (6 hunks)
- chain/oracle/types/pyth.go (3 hunks)
- chain/oracle/types/stork.go (1 hunks)
- chain/oracle/types/stork_oracle.go (1 hunks)
- chain/peggy/types/codec.go (3 hunks)
- chain/peggy/types/ethereum.go (1 hunks)
- chain/peggy/types/expected_keepers.go (2 hunks)
- chain/peggy/types/msgs.go (2 hunks)
- chain/peggy/types/params.go (7 hunks)
- chain/peggy/types/params_legacy.go (2 hunks)
- chain/peggy/types/types.go (1 hunks)
- chain/permissions/types/codec.go (1 hunks)
- chain/permissions/types/errors.go (1 hunks)
Files skipped from review due to trivial changes (3)
- README.md
- chain/ocr/types/types.go
- chain/oracle/bandchain/oracle/types/error.go
Additional comments not posted (341)
.github/workflows/run-tests.yml (1)
16-17
: LGTM!Using a version file and checking for the latest version enhances flexibility and ensures the workflow uses the most current code.
chain/exchange/types/stake_grants.go (2)
8-13
: Function implementation approved.The
NewActiveGrant
function correctly initializes and returns a newActiveGrant
object.
15-21
: Function implementation approved.The
NewEffectiveGrant
function correctly initializes and returns a newEffectiveGrant
object..github/workflows/pre-commit.yml (3)
12-14
: Efficient checkout configuration.The code checks out the master branch with a fetch depth of 2, which is efficient for the workflow.
17-18
: Flexible Go version management.The Go setup step uses a version file (
go.mod
) instead of a hardcoded version number, allowing for more flexibility in managing Go versions.
20-20
: Updated golangci-lint version.The
golangci-lint
tool version has been updated from v1.49.0 to v1.59.0, which may include important bug fixes and improvements.chain/auction/types/expected_keepers.go (5)
11-11
: Standardized context handling forGetAllBalances
.The
GetAllBalances
method now usescontext.Context
for thectx
parameter, aligning with broader Go conventions.
12-12
: Standardized context handling forSendCoinsFromModuleToModule
.The
SendCoinsFromModuleToModule
method now usescontext.Context
for thectx
parameter, aligning with broader Go conventions.
13-13
: Standardized context handling forSendCoinsFromModuleToAccount
.The
SendCoinsFromModuleToAccount
method now usescontext.Context
for thectx
parameter, aligning with broader Go conventions.
14-14
: Standardized context handling forSendCoinsFromAccountToModule
.The
SendCoinsFromAccountToModule
method now usescontext.Context
for thectx
parameter, aligning with broader Go conventions.
15-15
: Standardized context handling forBurnCoins
.The
BurnCoins
method now usescontext.Context
for thectx
parameter, aligning with broader Go conventions.chain/oracle/types/stork.go (2)
27-29
: Verify the definition ofEighteenDecimals
.Ensure that
EighteenDecimals
is correctly defined and used.Verification successful
The definition of
EighteenDecimals
is correct and used appropriately.
EighteenDecimals
is defined asvar EighteenDecimals = math.LegacyNewDec(10).Power(18)
inchain/oracle/types/oracle.go
.- This definition correctly represents 10^18, which is a common scaling factor in financial calculations.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the definition of `EighteenDecimals`. # Test: Search for the definition. Expect: Correct definition and usage. rg --type go 'EighteenDecimals'Length of output: 187
21-25
: Verify error handling inPriceState.UpdatePrice
.Ensure that
PriceState.UpdatePrice
properly handles any potential errors or edge cases.chain/exchange/types/events.go (3)
19-20
: Verify function usage forIsEmpty
.Ensure that all function calls to
IsEmpty
correctly handle the updated logic.
22-32
: Verify function usage forNewEventOrderCancelFail
.Ensure that all function calls to
NewEventOrderCancelFail
correctly handle the new function.Verification successful
No issues found with the function
NewEventOrderCancelFail
.There are no direct calls to this function in the codebase, indicating it is not currently in use. The function itself appears to be correctly implemented.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `NewEventOrderCancelFail` handle the new function. # Test: Search for the function usage. Expect: Correct handling of the new function. rg --type go 'NewEventOrderCancelFail'Length of output: 192
Script:
#!/bin/bash # Description: Verify all references to `EventOrderCancelFail` to ensure there are no indirect usages or references. # Test: Search for references to `EventOrderCancelFail`. Expect: Correct handling of the new function. rg --type go 'EventOrderCancelFail'Length of output: 2931
9-15
: Verify function usage with the new parametercid
.Ensure that all function calls to
AddOrderFail
correctly pass thecid
parameter.chain/insurance/types/expected_keepers.go (6)
16-16
: Verify method usage forSendCoinsFromAccountToModule
.Ensure that all function calls to
SendCoinsFromAccountToModule
correctly handle the updated context type.
17-17
: Verify method usage forMintCoins
.Ensure that all function calls to
MintCoins
correctly handle the updated context type.Verification successful
No direct calls to
MintCoins
were found.Based on the search results, there are no direct calls to
MintCoins
in the codebase. Therefore, no further action is needed to handle the updated context type.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `MintCoins` handle the updated context type. # Test: Search for the method usage. Expect: Correct handling of the updated context type. rg --type go 'MintCoins'Length of output: 733
Script:
#!/bin/bash # Description: Search for actual calls to MintCoins and inspect the context being passed. # Test: Search for all calls to MintCoins and include context lines for better understanding. rg --type go 'MintCoins(' -A 3 -B 3Length of output: 108
Script:
#!/bin/bash # Description: Search for actual calls to MintCoins and inspect the context being passed. # Test: Search for all calls to MintCoins and include context lines for better understanding. rg --type go 'MintCoins\(' -A 3 -B 3Length of output: 3432
Script:
#!/bin/bash # Description: Search for actual calls to MintCoins and inspect the context being passed. # Test: Search for all calls to MintCoins and include more context lines for better understanding. rg --type go 'MintCoins' -A 5 -B 5Length of output: 5524
Script:
#!/bin/bash # Description: Search for all instances of MintCoins being called, including potential indirect calls or usage in different contexts. # Test: Search for all instances of MintCoins being called and include more context lines for better understanding. rg --type go 'MintCoins' -A 10 -B 10Length of output: 8485
12-12
: Verify method usage forGetBalance
.Ensure that all function calls to
GetBalance
correctly handle the updated context type.
19-19
: Verify method usage forSetDenomMetaData
.Ensure that all function calls to
SetDenomMetaData
correctly handle the updated context type.Verification successful
No usages of the
SetDenomMetaData
method were found.The change to the context type does not impact any existing code, as there are no calls to this method in the codebase.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `SetDenomMetaData` handle the updated context type. # Test: Search for the method usage. Expect: Correct handling of the updated context type. rg --type go 'SetDenomMetaData'Length of output: 360
Script:
#!/bin/bash # Description: Find all usages of the `SetDenomMetaData` method and inspect the context type being passed. # Search for all instances where `SetDenomMetaData` is called. rg --type go 'SetDenomMetaData(' -A 3Length of output: 124
Script:
#!/bin/bash # Description: Find all usages of the `SetDenomMetaData` method and inspect the context type being passed. # Search for all instances where `SetDenomMetaData` is called. rg --type go 'SetDenomMetaData\(' -A 3Length of output: 645
Script:
#!/bin/bash # Description: Find all usages of the `SetDenomMetaData` method and inspect the context type being passed. # Search for all instances where `SetDenomMetaData` is called. rg --type go '\.SetDenomMetaData\(' -A 3Length of output: 42
Script:
#!/bin/bash # Description: Find all references to the `SetDenomMetaData` method to ensure correct usage. # Search for any references to `SetDenomMetaData` in the codebase. rg --type go 'SetDenomMetaData'Length of output: 360
18-18
: Verify method usage forBurnCoins
.Ensure that all function calls to
BurnCoins
correctly handle the updated context type.
13-13
: Verify method usage forGetAllBalances
.Ensure that all function calls to
GetAllBalances
correctly handle the updated context type.chain/ocr/types/hooks.go (3)
4-4
: Import Approved.The import statement for
cosmossdk.io/math
is necessary for the usage ofmath.LegacyDec
.
28-28
: Struct Method Signature Change Approved.The
AfterTransmit
method in theMultiOcrHooks
struct has changed the type of theanswer
parameter fromsdk.Dec
tomath.LegacyDec
.Ensure that all calls to this method are updated accordingly.
Verification successful
Struct Method Signature Change Approved.
The
AfterTransmit
method in theMultiOcrHooks
struct has changed the type of theanswer
parameter fromsdk.Dec
tomath.LegacyDec
. The method usage has been updated accordingly in the codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all calls to the `AfterTransmit` method in the `MultiOcrHooks` struct are updated accordingly. # Test: Search for the method calls. Expect: Only occurrences of the new signature. rg --type go -A 5 'AfterTransmit(ctx sdk.Context, feedId string, answer math.LegacyDec, timestamp int64)'Length of output: 107
Script:
#!/bin/bash # Description: Verify all calls to the `AfterTransmit` method in the `MultiOcrHooks` struct are updated accordingly. # Test: Search for the old method signature. rg --type go -A 5 'AfterTransmit(ctx sdk.Context, feedId string, answer sdk.Dec, timestamp int64)' # Test: Search for the new method signature. rg --type go -A 5 'AfterTransmit(ctx sdk.Context, feedId string, answer math.LegacyDec, timestamp int64)'Length of output: 208
Script:
#!/bin/bash # Description: Verify all calls to the `AfterTransmit` method in the `MultiOcrHooks` struct by searching for the method name alone. # Test: Search for the method name `AfterTransmit`. rg --type go 'AfterTransmit'Length of output: 354
10-10
: Interface Method Signature Change Approved.The
AfterTransmit
method in theOcrHooks
interface has changed the type of theanswer
parameter fromsdk.Dec
tomath.LegacyDec
.Ensure that all implementations of this interface are updated accordingly.
Verification successful
Interface Method Signature Change Approved.
The
AfterTransmit
method in theOcrHooks
interface has changed the type of theanswer
parameter fromsdk.Dec
tomath.LegacyDec
. The change has been correctly applied to both the interface definition and its implementation inMultiOcrHooks
.
chain/ocr/types/hooks.go
:AfterTransmit
method updated inOcrHooks
interface andMultiOcrHooks
implementation.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all implementations of the `OcrHooks` interface are updated accordingly. # Test: Search for the interface implementation. Expect: Only occurrences of the new signature. rg --type go -A 5 'AfterTransmit(ctx sdk.Context, feedId string, answer math.LegacyDec, timestamp int64)'Length of output: 107
Script:
#!/bin/bash # Description: Verify all implementations of the `OcrHooks` interface are updated accordingly. # Test: Search for the old interface implementation signature. rg --type go -A 5 'AfterTransmit(ctx sdk.Context, feedId string, answer sdk.Dec, timestamp int64)' # Test: Search for the new interface implementation signature. rg --type go -A 5 'AfterTransmit(ctx sdk.Context, feedId string, answer math.LegacyDec, timestamp int64)'Length of output: 208
Script:
#!/bin/bash # Description: Verify the `OcrHooks` interface definition and any `AfterTransmit` method implementations. # Test: Search for the `OcrHooks` interface definition. rg --type go 'interface OcrHooks' # Test: Search for any `AfterTransmit` method implementations. rg --type go 'AfterTransmit'Length of output: 390
.golangci.yml (4)
28-39
: Revive Linter Settings Approved.The
revive
linter is configured to enable all rules and has a specific rule for variable naming.
40-51
: Gocritic Linter Settings Approved.The
gocritic
linter is configured to enable specific tags and disable thehugeParam
check.
2-4
: Verify Intention Behind Disabling Tests.The
run
settings disable tests. Ensure this is intentional and does not affect the overall testing strategy.
5-26
: Linter Settings Approved.The linter settings enable common and useful linters.
Verify the reason for disabling the
unused
linter.chain/oracle/types/stork_oracle.go (4)
20-22
: Function Approved.The
encodePacked
function concatenates multiple byte slices and seems to be correctly implemented.
14-18
: Function Approved. Verify Hash Generation.The
getMessageHash
function generates a hash from the provided parameters and seems to be correctly implemented.Verify the correctness of the hash generation.
Verification successful
Function Approved.
The
getMessageHash
function generates a hash from the provided parameters and is correctly implemented. TheencodePacked
andencodeUint256
functions are also correctly implemented.
encodePacked
concatenates byte slices.encodeUint256
converts a string to a big-endian 256-bit integer.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of the hash generation in the `getMessageHash` function. # Test: Search for test cases or usage examples. Expect: Correct hash generation. rg --type go -A 5 'getMessageHash'Length of output: 891
Script:
#!/bin/bash # Description: Verify the correctness of the functions used in `getMessageHash`. # Search for the definition of `encodePacked`. rg --type go 'func encodePacked' # Search for the definition of `encodeUint256`. rg --type go 'func encodeUint256' # Search for the usage of `crypto.Keccak256Hash`. rg --type go 'crypto.Keccak256Hash'Length of output: 2290
Script:
#!/bin/bash # Extract the implementation of `encodePacked` function. rg --type go -A 10 'func encodePacked' chain/oracle/types/stork_oracle.go # Extract the implementation of `encodeUint256` function. rg --type go -A 10 'func encodeUint256' chain/oracle/types/stork_oracle.goLength of output: 854
30-39
: Function Approved. Verify Signature Verification.The
VerifyStorkMsgSignature
function verifies a message signature and seems to be correctly implemented.Verify the correctness of the signature verification.
24-28
: Function Approved. Verify Conversion.The
encodeUint256
function converts a string to a big integer and returns its byte representation and seems to be correctly implemented.Verify the correctness of the conversion.
chain/exchange/types/trading_rewards.go (3)
Line range hint
44-44
:
Verify consistency of function calls.Ensure that all calls to
MergeTradingRewardPoints
usemath.LegacyDec
instead ofsdk.Dec
.
26-26
: Verify consistency of method signature change.Ensure that all calls to
AddPointsForAddress
usemath.LegacyDec
instead ofsdk.Dec
.Verification successful
Verify consistency of method signature change.
All calls to
AddPointsForAddress
correctly usemath.LegacyDec
as expected.
TradingRewardPoints
is defined asmap[string]math.LegacyDec
, ensuring that all values passed toAddPointsForAddress
are of the correct type.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all calls to `AddPointsForAddress` use `math.LegacyDec` instead of `sdk.Dec`. # Test: Search for the method usage. Expect: Only occurrences of the new signature. rg --type go -A 5 $'AddPointsForAddress'Length of output: 1025
Script:
#!/bin/bash # Description: Verify the types of variables `k` and `v` used in calls to `AddPointsForAddress`. # Search for the declarations and types of `k` and `v` in the context of their usage. rg --type go -A 10 -B 10 $'for k, v := range' chain/exchange/types/trading_rewards.goLength of output: 429
Script:
#!/bin/bash # Description: Verify the type of `TradingRewardPoints` and its underlying structure. # Search for the definition and structure of `TradingRewardPoints`. rg --type go 'type TradingRewardPoints' -A 10Length of output: 798
6-9
: Verify consistency of type change.Ensure that all instances of
sdk.Dec
used forTradingRewardPoints
are updated tomath.LegacyDec
throughout the codebase.Verification successful
Verify complete replacement of
sdk.Dec
withmath.LegacyDec
.Ensure that there are no remaining instances of
sdk.Dec
in the codebase, particularly in the context ofTradingRewardPoints
.
Re-verify the complete replacement of
sdk.Dec
withmath.LegacyDec
.Ensure that there are no remaining instances of
sdk.Dec
in the codebase.
Type change verified successfully.
All instances of
sdk.Dec
have been replaced withmath.LegacyDec
throughout the codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all instances of `sdk.Dec` used for `TradingRewardPoints` are updated to `math.LegacyDec`. # Test: Search for the type usage. Expect: Only occurrences of the new type. rg --type go -A 5 $'TradingRewardPoints'Length of output: 4071
Script:
#!/bin/bash # Description: Verify that there are no remaining instances of `sdk.Dec` in the codebase. # Test: Search for any usage of `sdk.Dec`. Expect: No occurrences related to `TradingRewardPoints`. rg --type go 'sdk.Dec'Length of output: 22
Script:
#!/bin/bash # Description: Verify that there are no remaining instances of `sdk.Dec` in the codebase. # Test: Search for any usage of `sdk.Dec`. Expect: No occurrences. rg 'sdk.Dec'Length of output: 12
chain/permissions/types/errors.go (1)
1-24
: LGTM!The error definitions are straightforward and follow the standard pattern.
chain/auction/types/codec.go (4)
17-17
: LGTM! TheParams
struct registration is correctly added.The addition of
Params
to the codec registration enhances the codec's capability to handle this type.
36-36
: LGTM! TheModuleCdc
variable redefinition is correct.Redefining
ModuleCdc
to usecodec.NewLegacyAmino()
simplifies the codec initialization.
40-41
: LGTM! Theinit
function updates are correct.The updates correctly reflect the change in
ModuleCdc
initialization.
44-44
: LGTM! TheModuleCdc.Seal()
call is correctly added.Calling
Seal
finalizes the codec, preventing further modifications.chain/exchange/types/volume_record.go (6)
4-4
: LGTM! The import statement formath
is correct.The import is necessary for transitioning to
math.LegacyDec
.
7-9
: LGTM! TheNewVolumeRecord
function signature is correctly updated.The function now accepts
math.LegacyDec
formakerVolume
andtakerVolume
.
15-15
: LGTM! TheNewZeroVolumeRecord
function is correctly updated.The function now uses
math.LegacyZeroDec()
for consistency with the new data type.
20-24
: LGTM! TheAdd
method is correctly updated.The method now uses
math.LegacyZeroDec()
for consistency with the new data type.
Line range hint
48-56
:
LGTM! TheTotal
method is correctly updated.The method now returns
math.LegacyDec
and initializestotalVolume
withmath.LegacyZeroDec()
.
59-63
: LGTM! TheNewVolumeWithSingleType
function is correctly updated.The function now uses
math.LegacyDec
for its volume parameter and adjusts its calls toNewVolumeRecord
accordingly.chain/oracle/types/pyth.go (4)
4-4
: LGTM! The import statement formath
is correct.The import is necessary for transitioning to
math.LegacyDec
.
10-12
: LGTM! TheNewPythPriceState
function signature is correctly updated.The function now accepts
math.LegacyDec
foremaPrice
,emaConf
,conf
, andprice
.
26-28
: LGTM! TheUpdate
method ofPythPriceState
is correctly updated.The method now uses
math.LegacyDec
foremaPrice
,emaConf
,conf
, andprice
.
67-74
: LGTM! TheGetExponentiatedDec
function is correctly updated.The function now returns
math.LegacyDec
and usesmath.LegacyNewDecWithPrec
andmath.LegacyNewDec
.chain/insurance/types/codec.go (3)
19-19
: New registration forParams
structure.The new registration line for the
Params
structure is correctly added.
41-41
: Update to codec initialization.The global variable
ModuleCdc
has been correctly updated to usecodec.NewLegacyAmino()
.
45-47
: Changes toinit
function.The
init
function correctly registers theRegisterLegacyAminoCodec
withModuleCdc
and updates the codec registration process.chain/oracle/types/expected_keepers.go (6)
4-5
: Addition ofcontext
package import.The
context
package has been correctly imported to support the changes in theBankKeeper
interface.
16-16
: Change inGetAllBalances
method signature.The
GetAllBalances
method now correctly acceptscontext.Context
as the first parameter instead ofsdk.Context
.
17-17
: Change inSendCoinsFromModuleToModule
method signature.The
SendCoinsFromModuleToModule
method now correctly acceptscontext.Context
as the first parameter instead ofsdk.Context
.
18-18
: Change inSendCoinsFromModuleToAccount
method signature.The
SendCoinsFromModuleToAccount
method now correctly acceptscontext.Context
as the first parameter instead ofsdk.Context
.
19-19
: Change inSendCoinsFromAccountToModule
method signature.The
SendCoinsFromAccountToModule
method now correctly acceptscontext.Context
as the first parameter instead ofsdk.Context
.
20-20
: Change inBurnCoins
method signature.The
BurnCoins
method now correctly acceptscontext.Context
as the first parameter instead ofsdk.Context
.chain/permissions/types/codec.go (6)
1-10
: Package declaration and import statements.The package declaration and import statements are correctly added.
14-22
: Implementation ofRegisterCodec
function.The
RegisterCodec
function correctly registers several concrete types for thepermissions
module.
24-35
: Implementation ofRegisterInterfaces
function.The
RegisterInterfaces
function correctly registers several implementations for thepermissions
module.
38-40
: Initialization ofModuleCdc
.The global variable
ModuleCdc
is correctly initialized usingcodec.NewLegacyAmino()
.
42-48
: Implementation ofinit
function.The
init
function correctly registers the codec and seals it.
1-49
: New file implementation.The new file is correctly implemented and follows the required standards.
chain/codec/types/types.go (2)
16-21
: LGTM! Struct definition is well-defined.The
EncodingConfig
struct contains appropriately typed fields.
23-38
: LGTM! Function implementation is correct.The
MakeEncodingConfig
function correctly initializes and registers the necessary components.chain/exchange/types/wasm_trades.go (4)
9-12
: LGTM! Struct definition is well-defined.The
PositionTransfer
struct contains appropriately typed fields, and theQuantity
field type change tomath.LegacyDec
is appropriate.
53-58
: LGTM! Struct definition is well-defined.The
SyntheticTrade
struct contains appropriately typed fields, and the field type changes tomath.LegacyDec
are appropriate.
Line range hint
14-22
: LGTM! Method implementation is correct.The
ValidateBasic
method correctly validates theQuantity
field and subaccount IDs.
Line range hint
60-74
: LGTM! Method implementation is correct.The
Validate
method correctly validates theQuantity
,Price
, andMargin
fields.chain/insurance/types/params.go (1)
21-21
: LGTM! Constant definition is appropriate.The
MaxUnderwritingAmount
constant is correctly initialized usingmath.NewIntFromString
.chain/exchange/types/subaccount.go (2)
13-14
: LGTM! But verify the usage ofmath.LegacyZeroDec()
in the codebase.The code changes are approved.
However, ensure that all instances of
sdk.ZeroDec()
have been replaced withmath.LegacyZeroDec()
for consistency.Verification successful
All instances of
sdk.ZeroDec()
have been successfully replaced withmath.LegacyZeroDec()
.The codebase is consistent with the new function usage.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all instances of `sdk.ZeroDec()` have been replaced with `math.LegacyZeroDec()`. # Test: Search for the old function. Expect: No occurrences. rg --type go 'sdk.ZeroDec()' # Test: Search for the new function. Expect: Multiple occurrences. rg --type go 'math.LegacyZeroDec()'Length of output: 5851
29-29
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
NewSubaccountOrder
match the new signature.Verification successful
No issues found with the function usage.
The function
NewSubaccountOrder
is not currently used anywhere in the codebase, so there are no calls that need to be updated to match the new signature.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `NewSubaccountOrder` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go 'NewSubaccountOrder'Length of output: 240
Script:
#!/bin/bash # Description: Verify all function calls to `NewSubaccountOrder` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go 'NewSubaccountOrder('Length of output: 125
Script:
#!/bin/bash # Description: Verify all function calls to `NewSubaccountOrder` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go 'NewSubaccountOrder\('Length of output: 140
Script:
#!/bin/bash # Description: Verify all references to `NewSubaccountOrder` in the codebase. # Test: Search for the function references. Expect: Any references or assignments to `NewSubaccountOrder`. rg --type go 'NewSubaccountOrder'Length of output: 240
chain/exchange/types/fee_validation.go (2)
32-37
: LGTM! But verify the usage ofmath.LegacyDec
in the codebase.The code changes are approved.
However, ensure that all instances of
sdk.Dec
have been replaced withmath.LegacyDec
for consistency.
10-26
: LGTM! But verify the usage ofmath.LegacyDec
in the codebase.The code changes are approved.
However, ensure that all instances of
sdk.Dec
have been replaced withmath.LegacyDec
for consistency.Verification successful
Verification successful!
All instances of
sdk.Dec
have been replaced withmath.LegacyDec
across the codebase, ensuring consistency.
- No occurrences of
sdk.Dec
found.- Multiple occurrences of
math.LegacyDec
found.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all instances of `sdk.Dec` have been replaced with `math.LegacyDec`. # Test: Search for the old type. Expect: No occurrences. rg --type go 'sdk.Dec' # Test: Search for the new type. Expect: Multiple occurrences. rg --type go 'math.LegacyDec'Length of output: 95439
chain/exchange/types/fee_discounts.go (2)
47-48
: LGTM! But verify the usage ofmath.Int
andmath.LegacyDec
in the codebase.The code changes are approved.
However, ensure that all instances of
sdkmath.Int
andsdk.Dec
have been replaced withmath.Int
andmath.LegacyDec
for consistency.
63-64
: LGTM! But verify the usage ofmath.LegacyDec
in the codebase.The code changes are approved.
However, ensure that all instances of
sdk.Dec
have been replaced withmath.LegacyDec
for consistency.chain/oracle/types/params.go (1)
14-14
: Verify the compatibility and impact of usingmath.LegacyMustNewDecFromStr
.The initialization of
LargestDecPrice
has been changed fromsdk.MustNewDecFromStr
tomath.LegacyMustNewDecFromStr
. Ensure that this change is compatible with the rest of the codebase and that it does not introduce any unintended side effects.Verification successful
The change to use
math.LegacyMustNewDecFromStr
is compatible with the rest of the codebase.The initialization of
LargestDecPrice
usingmath.LegacyMustNewDecFromStr
is consistent with its usage in the codebase and does not introduce any unintended side effects.
- The
LargestDecPrice
is used inchain/oracle/types/msgs.go
for comparisons, which is compatible with the new initialization method.- The
math.LegacyMustNewDecFromStr
function is widely used across the codebase, indicating its reliability and integration.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage and compatibility of `math.LegacyMustNewDecFromStr` in the codebase. # Test: Search for the usage of `LargestDecPrice` and `math.LegacyMustNewDecFromStr`. Expect: Ensure compatibility and no unintended side effects. rg --type go 'LargestDecPrice' rg --type go 'math.LegacyMustNewDecFromStr'Length of output: 6017
auth_vote/authz_vote.go (1)
72-72
: LGTM! Ensuresmsgs
starts as an empty slice.The change from
var msgs []sdk.Msg
tovar msgs = make([]sdk.Msg, 0)
ensures thatmsgs
starts as an empty slice, preventing potential nil slice issues when appending messages.chain/ocr/types/codec.go (3)
28-29
: LGTM! Registers the new concrete typeParams
.The registration of the new concrete type
Params
with the legacy Amino codec enhances the functionality of the module by allowing it to handle this new type.
61-61
: LGTM! Simplifies codec initialization.The initialization of
ModuleCdc
has been updated to usecodec.NewLegacyAmino()
directly, simplifying the codec initialization process and ensuring consistent usage throughout the module.
65-71
: LGTM! Ensures correct registration of codecs.The modifications in the
init
function ensure that the legacy Amino codec and the crypto codec are registered correctly. The commented-out lines suggest a potential refactor or shift in dependency management.chain/auction/types/params.go (4)
6-6
: LGTM!The import statement changes are consistent with the transition to the new math library.
17-17
: LGTM!The default value changes align with the new decimal type.
34-34
: LGTM!The function parameter changes are consistent with the transition to the new math library's types.
Line range hint
85-98
:
LGTM!The validation logic changes ensure consistency with the new decimal type.
chain/exchange/types/deposit.go (7)
14-15
: LGTM!The constructor updates reflect the shift in the underlying mathematical representation used for balance calculations.
28-29
: LGTM!The data structure modifications are consistent with the transition to the new decimal type.
32-32
: LGTM!The constructor updates for
DepositDelta
align with the new data structure definition.
40-40
: LGTM!The constructor updates for
NewDepositDelta
are consistent with the transition to the new decimal type.
43-43
: LGTM!The method adjustments for
AddAvailableBalance
ensure consistency with the new decimal type.
77-77
: LGTM!The method adjustments for
ApplyUniformDelta
ensure consistency with the new decimal type.
81-81
: LGTM!The method adjustments for
ApplyDelta
ensure consistency with the new decimal type.chain/peggy/types/expected_keepers.go (5)
4-4
: LGTM!The import statement changes are consistent with the transition to using
context.Context
.
18-31
: LGTM!The method signature changes for
StakingKeeper
enhance error handling and context management.
36-43
: LGTM!The method signature changes for
BankKeeper
enhance context management.
47-47
: LGTM!The method signature changes for
SlashingKeeper
enhance error handling.
51-53
: LGTM!The method signature changes for
DistributionKeeper
enhance context management.chain/exchange/types/market_admin.go (5)
14-14
: LGTM!The
MaxPerm
constant is correctly defined as a bitwise OR of all permission flags.
16-16
: LGTM!The
MarketAdminPermissions
type definition is appropriate for representing permission flags.
18-20
: LGTM!The
HasPerm
function is correctly implemented for checking permission flags.
70-75
: LGTM!The
EmptyAdminInfo
function is correctly implemented to return an emptyAdminInfo
struct.
22-40
: Fix typographical errors in constant names.The function uses constants
InitialMarginRationPerm
andMaintenanceMarginRationPerm
which have typographical errors. They should beInitialMarginRatioPerm
andMaintenanceMarginRatioPerm
.- if msg.HasInitialMarginRatioUpdate() && !p.HasPerm(InitialMarginRationPerm) { + if msg.HasInitialMarginRatioUpdate() && !p.HasPerm(InitialMarginRatioPerm) { - if msg.HasMaintenanceMarginRatioUpdate() && !p.HasPerm(MaintenanceMarginRationPerm) { + if msg.HasMaintenanceMarginRatioUpdate() && !p.HasPerm(MaintenanceMarginRatioPerm) {Likely invalid or redundant comment.
chain/peggy/types/codec.go (2)
38-39
: LGTM!The
RegisterInterfaces
andRegisterLegacyAminoCodec
functions are correctly implemented to register the necessary interfaces and codecs. The new message typesMsgBlacklistEthereumAddresses
andMsgRevokeEthereumBlacklist
are correctly registered.Also applies to: 74-75
18-20
: Verify the necessity of commented-out codec registrations.The
govcdc.Amino
andgroupcdc.Amino
codec registrations are commented out with a TODO comment. Verify if these registrations are no longer necessary or if they need to be included.Verification successful
The commented-out codec registrations for
govcdc.Amino
andgroupcdc.Amino
are not necessary.The search results show that
govcdc
andgroupcdc
are only referenced in commented-out lines for registering legacy Amino codecs, with no active dependencies or usage in the codebase.
chain/wasmx/types/codec.go
chain/oracle/types/codec.go
chain/peggy/types/codec.go
chain/ocr/types/codec.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the necessity of commented-out codec registrations. # Test: Search for the usage of `govcdc.Amino` and `groupcdc.Amino` in the codebase. Expect: No usage if they are no longer necessary. rg --type go 'govcdc\.Amino|groupcdc\.Amino'Length of output: 612
Script:
#!/bin/bash # Description: Search for any dependencies or references to `govcdc.Amino` and `groupcdc.Amino` beyond the commented-out lines. # Test: Search for any usage of `govcdc` and `groupcdc` in the codebase to check for potential dependencies. rg --type go 'govcdc|groupcdc'Length of output: 598
chain/oracle/types/oracle.go (8)
17-17
: LGTM!The
MaxStorkTimestampIntervalNano
constant is correctly defined to represent a 500-millisecond interval.
19-19
: LGTM!The
EighteenDecimals
variable is correctly defined to represent 10^18.
38-39
: LGTM!The
GetOracleType
function is correctly updated to include the new oracle type "stork".
55-58
: LGTM!The
GetDecPrice
function is correctly updated to usemath.LegacyDec
for price calculations.
61-64
: LGTM!The
NewPriceState
function is correctly updated to usemath.LegacyDec
for price state initialization.
69-72
: LGTM!The
NewProviderPriceState
function is correctly updated to usemath.LegacyDec
for provider price state initialization.
76-77
: LGTM!The
UpdatePrice
function is correctly updated to usemath.LegacyDec
for price updates.
113-114
: LGTM!The
CheckPriceFeedThreshold
function is correctly updated to usemath.LegacyDec
for price threshold checks.chain/exchange/types/wasm_trade_summary.go (2)
13-17
: Verify the usage ofMarketSummary
fields in the codebase.The fields of the
MarketSummary
struct have been changed fromsdk.Dec
tomath.LegacyDec
. Ensure that all necessary changes have been made to accommodate this new type throughout the codebase.
22-26
: Verify the initialization ofMarketSummary
fields in the codebase.The initialization of
MarketSummary
fields has been changed fromsdk.ZeroDec()
tomath.LegacyZeroDec()
. Ensure that all necessary changes have been made to accommodate this new type throughout the codebase.Verification successful
The initialization of
MarketSummary
fields has been correctly updated to usemath.LegacyZeroDec()
throughout the codebase.The search results confirm that
math.LegacyZeroDec()
is being used consistently, and no occurrences ofsdk.ZeroDec()
were found. The necessary changes have been made to accommodate the new type.
- chain/auction/types/params.go
- chain/oracle/types/oracle.go
- chain/exchange/types/fee_discounts.go
- chain/exchange/types/volume_record.go
- chain/exchange/types/wasm_trade_summary.go
- chain/exchange/types/subaccount.go
- chain/exchange/types/spot_orders.go
- chain/exchange/types/proposal.go
- chain/exchange/types/orderbook.go
- chain/exchange/types/positions.go
- chain/exchange/types/deposit.go
- chain/exchange/types/derivative_orders.go
- chain/exchange/types/common_utils.go
- chain/exchange/types/common_order.go
- chain/exchange/types/msgs.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the initialization of `MarketSummary` fields in the codebase. # Test: Search for the initialization of `MarketSummary` fields. Expect: No occurrences of `sdk.ZeroDec()` for these fields. rg --type go -A 5 $'math.LegacyZeroDec()'Length of output: 19509
chain/exchange/types/orderbook.go (4)
48-48
: Verify the initialization oflowestSellPrice
.The initialization of
lowestSellPrice
has been changed fromsdk.ZeroDec()
tomath.LegacyZeroDec()
. Ensure that all necessary changes have been made to accommodate this new type throughout the codebase.Verification successful
Initialization of
lowestSellPrice
verified.The initialization of
lowestSellPrice
has been correctly updated fromsdk.ZeroDec()
tomath.LegacyZeroDec()
throughout the codebase.
- Instances of
math.LegacyZeroDec()
found in relevant files, ensuring consistency.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the initialization of `lowestSellPrice` in the codebase. # Test: Search for the initialization of `lowestSellPrice`. Expect: No occurrences of `sdk.ZeroDec()` for this variable. rg --type go -A 5 $'math.LegacyZeroDec()'Length of output: 19509
151-155
: Verify the usage ofGetPrice
andGetQuantity
methods.The return types of
GetPrice
andGetQuantity
methods have been updated to returnmath.LegacyDec
instead ofsdk.Dec
. Ensure that all necessary changes have been made to accommodate this new type throughout the codebase.
144-144
: Verify the usage ofNewLevel
.The function signature has been updated to accept parameters of type
math.LegacyDec
instead ofsdk.Dec
. Ensure that all necessary changes have been made to accommodate this new type throughout the codebase.
129-129
: Verify the usage ofgetReadableDec
.The function signature has been updated to accept a parameter of type
math.LegacyDec
instead ofsdk.Dec
. Ensure that all necessary changes have been made to accommodate this new type throughout the codebase.Verification successful
Verify the types of variables passed to
getReadableDec
.Ensure that the variables
buyLevelsSorted[idx].P
,buyLevelsSorted[idx].Q
,sellLevelsSorted[idx].P
,d.AvailableBalance
, andd.TotalBalance
are of typemath.LegacyDec
.
Verify the definition of the
Level
struct to ensureP
andQ
are of typemath.LegacyDec
.
Verified the usage of
getReadableDec
.The function
getReadableDec
has been correctly updated to usemath.LegacyDec
. All instances where this function is called are passing variables of typemath.LegacyDec
, ensuring consistency throughout the codebase.
buyLevelsSorted[idx].P
andbuyLevelsSorted[idx].Q
are of typemath.LegacyDec
.sellLevelsSorted[idx].P
andsellLevelsSorted[idx].Q
are of typemath.LegacyDec
.d.AvailableBalance
andd.TotalBalance
are of typemath.LegacyDec
.No further changes are necessary.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `getReadableDec` in the codebase. # Test: Search for the usage of `getReadableDec`. Expect: No occurrences of `sdk.Dec` type for this function. rg --type go -A 5 $'getReadableDec'Length of output: 1676
Script:
#!/bin/bash # Verify the types of variables passed to `getReadableDec`. # Check the type of `buyLevelsSorted[idx].P` and `buyLevelsSorted[idx].Q` in `orderbook.go` rg --type go 'buyLevelsSorted' -A 10 chain/exchange/types/orderbook.go # Check the type of `sellLevelsSorted[idx].P` and `sellLevelsSorted[idx].Q` in `orderbook.go` rg --type go 'sellLevelsSorted' -A 10 chain/exchange/types/orderbook.go # Check the type of `d.AvailableBalance` and `d.TotalBalance` in `deposit.go` rg --type go 'AvailableBalance' -A 10 chain/exchange/types/deposit.goLength of output: 5064
Script:
#!/bin/bash # Verify the definition of the `Level` struct to ensure `P` and `Q` are of type `math.LegacyDec`. # Search for the definition of the `Level` struct in the codebase. rg --type go 'type Level struct' -A 10Length of output: 917
chain/oracle/types/errors.go (4)
47-47
: LGTM!The addition of
ErrBadStorkMessageTimestamp
enhances error handling for Stork messages.
48-48
: LGTM!The addition of
ErrEmptyStorkSender
enhances error handling for Stork messages.
49-49
: LGTM!The addition of
ErrInvalidStorkSignature
enhances error handling for Stork messages.
50-50
: LGTM!The addition of
ErrStorkAssetIdNotUnique
enhances error handling for Stork messages.chain/oracle/types/codec.go (7)
24-24
: Register new message typeMsgRelayStorkPrices
.The new message type
MsgRelayStorkPrices
has been registered correctly.
36-37
: Register new proposal typesGrantStorkPublisherPrivilegeProposal
andRevokeStorkPublisherPrivilegeProposal
.The new proposal types
GrantStorkPublisherPrivilegeProposal
andRevokeStorkPublisherPrivilegeProposal
have been registered correctly.
38-38
: Register new structParams
.The new struct
Params
has been registered correctly.
49-49
: Register new message typeMsgRelayStorkPrices
.The new message type
MsgRelayStorkPrices
has been registered correctly.
63-64
: Register new proposal typesGrantStorkPublisherPrivilegeProposal
andRevokeStorkPublisherPrivilegeProposal
.The new proposal types
GrantStorkPublisherPrivilegeProposal
andRevokeStorkPublisherPrivilegeProposal
have been registered correctly.
90-92
: Verify the TODO comment.The TODO comment indicates a need to check the commented-out lines. Ensure that these lines are addressed in future changes.
81-81
: Verify compatibility of the new interface registry.The
ModuleCdc
variable now usesinjcodectypes.NewInterfaceRegistry()
. Ensure that this change is compatible with the rest of the codebase.chain/exchange/types/expected_keepers.go (10)
4-4
: Importcontext
package.The
context
package has been imported correctly.
32-32
: Add new methodGetPricePairState
.The new method
GetPricePairState
has been added correctly.
31-31
: Update return type ofGetPrice
method.The return type of the
GetPrice
method has been updated to*sdkmath.LegacyDec
. Ensure that this change is compatible with the rest of the codebase.
58-58
: Update context parameter type ofGetParams
method.The context parameter type of the
GetParams
method has been updated tocontext.Context
. Ensure that this change is compatible with the rest of the codebase.
36-36
: Update return type ofGetStandardDeviationForPriceRecords
method.The return type of the
GetStandardDeviationForPriceRecords
method has been updated to*sdkmath.LegacyDec
. Ensure that this change is compatible with the rest of the codebase.Verification successful
No compatibility issues found with the updated return type of
GetStandardDeviationForPriceRecords
.
- The method
GetStandardDeviationForPriceRecords
is only defined and not used elsewhere in the codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the compatibility of the updated return type. # Test: Search for the usage of `GetStandardDeviationForPriceRecords`. Expect: No compatibility issues. rg --type go -A 5 $'GetStandardDeviationForPriceRecords'Length of output: 654
Script:
#!/bin/bash # Description: Search for all occurrences of the `GetStandardDeviationForPriceRecords` method in the codebase to verify its usage and ensure compatibility. # Test: Search for the usage of `GetStandardDeviationForPriceRecords`. Expect: No compatibility issues. rg 'GetStandardDeviationForPriceRecords'Length of output: 178
33-33
: Update return type ofGetCumulativePrice
method.The return type of the
GetCumulativePrice
method has been updated to*sdkmath.LegacyDec
. Ensure that this change is compatible with the rest of the codebase.Verification successful
No compatibility issues found with the updated return type of
GetCumulativePrice
method.
- The method
GetCumulativePrice
inchain/exchange/types/expected_keepers.go
is not referenced elsewhere in the codebase, ensuring that the change in its return type to*sdkmath.LegacyDec
does not affect other parts of the code.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the compatibility of the updated return type. # Test: Search for the usage of `GetCumulativePrice`. Expect: No compatibility issues. rg --type go -A 5 $'GetCumulativePrice'Length of output: 1683
Script:
#!/bin/bash # Description: Verify the compatibility of the updated return type by searching for all usages of `GetCumulativePrice`. # Test: Search for all usages of `GetCumulativePrice` in the codebase to ensure compatibility. rg --type go 'GetCumulativePrice'Length of output: 348
57-57
: Update context parameter type ofIterateActiveProposalsQueue
method.The context parameter type of the
IterateActiveProposalsQueue
method has been updated tocontext.Context
. Ensure that this change is compatible with the rest of the codebase.Verification successful
No compatibility issues found with the updated context parameter type of
IterateActiveProposalsQueue
method.The method
IterateActiveProposalsQueue
is not used elsewhere in the codebase, indicating that the change to the context parameter type does not introduce any compatibility issues.
chain/exchange/types/expected_keepers.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the compatibility of the updated context parameter type. # Test: Search for the usage of `IterateActiveProposalsQueue`. Expect: No compatibility issues. rg --type go -A 5 $'IterateActiveProposalsQueue'Length of output: 539
Script:
#!/bin/bash # Description: Search for all occurrences of `IterateActiveProposalsQueue` in the codebase to verify compatibility. # Test: Find all usages of `IterateActiveProposalsQueue`. Expect: No compatibility issues. rg 'IterateActiveProposalsQueue' --type goLength of output: 195
Script:
#!/bin/bash # Description: Search for all interfaces and implementations that might include or call `IterateActiveProposalsQueue`. # Test: Find all interfaces and implementations that might include or call `IterateActiveProposalsQueue`. Expect: No compatibility issues. rg 'IterateActiveProposalsQueue' --type goLength of output: 195
68-68
: Update return type and context parameter type ofGetDelegatorDelegations
method.The
GetDelegatorDelegations
method now returns an additionalerror
type and usescontext.Context
. Ensure that this change is compatible with the rest of the codebase.Verification successful
Update return type and context parameter type of
GetDelegatorDelegations
method.The
GetDelegatorDelegations
method now returns an additionalerror
type and usescontext.Context
. Based on the comprehensive search, there are no compatibility issues found in the codebase.
- No usage instances of
GetDelegatorDelegations
were found.- No references to the
StakingKeeper
interface were found that could indirectly use this method.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the compatibility of the updated return type and context parameter type. # Test: Search for the usage of `GetDelegatorDelegations`. Expect: No compatibility issues. rg --type go -A 5 $'GetDelegatorDelegations'Length of output: 616
Script:
#!/bin/bash # Description: Perform a comprehensive search for the usage of `GetDelegatorDelegations` to ensure compatibility. # Search for the usage of `GetDelegatorDelegations` across the entire codebase. rg 'GetDelegatorDelegations' --type go -A 10Length of output: 895
Script:
#!/bin/bash # Description: Search for references to the `StakingKeeper` interface to ensure there are no indirect usages of the `GetDelegatorDelegations` method. # Search for references to the `StakingKeeper` interface across the entire codebase. rg 'StakingKeeper' --type go -A 10Length of output: 2391
38-38
: Update return type ofGetProviderPrice
method.The return type of the
GetProviderPrice
method has been updated to*sdkmath.LegacyDec
. Ensure that this change is compatible with the rest of the codebase.
69-69
: Update return type and context parameter type ofValidator
method.The
Validator
method now returns an additionalerror
type and usescontext.Context
. Ensure that this change is compatible with the rest of the codebase.Makefile (6)
5-5
: Create new directoryexchange/health_rpc
.The new directory
exchange/health_rpc
has been created correctly.
19-20
: Copy additional files toexchange/health_rpc
andexchange/accounts_rpc
.The additional files have been copied correctly.
39-40
: Copy additional files tochain/codec/types
.The additional files have been copied correctly.
54-55
: Copy additional files tochain/permissions/types
.The additional files have been copied correctly.
58-59
: Copy additional files tochain/wasmx/types
.The additional files have been copied correctly.
61-63
: Copy additional files tochain/stream/types
andchain/types
.The additional files have been copied correctly.
chain/exchange/types/authz_common.go (1)
44-44
: LGTM! But verify the function usage in the codebase.The change to use
context.Context
instead ofsdk.Context
is approved.However, ensure that all function calls to
BatchUpdateOrdersAuthz.Accept
match the new signature.chain/peggy/types/ethereum.go (1)
65-65
: LGTM! But verify the function usage in the codebase.The change to use
math.NewIntFromUint64
instead ofsdk.NewIntFromUint64
is approved.However, ensure that all function calls to
NewERC20Token
are compatible with the new implementation.Verification successful
The function usage is compatible with the new implementation.
The
NewERC20Token
function is correctly utilizingmath.NewIntFromUint64
within the filechain/peggy/types/ethereum.go
. No issues were found with its usage in the codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `NewERC20Token` are compatible with the new implementation. # Test: Search for the function usage. Expect: Only occurrences of the new implementation. rg --type go -A 5 $'NewERC20Token'Length of output: 750
chain/exchange/types/common_order.go (3)
16-29
: LGTM! But verify the function usage in the codebase.The change to use
math.LegacyDec
instead ofsdk.Dec
for theprice
andquantity
parameters and return type is approved.However, ensure that all function calls to
GetRequiredBinaryOptionsOrderMargin
are compatible with the new implementation.Verification successful
Verified: Function usage is compatible with the new implementation.
The
price
andquantity
variables passed toGetRequiredBinaryOptionsOrderMargin
are correctly typed asmath.LegacyDec
in thechain/exchange/types/msgs.go
file. No further changes are necessary.
chain/exchange/types/msgs.go
:
price
andquantity
are declared asmath.LegacyDec
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `GetRequiredBinaryOptionsOrderMargin` are compatible with the new implementation. # Test: Search for the function usage. Expect: Only occurrences of the new implementation. rg --type go -A 5 $'GetRequiredBinaryOptionsOrderMargin'Length of output: 1435
Script:
#!/bin/bash # Description: Verify the types of `price` and `quantity` arguments passed to `GetRequiredBinaryOptionsOrderMargin` in `chain/exchange/types/msgs.go`. # Search for the declarations of `price` and `quantity` in the `chain/exchange/types/msgs.go` file. rg --type go -A 5 'price' chain/exchange/types/msgs.go rg --type go -A 5 'quantity' chain/exchange/types/msgs.goLength of output: 4128
75-75
: LGTM! But verify the function usage in the codebase.The change to use
math.LegacyDec
instead ofsdk.Dec
for thefee
parameter and return type is approved.However, ensure that all function calls to
GetFeeAmount
are compatible with the new implementation.Verification successful
Function usage verified!
The function calls to
GetFeeAmount
inspot_orders.go
are compatible with the new implementation usingmath.LegacyDec
.
market.MakerFeeRate
andmarket.TakerFeeRate
are of typemath.LegacyDec
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `GetFeeAmount` are compatible with the new implementation. # Test: Search for the function usage. Expect: Only occurrences of the new implementation. rg --type go -A 5 $'GetFeeAmount'Length of output: 1321
Script:
#!/bin/bash # Description: Verify the types of `market.MakerFeeRate` and `market.TakerFeeRate` to ensure compatibility with `math.LegacyDec`. # Search for the declarations of `market.MakerFeeRate` and `market.TakerFeeRate`. rg --type go 'MakerFeeRate|TakerFeeRate'Length of output: 36847
71-71
: LGTM! But verify the function usage in the codebase.The change to use
math.LegacyDec
instead ofsdk.Dec
for the return type is approved.However, ensure that all function calls to
GetNotional
are compatible with the new implementation.chain/oracle/types/key.go (2)
62-64
: LGTM!The constants
StorkPriceKey
andStorkPublisherKey
are defined correctly.
116-118
: LGTM!The function
GetStorkPriceStoreKey
is implemented correctly and follows the existing pattern.chain/exchange/types/exchange.go (13)
6-6
: LGTM!The import of
math
fromcosmossdk.io
is necessary for the changes in data types.
19-19
: LGTM!The change of
MarkPrice
tomath.LegacyDec
ensures consistency in handling decimal values.
49-49
: LGTM!The change of
Points
tomath.LegacyDec
ensures consistency in handling decimal values.
Line range hint
52-56
:
LGTM!The change of the return type of
GetMultiplier
tomath.LegacyDec
ensures consistency in handling decimal values.
61-63
: LGTM!The change of the return types of
GetPrice
,GetQuantity
, andGetFillable
tomath.LegacyDec
ensures consistency in handling decimal values.
71-71
: LGTM!The change of the return type of
GetMargin
tomath.LegacyDec
ensures consistency in handling decimal values.
78-80
: LGTM!The change of the parameter types of
SetPrice
,SetQuantity
, andSetMargin
tomath.LegacyDec
ensures consistency in handling decimal values.
85-111
: LGTM!The changes to the methods of
DerivativeOrder
ensure consistency in handling decimal values by usingmath.LegacyDec
.
117-144
: LGTM!The changes to the methods of
DerivativeLimitOrder
ensure consistency in handling decimal values by usingmath.LegacyDec
.
150-174
: LGTM!The changes to the methods of
DerivativeMarketOrder
ensure consistency in handling decimal values by usingmath.LegacyDec
.
184-194
: LGTM!The changes to the methods of
SpotOrder
ensure consistency in handling decimal values by usingmath.LegacyDec
.
187-197
: LGTM!The changes to the methods of
SpotLimitOrder
ensure consistency in handling decimal values by usingmath.LegacyDec
.
190-210
: LGTM!The changes to the methods of
SpotMarketOrder
ensure consistency in handling decimal values by usingmath.LegacyDec
.chain/crypto/ethsecp256k1/ethsecp256k1.go (2)
10-15
: LGTM!The reorganization of imports enhances readability and does not affect functionality.
198-198
: LGTM!The change to directly truncate the signature to the first 64 bytes simplifies the logic and ensures only the R and S components are retained.
chain/peggy/types/params_legacy.go (1)
106-106
: EnsurevalidateAdmins
function is implemented correctly.The new parameter
ParamStoreAdmins
is integrated correctly in theParamSetPairs
method. However, ensure that thevalidateAdmins
function is implemented correctly to validate the admin-related settings.Verification successful
The
validateAdmins
function is implemented correctly.The
validateAdmins
function is found in bothchain/peggy/types/params.go
andchain/exchange/types/params.go
. It correctly validates the admin addresses by ensuring the input is a slice of strings and converting each string to an address, handling errors appropriately.
chain/peggy/types/params.go
chain/exchange/types/params.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation of the validateAdmins function. # Test: Search for the implementation of the validateAdmins function. Expect: The function should be implemented correctly. rg --type go 'func validateAdmins' -A 10Length of output: 1230
chain/insurance/types/msgs.go (1)
64-65
: Validation logic forTicker
field updated correctly.The updated validation logic for the
Ticker
field is correct, allowing a maximum length of 40 characters. The error message is clear and reflects the new validation rule.chain/exchange/types/authz_spot.go (5)
4-4
: Import ofcontext
package is necessary and correctly placed.The import of the
context
package is necessary to support the changes in the method signatures and is correctly placed.
24-24
: Context type change inAccept
method ofCreateSpotLimitOrderAuthz
is appropriate.The change from
sdk.Context
tocontext.Context
is consistent with the context management approach and does not affect the method logic.
64-64
: Context type change inAccept
method ofCreateSpotMarketOrderAuthz
is appropriate.The change from
sdk.Context
tocontext.Context
is consistent with the context management approach and does not affect the method logic.
104-104
: Context type change inAccept
method ofBatchCreateSpotLimitOrdersAuthz
is appropriate.The change from
sdk.Context
tocontext.Context
is consistent with the context management approach and does not affect the method logic.
146-146
: Context type change inAccept
methods ofCancelSpotOrderAuthz
andBatchCancelSpotOrdersAuthz
is appropriate.The change from
sdk.Context
tocontext.Context
is consistent with the context management approach and does not affect the method logic.Also applies to: 186-186
chain/exchange/types/authz_derivative.go (5)
Line range hint
24-34
:
LGTM! The context parameter type change is appropriate.The change from
sdk.Context
tocontext.Context
aligns with Go's standard practices for context handling.
Line range hint
64-74
:
LGTM! The context parameter type change is appropriate.The change from
sdk.Context
tocontext.Context
aligns with Go's standard practices for context handling.
Line range hint
104-116
:
LGTM! The context parameter type change is appropriate.The change from
sdk.Context
tocontext.Context
aligns with Go's standard practices for context handling.
Line range hint
146-156
:
LGTM! The context parameter type change is appropriate.The change from
sdk.Context
tocontext.Context
aligns with Go's standard practices for context handling.
Line range hint
186-198
:
LGTM! The context parameter type change is appropriate.The change from
sdk.Context
tocontext.Context
aligns with Go's standard practices for context handling.chain/exchange/types/spot_orders.go (8)
Line range hint
15-23
:
LGTM!The function signature has been correctly updated to use
math.LegacyDec
forbalanceHold
.
Line range hint
89-97
:
LGTM!The function signature has been correctly updated to use
math.LegacyDec
forminPriceTickSize
andminQuantityTickSize
.
99-105
: LGTM!The new function
CheckNotional
correctly calculates the order's notional value and checks it against a minimum notional requirement.
139-140
: LGTM!The function signature has been correctly updated to return
math.LegacyDec
.
142-144
: LGTM!The function signature has been correctly updated to use
math.LegacyDec
forfee
and returnmath.LegacyDec
.
Line range hint
146-166
:
LGTM!The function signature has been correctly updated to return
balanceHold
asmath.LegacyDec
.
Line range hint
168-184
:
LGTM!The function signature has been correctly updated to return
balanceHold
asmath.LegacyDec
.
203-213
: LGTM!The function signature has been correctly updated to use
math.LegacyDec
forfeeRate
andbestPrice
, and returnmath.LegacyDec
.chain/peggy/types/params.go (3)
28-36
: LGTM!The function has been correctly updated to use
math.LegacyNewDec
for slashing fractions and the addition of theAdmins
parameter is correctly handled.
102-104
: LGTM!The function has been correctly updated to include validation for the
Admins
parameter.
301-322
: LGTM!The new function
validateAdmins
correctly validates theAdmins
parameter, ensuring that admin addresses are unique and correctly formatted.chain/exchange/types/common_utils.go (12)
41-42
: LGTM!The
FillQuantity
field has been correctly updated to usemath.LegacyDec
.
46-47
: LGTM!The
FillQuantity
andCancelQuantity
fields have been correctly updated to usemath.LegacyDec
.
52-53
: LGTM!The
FillQuantity
field has been correctly updated to usemath.LegacyDec
.
55-57
: LGTM!The function signature has been correctly updated to return
math.LegacyDec
.
67-68
: LGTM!The function signature has been correctly updated to return
math.LegacyDec
.
71-73
: LGTM!The function signature has been correctly updated to return
math.LegacyDec
.
Line range hint
170-181
:
LGTM!The function signature has been correctly updated to use
math.LegacyDec
forvalue
andminTickSize
.
305-306
: LGTM!The function signature has been correctly updated to use
math.LegacyDec
fordec
.
309-314
: LGTM!The function signature has been correctly updated to return
math.LegacyDec
.
317-319
: LGTM!The new function
IntToIntBytes
correctly convertsmath.Int
to byte array.
321-323
: LGTM!The new function
IntBytesToInt
correctly converts byte array tomath.Int
.
167-168
: LGTM!The function has been correctly updated to use the new regex variable
hexRegex
.chain/exchange/types/codec.go (4)
47-48
: New message types registered.The new message types
MsgUpdateSpotMarket
andMsgUpdateDerivativeMarket
are correctly registered.
180-180
: Simplified codec initialization.The initialization of
ModuleCdc
usingcodec.NewLegacyAmino()
is correct and simplifies the code.
184-185
: Updated codec registration ininit
function.The
RegisterLegacyAminoCodec
function is correctly called withModuleCdc
, following the new initialization method.
188-188
: Codec sealing.The
ModuleCdc.Seal()
method is correctly called to seal the codec.chain/exchange/types/errors.go (2)
33-33
: Renamed error variable.The error variable
ErrInsufficientOrderMargin
is correctly renamed toErrInsufficientMargin
.
107-111
: New error variables added.The new error variables
ErrInvalidNotional
,ErrStaleOraclePrice
,ErrInvalidStakeGrant
,ErrInsufficientStake
, andErrInvalidPermissions
are correctly defined.chain/oracle/types/msgs.go (7)
26-26
: New message type added.The new message type
MsgRelayStorkPrices
is correctly defined.
321-321
: Route method added.The
Route
method forMsgRelayStorkPrices
is correctly implemented.
324-324
: Type method added.The
Type
method forMsgRelayStorkPrices
is correctly implemented.
327-365
: ValidateBasic method added.The
ValidateBasic
method forMsgRelayStorkPrices
is correctly implemented and includes robust validation logic.
369-371
: GetSignBytes method added.The
GetSignBytes
method forMsgRelayStorkPrices
is correctly implemented.
374-379
: GetSigners method added.The
GetSigners
method forMsgRelayStorkPrices
is correctly implemented.
387-401
: Utility function added.The utility function
ConvertTimestampToNanoSecond
is correctly implemented and follows best practices.chain/exchange/types/positions.go (23)
8-9
: LGTM! Transition tomath.LegacyDec
.The changes to the
positionPayout
struct fieldsPayout
andPnlNotional
are approved.
36-43
: LGTM! Transition tomath.LegacyDec
.The changes to the
NewPosition
function parameters and internal logic are approved.
Line range hint
51-55
:
LGTM! Transition tomath.LegacyDec
.The changes to the
GetEffectiveMarginRatio
function parameters and return type are approved.
Line range hint
67-74
:
LGTM! Transition tomath.LegacyDec
.The changes to the
ApplyProfitHaircutForDerivatives
function parameters and internal logic are approved.
82-87
: LGTM! Transition tomath.LegacyDec
.The changes to the
ApplyTotalPositionPayoutHaircut
function parameters and internal logic are approved.
Line range hint
89-101
:
LGTM! Transition tomath.LegacyDec
.The changes to the
ApplyProfitHaircutForBinaryOptions
function parameters and internal logic are approved.
105-124
: LGTM! Transition tomath.LegacyDec
.The changes to the
ClosePositionWithSettlePrice
function parameters, return type, and internal logic are approved.
135-137
: LGTM! Transition tomath.LegacyDec
.The changes to the
ClosePositionByRefunding
function parameters, return type, and internal logic are approved.
Line range hint
149-164
:
LGTM! Transition tomath.LegacyDec
.The changes to the
CheckValidPositionToReduce
function parameters and internal logic are approved.
170-185
: LGTM! Transition tomath.LegacyDec
.The changes to the
checkValidClosingPrice
function parameters and internal logic are approved.
Line range hint
191-198
:
LGTM! Transition tomath.LegacyDec
.The changes to the
GetLiquidationMarketOrderWorstPrice
function parameters and return type are approved.
202-203
: LGTM! Transition tomath.LegacyDec
.The changes to the
GetBankruptcyPrice
function parameters and return type are approved.
206-207
: LGTM! Transition tomath.LegacyDec
.The changes to the
GetBankruptcyPriceWithAddedMargin
function parameters and return type are approved.
210-211
: LGTM! Transition tomath.LegacyDec
.The changes to the
GetLiquidationPrice
function parameters and return type are approved.
214-227
: LGTM! Transition tomath.LegacyDec
.The changes to the
getLiquidationPriceWithAddedMargin
function parameters and internal logic are approved.
230-238
: LGTM! Transition tomath.LegacyDec
.The changes to the
GetEffectiveMargin
function parameters and internal logic are approved.
253-254
: LGTM! Transition tomath.LegacyDec
.The changes to the
getFundingAdjustedMargin
function parameters and internal logic are approved.
Line range hint
257-270
:
LGTM! Transition tomath.LegacyDec
.The changes to the
getFundingAdjustedMarginWithAddedMargin
function parameters and internal logic are approved.
276-281
: LGTM! Transition tomath.LegacyDec
.The changes to the
getFundingAdjustedUnitMarginWithAddedMargin
function parameters and internal logic are approved.
284-287
: LGTM! Transition tomath.LegacyDec
.The changes to the
GetAverageWeightedEntryPrice
function parameters and return type are approved.
Line range hint
291-303
:
LGTM! Transition tomath.LegacyDec
.The changes to the
GetPayoutIfFullyClosing
function parameters, return type, and internal logic are approved.
Line range hint
309-322
:
LGTM! Transition tomath.LegacyDec
.The changes to the
GetPayoutFromPnl
function parameters, return type, and internal logic are approved.
Line range hint
325-389
:
LGTM! Transition tomath.LegacyDec
.The changes to the
ApplyPositionDelta
function parameters, return type, and internal logic are approved.chain/oracle/types/proposal.go (12)
30-31
: LGTM! New proposal type constants.The new constants
ProposalTypeGrantStorkPublisherPrivilege
andProposalTypeRevokeStorkPublisherPrivilege
are approved.
44-45
: LGTM! Register new proposal types.The changes to the
init
function to register the new proposal types are approved.
428-430
: LGTM! New methodGetTitle
forGrantStorkPublisherPrivilegeProposal
.The new method
GetTitle
is approved.
432-435
: LGTM! New methodGetDescription
forGrantStorkPublisherPrivilegeProposal
.The new method
GetDescription
is approved.
437-439
: LGTM! New methodProposalRoute
forGrantStorkPublisherPrivilegeProposal
.The new method
ProposalRoute
is approved.
441-443
: LGTM! New methodProposalType
forGrantStorkPublisherPrivilegeProposal
.The new method
ProposalType
is approved.
446-454
: LGTM! New methodValidateBasic
forGrantStorkPublisherPrivilegeProposal
.The new method
ValidateBasic
is approved.
457-459
: LGTM! New methodGetTitle
forRevokeStorkPublisherPrivilegeProposal
.The new method
GetTitle
is approved.
461-464
: LGTM! New methodGetDescription
forRevokeStorkPublisherPrivilegeProposal
.The new method
GetDescription
is approved.
466-468
: LGTM! New methodProposalRoute
forRevokeStorkPublisherPrivilegeProposal
.The new method
ProposalRoute
is approved.
470-472
: LGTM! New methodProposalType
forRevokeStorkPublisherPrivilegeProposal
.The new method
ProposalType
is approved.
475-483
: LGTM! New methodValidateBasic
forRevokeStorkPublisherPrivilegeProposal
.The new method
ValidateBasic
is approved.chain/exchange/types/derivative_orders.go (12)
Line range hint
14-37
:
LGTM! Transition tomath.LegacyDec
.The changes to the
NewMarketOrderForLiquidation
function parameters and internal logic are approved.
69-73
: LGTM! Transition tomath.LegacyDec
.The changes to the
GetCancelRefundAmount
function parameters and return type are approved.
Line range hint
153-161
:
LGTM! Transition tomath.LegacyDec
.The changes to the
ResizeReduceOnlyOrder
function parameters and internal logic are approved.
190-197
: LGTM! Transition tomath.LegacyDec
.The changes to the
GetRequiredBinaryOptionsMargin
function parameters and return type are approved.
200-207
: LGTM! Transition tomath.LegacyDec
.The changes to the
GetRequiredBinaryOptionsMargin
function parameters and return type are approved.
210-213
: LGTM! Transition tomath.LegacyDec
.The changes to the
GetCancelDepositDelta
function parameters and internal logic are approved.
Line range hint
217-227
:
LGTM! Transition tomath.LegacyDec
.The changes to the
GetCancelRefundAmount
function parameters and return type are approved.
230-238
: LGTM! Transition tomath.LegacyDec
.The changes to the
CheckTickSize
function parameters and internal logic are approved.
248-249
: LGTM! Transition tomath.LegacyDec
.The changes to the
GetScaledPrice
function parameters and return type are approved.
262-284
: LGTM! Transition tomath.LegacyDec
.The changes to the
CheckMarginAndGetMarginHold
function parameters, return type, and internal logic are approved.
289-294
: LGTM! Transition tomath.LegacyDec
.The changes to the
CheckInitialMarginRequirementMarkPriceThreshold
function parameters and internal logic are approved.
432-448
: LGTM! Transition tomath.LegacyDec
.The changes to the
Quantity
,FillableQuantity
, andPrice
functions parameters and return types are approved.chain/peggy/types/msgs.go (10)
624-624
: Ensure consistency with existing message types.The
Route
method correctly returns theRouterKey
. Ensure this is consistent with other message types in the module.
626-626
: Ensure consistency with existing message types.The
Type
method correctly returns the type string. Ensure this is consistent with other message types in the module.
628-642
: Validate the error handling inValidateBasic
method.The
ValidateBasic
method correctly performs validation checks on the signer and blacklist addresses. Ensure that the error messages are informative and consistent with other validation methods.
644-646
: Ensure proper serialization inGetSignBytes
method.The
GetSignBytes
method correctly serializes the message for signing usingsdk.MustSortJSON
. Ensure this is consistent with other message types in the module.
648-651
: Ensure proper signer extraction inGetSigners
method.The
GetSigners
method correctly extracts the signer's address. Ensure this is consistent with other message types in the module.
653-653
: Ensure consistency with existing message types.The
Route
method correctly returns theRouterKey
. Ensure this is consistent with other message types in the module.
655-655
: Ensure consistency with existing message types.The
Type
method correctly returns the type string. Ensure this is consistent with other message types in the module.
657-671
: Validate the error handling inValidateBasic
method.The
ValidateBasic
method correctly performs validation checks on the signer and blacklist addresses. Ensure that the error messages are informative and consistent with other validation methods.
673-675
: Ensure proper serialization inGetSignBytes
method.The
GetSignBytes
method correctly serializes the message for signing usingsdk.MustSortJSON
. Ensure this is consistent with other message types in the module.
677-680
: Ensure proper signer extraction inGetSigners
method.The
GetSigners
method correctly extracts the signer's address. Ensure this is consistent with other message types in the module.chain/exchange/types/params.go (24)
6-6
: Ensure compatibility with the new math library.The import of the new
math
library fromcosmossdk.io
should be checked for compatibility with the rest of the codebase.
46-47
: Ensure new constant is used appropriately.The new constant
MaxGranterDelegations
should be checked for appropriate usage throughout the codebase.
50-50
: Ensure compatibility with new math library.The variable
MaxBinaryOptionsOrderPrice
is updated to usemath.LegacyOneDec()
. Ensure compatibility with the rest of the codebase.
53-53
: Ensure compatibility with new math library.The variable
MinDerivativeOrderPrice
is updated to usemath.LegacyOneDec()
. Ensure compatibility with the rest of the codebase.
56-56
: Ensure compatibility with new math library.The variable
MaxOrderPrice
is updated to usemath.LegacyMustNewDecFromStr
. Ensure compatibility with the rest of the codebase.
59-59
: Ensure compatibility with new math library.The variable
MaxOrderMargin
is updated to usemath.LegacyMustNewDecFromStr
. Ensure compatibility with the rest of the codebase.
62-62
: Ensure compatibility with new math library.The variable
MaxTokenInt
is updated to usemath.NewIntFromString
. Ensure compatibility with the rest of the codebase.
64-64
: Ensure compatibility with new math library.The variable
MaxOrderQuantity
is updated to usemath.LegacyMustNewDecFromStr
. Ensure compatibility with the rest of the codebase.
65-65
: Ensure compatibility with new math library.The variable
MaxFeeMultiplier
is updated to usemath.LegacyMustNewDecFromStr
. Ensure compatibility with the rest of the codebase.
67-67
: Ensure compatibility with new math library.The variable
minMarginRatio
is updated to usemath.LegacyNewDecWithPrec
. Ensure compatibility with the rest of the codebase.
107-127
: Ensure compatibility with new math library inNewParams
function.The parameters in the
NewParams
function are updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.
193-215
: Ensure compatibility with new math library inDefaultParams
function.The return values in the
DefaultParams
function are updated to usemath
types. Ensure compatibility with the rest of the codebase.
292-294
: Ensure new validation function is used appropriately.The new validation function
validateAdmins
should be checked for appropriate usage throughout the codebase.
Line range hint
338-350
: Ensure compatibility with new math library inValidateFee
function.The parameter type in the
ValidateFee
function is updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.
Line range hint
358-371
: Ensure compatibility with new math library inValidateMakerFee
function.The parameter type in the
ValidateMakerFee
function is updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.
Line range hint
379-397
: Ensure compatibility with new math library inValidateHourlyFundingRateCap
function.The parameter type in the
ValidateHourlyFundingRateCap
function is updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.
Line range hint
405-419
: Ensure compatibility with new math library inValidateHourlyInterestRate
function.The parameter type in the
ValidateHourlyInterestRate
function is updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.
Line range hint
427-453
: Ensure compatibility with new math library inValidateTickSize
function.The parameter type in the
ValidateTickSize
function is updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.
468-483
: Ensure compatibility with new math library inValidateMinNotional
function.The parameter type in the
ValidateMinNotional
function is updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.
Line range hint
486-497
: Ensure compatibility with new math library inValidateMarginRatio
function.The parameter type in the
ValidateMarginRatio
function is updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.
530-551
: Ensure new validation function is used appropriately.The new validation function
validateAdmins
should be checked for appropriate usage throughout the codebase.
Line range hint
580-588
: Ensure compatibility with new math library invalidateInjRewardStakedRequirementThreshold
function.The parameter type in the
validateInjRewardStakedRequirementThreshold
function is updated to usemath.Int
. Ensure compatibility with the rest of the codebase.
Line range hint
610-621
: Ensure compatibility with new math library invalidateLiquidatorRewardShareRate
function.The parameter type in the
validateLiquidatorRewardShareRate
function is updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.
640-648
: Ensure compatibility with new math library invalidateAtomicMarketOrderFeeMultiplier
function.The parameter type in the
validateAtomicMarketOrderFeeMultiplier
function is updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.chain/exchange/types/key.go (16)
9-9
: Ensure compatibility with the new math library.The import of the new
math
library fromcosmossdk.io
should be checked for compatibility with the rest of the codebase.
115-118
: Ensure new prefixes are used appropriately.The new prefixes for grant authorizations should be checked for appropriate usage throughout the codebase.
280-280
: Ensure compatibility with new math library inGetSubaccountOrderKey
function.The parameter type in the
GetSubaccountOrderKey
function is updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.
285-285
: Ensure compatibility with new math library inGetSubaccountOrderIterationKey
function.The parameter type in the
GetSubaccountOrderIterationKey
function is updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.
317-317
: Ensure compatibility with new math library inGetPaddedPrice
function.The parameter type in the
GetPaddedPrice
function is updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.
328-336
: Ensure compatibility with new math library inGetPriceFromPaddedPrice
function.The return type in the
GetPriceFromPaddedPrice
function is updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.
339-339
: Ensure compatibility with new math library inGetLimitOrderByPriceKeyPrefix
function.The parameter type in the
GetLimitOrderByPriceKeyPrefix
function is updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.
385-385
: Ensure compatibility with new math library inGetConditionalOrderByTriggerPriceKeyPrefix
function.The parameter type in the
GetConditionalOrderByTriggerPriceKeyPrefix
function is updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.
390-390
: Ensure compatibility with new math library inSpotMarketDirectionPriceHashPrefix
function.The parameter type in the
SpotMarketDirectionPriceHashPrefix
function is updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.
526-526
: Ensure compatibility with new math library inGetSpotOrderbookLevelsForPriceKey
function.The parameter type in the
GetSpotOrderbookLevelsForPriceKey
function is updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.
532-532
: Ensure compatibility with new math library inGetDerivativeOrderbookLevelsForPriceKey
function.The parameter type in the
GetDerivativeOrderbookLevelsForPriceKey
function is updated to usemath.LegacyDec
. Ensure compatibility with the rest of the codebase.
536-538
: Ensure compatibility with new math library inGetGrantAuthorizationKey
function.The function
GetGrantAuthorizationKey
is introduced to handle grant authorizations. Ensure compatibility with the rest of the codebase.
540-542
: Ensure compatibility with new math library inGetGrantAuthorizationIteratorPrefix
function.The function
GetGrantAuthorizationIteratorPrefix
is introduced to handle grant authorizations. Ensure compatibility with the rest of the codebase.
544-546
: Ensure compatibility with new math library inGetTotalGrantAmountKey
function.The function
GetTotalGrantAmountKey
is introduced to handle grant authorizations. Ensure compatibility with the rest of the codebase.
548-550
: Ensure compatibility with new math library inGetActiveGrantKey
function.The function
GetActiveGrantKey
is introduced to handle grant authorizations. Ensure compatibility with the rest of the codebase.
552-554
: Ensure compatibility with new math library inGetLastValidGrantDelegationCheckTimeKey
function.The function
GetLastValidGrantDelegationCheckTimeKey
is introduced to handle grant authorizations. Ensure compatibility with the rest of the codebasechain/exchange/types/proposal.go (12)
59-63
: LGTM!The function
SafeIsPositiveInt
correctly usesmath.Int
instead ofsdkmath.Int
.
67-71
: LGTM!The function
SafeIsPositiveDec
correctly usesmath.LegacyDec
instead ofsdk.Dec
.
75-79
: LGTM!The function
SafeIsNonNegativeDec
correctly usesmath.LegacyDec
instead ofsdk.Dec
.
83-85
: LGTM!The function
IsZeroOrNilInt
correctly usesmath.Int
instead ofsdkmath.Int
.
87-89
: LGTM!The function
IsZeroOrNilDec
correctly usesmath.LegacyDec
instead ofsdk.Dec
.
259-266
: LGTM!The function
ValidateBasic
inSpotMarketParamUpdateProposal
correctly includes validation for the new parameterminNotional
.Also applies to: 296-315
502-511
: LGTM!The function
ValidateBasic
inDerivativeMarketParamUpdateProposal
correctly includes validation for the new parametersminNotional
,ticker
, andadminInfo
.Also applies to: 551-582
Line range hint
608-613
:
LGTM!The function
NewMarketForcedSettlementProposal
correctly usesmath.LegacyDec
instead ofsdk.Dec
.
Line range hint
216-229
:
LGTM! But verify the function usage in the codebase.The function
NewSpotMarketParamUpdateProposal
has been correctly updated to include new parametersminNotional
andticker
, and to usemath.LegacyDec
instead ofsdk.Dec
.However, ensure that all function calls to
NewSpotMarketParamUpdateProposal
match the new signature.Verification successful
No issues found with the function usage.
The function
NewSpotMarketParamUpdateProposal
is not called anywhere else in the codebase. Therefore, there are no calls to verify against the new signature.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `NewSpotMarketParamUpdateProposal` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go -A 5 $'NewSpotMarketParamUpdateProposal'Length of output: 744
Script:
#!/bin/bash # Description: Verify all function calls to `NewSpotMarketParamUpdateProposal` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go 'NewSpotMarketParamUpdateProposal\(' -A 3Length of output: 525
Script:
#!/bin/bash # Description: Verify all function calls to `NewSpotMarketParamUpdateProposal` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg 'NewSpotMarketParamUpdateProposal\(' -A 3Length of output: 515
Line range hint
432-467
:
LGTM! But verify the function usage in the codebase.The function
NewDerivativeMarketParamUpdateProposal
has been correctly updated to include new parametersminNotional
,ticker
, andadminInfo
, and to usemath.LegacyDec
instead ofsdk.Dec
.However, ensure that all function calls to
NewDerivativeMarketParamUpdateProposal
match the new signature.
Line range hint
783-800
:
LGTM! But verify the function usage in the codebase.The function
NewPerpetualMarketLaunchProposal
has been correctly updated to include the new parameterminNotional
, and to usemath.LegacyDec
instead ofsdk.Dec
.However, ensure that all function calls to
NewPerpetualMarketLaunchProposal
match the new signature.
Line range hint
1446-1465
:
LGTM! But verify the function usage in the codebase.The function
NewBinaryOptionsMarketLaunchProposal
has been correctly updated to include the new parameterminNotional
, and to usemath.LegacyDec
instead ofsdk.Dec
.However, ensure that all function calls to
NewBinaryOptionsMarketLaunchProposal
match the new signature.Verification successful
No issues found with the function signature update.
The function
NewBinaryOptionsMarketLaunchProposal
has been correctly updated to include the new parameterminNotional
and to usemath.LegacyDec
instead ofsdk.Dec
. There are no calls to this function in the codebase, so no further updates are necessary.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `NewBinaryOptionsMarketLaunchProposal` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go -A 5 $'NewBinaryOptionsMarketLaunchProposal'Length of output: 728
Script:
#!/bin/bash # Description: Verify all function calls to `NewBinaryOptionsMarketLaunchProposal` match the new signature. # Test: Search for the function calls. Expect: Only occurrences of the new signature. rg --type go 'NewBinaryOptionsMarketLaunchProposal\(' -A 5Length of output: 601
Script:
#!/bin/bash # Description: Verify all function calls to `NewBinaryOptionsMarketLaunchProposal` match the new signature. # Test: Search for any occurrences of the function. Expect: Only occurrences of the new signature. rg --type go 'NewBinaryOptionsMarketLaunchProposal'Length of output: 258
chain/exchange/types/msgs.go (5)
194-255
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
MsgUpdateDerivativeMarket
are correctly implemented.
119-160
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
MsgUpdateSpotMarket
are correctly implemented.
Line range hint
576-621
:
LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
MsgDecreasePositionMargin
are correctly implemented.Verification successful
Function
MsgDecreasePositionMargin
is correctly implemented and integrated within the codebase.The search results show that
MsgDecreasePositionMargin
is defined and used appropriately in various parts of the codebase, including message handling and protobuf definitions. No issues were found in the implementation.
- File:
chain/exchange/types/msgs.go
- Definition and methods of
MsgDecreasePositionMargin
are correctly implemented.- File:
chain/exchange/types/tx.pb.go
- Protobuf message definitions and gRPC service methods for
MsgDecreasePositionMargin
are correctly implemented.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `MsgDecreasePositionMargin` are correctly implemented. # Test: Search for the function usage. Expect: Only occurrences of the correct implementation. rg --type go -A 5 $'MsgDecreasePositionMargin'Length of output: 18434
Line range hint
1080-1104
:
LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
MsgActivateStakeGrant
are correctly implemented.
Line range hint
1043-1067
:
LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
MsgAuthorizeStakeGrants
are correctly implemented.Verification successful
Function usage of
MsgAuthorizeStakeGrants
verified.The function
MsgAuthorizeStakeGrants
and its related methods are correctly implemented across the codebase, includingmsgs.go
andtx.pb.go
.
msgs.go
: Core implementation and methods.tx.pb.go
: Protobuf definitions and related methods.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `MsgAuthorizeStakeGrants` are correctly implemented. # Test: Search for the function usage. Expect: Only occurrences of the correct implementation. rg --type go -A 5 $'MsgAuthorizeStakeGrants'Length of output: 15757
chain/exchange/types/market.go (8)
14-14
: LGTM!The change to use
math.LegacyNewDec(-1)
forBinaryOptionsMarketRefundFlagPrice
is correct and aligns with the new mathematical library.
18-18
: LGTM!The change to use
math.LegacyDec
for theMarkPrice
field in theDerivativeMarketInfo
struct is correct and aligns with the new mathematical library.
93-115
: LGTM!The changes to use
math.LegacyDec
for the methodsGetMakerFeeRate
,GetTakerFeeRate
,GetRelayerFeeShareRate
,GetMinPriceTickSize
,GetMinQuantityTickSize
, andGetMinNotional
inSpotMarket
are correct and align with the new mathematical library.
156-162
: LGTM!The changes to use
math.LegacyDec
for the methodsGetMinQuantityTickSize
andGetMinNotional
inDerivativeMarket
are correct and align with the new mathematical library.
213-229
: LGTM!The changes to use
math.LegacyDec
for the methodsGetMakerFeeRate
,GetTakerFeeRate
,GetRelayerFeeShareRate
,GetInitialMarginRatio
, andGetMinPriceTickSize
inDerivativeMarket
are correct and align with the new mathematical library.
Line range hint
260-285
: LGTM!The changes to use
math.LegacyDec
for the methodsGetInitialMarginRatio
,GetMinPriceTickSize
,GetMinQuantityTickSize
, andGetMinNotional
inBinaryOptionsMarket
are correct and align with the new mathematical library.
295-303
: LGTM!The changes to use
math.LegacyDec
for the methodsGetMakerFeeRate
,GetTakerFeeRate
, andGetRelayerFeeShareRate
inBinaryOptionsMarket
are correct and align with the new mathematical library.
174-187
: LGTM!The new
String
method for theMarketType
enum is correctly implemented and enhances the readability and usability of market type instances.chain/peggy/types/types.go (1)
253-253
: LGTM!The change to initialize
sum
usingsdkmath.ZeroInt()
in theGetFees
method of theOutgoingTxBatch
struct is correct and aligns with the new mathematical library.
// NewInterfaceRegistry returns a new InterfaceRegistry | ||
func NewInterfaceRegistry() types.InterfaceRegistry { | ||
registry, err := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{ | ||
ProtoFiles: proto.HybridResolver, | ||
SigningOptions: signing.Options{ | ||
AddressCodec: address.Bech32Codec{ | ||
Bech32Prefix: sdktypes.GetConfig().GetBech32AccountAddrPrefix(), | ||
}, | ||
ValidatorAddressCodec: address.Bech32Codec{ | ||
Bech32Prefix: sdktypes.GetConfig().GetBech32ValidatorAddrPrefix(), | ||
}, | ||
}, | ||
}) | ||
if err != nil { | ||
panic(err) | ||
} | ||
return registry | ||
} |
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.
Consider improving error handling.
The NewInterfaceRegistry
function correctly initializes the InterfaceRegistry
. However, using panic
for error handling is not recommended in production code. Consider returning an error instead.
- registry, err := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{
+ registry, err := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{
- if err != nil {
- panic(err)
- }
+ if err != nil {
+ return nil, err
+ }
return registry
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.
// NewInterfaceRegistry returns a new InterfaceRegistry | |
func NewInterfaceRegistry() types.InterfaceRegistry { | |
registry, err := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{ | |
ProtoFiles: proto.HybridResolver, | |
SigningOptions: signing.Options{ | |
AddressCodec: address.Bech32Codec{ | |
Bech32Prefix: sdktypes.GetConfig().GetBech32AccountAddrPrefix(), | |
}, | |
ValidatorAddressCodec: address.Bech32Codec{ | |
Bech32Prefix: sdktypes.GetConfig().GetBech32ValidatorAddrPrefix(), | |
}, | |
}, | |
}) | |
if err != nil { | |
panic(err) | |
} | |
return registry | |
} | |
// NewInterfaceRegistry returns a new InterfaceRegistry | |
func NewInterfaceRegistry() (types.InterfaceRegistry, error) { | |
registry, err := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{ | |
ProtoFiles: proto.HybridResolver, | |
SigningOptions: signing.Options{ | |
AddressCodec: address.Bech32Codec{ | |
Bech32Prefix: sdktypes.GetConfig().GetBech32AccountAddrPrefix(), | |
}, | |
ValidatorAddressCodec: address.Bech32Codec{ | |
Bech32Prefix: sdktypes.GetConfig().GetBech32ValidatorAddrPrefix(), | |
}, | |
}, | |
}) | |
if err != nil { | |
return nil, err | |
} | |
return registry, nil | |
} |
const ( | ||
TickerPerm = 1 << iota | ||
MinPriceTickSizePerm = 1 << iota | ||
MinQuantityTickSizePerm = 1 << iota | ||
MinNotionalPerm = 1 << iota | ||
InitialMarginRationPerm = 1 << iota | ||
MaintenanceMarginRationPerm = 1 << iota |
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.
Fix typographical errors in constant names.
There are typographical errors in the constant names InitialMarginRationPerm
and MaintenanceMarginRationPerm
. They should be InitialMarginRatioPerm
and MaintenanceMarginRatioPerm
.
- InitialMarginRationPerm = 1 << iota
- MaintenanceMarginRationPerm = 1 << iota
+ InitialMarginRatioPerm = 1 << iota
+ MaintenanceMarginRatioPerm = 1 << iota
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.
const ( | |
TickerPerm = 1 << iota | |
MinPriceTickSizePerm = 1 << iota | |
MinQuantityTickSizePerm = 1 << iota | |
MinNotionalPerm = 1 << iota | |
InitialMarginRationPerm = 1 << iota | |
MaintenanceMarginRationPerm = 1 << iota | |
const ( | |
TickerPerm = 1 << iota | |
MinPriceTickSizePerm = 1 << iota | |
MinQuantityTickSizePerm = 1 << iota | |
MinNotionalPerm = 1 << iota | |
InitialMarginRatioPerm = 1 << iota | |
MaintenanceMarginRatioPerm = 1 << iota |
func (p MarketAdminPermissions) CheckDerivativeMarketPermissions(msg *MsgUpdateDerivativeMarket) error { | ||
if msg.HasTickerUpdate() && !p.HasPerm(TickerPerm) { | ||
return errors.Wrap(ErrInvalidAccessLevel, "admin does not have permission to update ticker") | ||
} | ||
|
||
if msg.HasMinPriceTickSizeUpdate() && !p.HasPerm(MinPriceTickSizePerm) { | ||
return errors.Wrap(ErrInvalidAccessLevel, "admin does not have permission to update min_price_tick_size") | ||
} | ||
|
||
if msg.HasMinQuantityTickSizeUpdate() && !p.HasPerm(MinQuantityTickSizePerm) { | ||
return errors.Wrap(ErrInvalidAccessLevel, "admin does not have permission to update min_quantity_tick_size") | ||
} | ||
|
||
if msg.HasMinNotionalUpdate() && !p.HasPerm(MinNotionalPerm) { | ||
return errors.Wrap(ErrInvalidAccessLevel, "admin does not have permission to update market min_notional") | ||
} | ||
|
||
if msg.HasInitialMarginRatioUpdate() && !p.HasPerm(InitialMarginRationPerm) { | ||
return errors.Wrap(ErrInvalidAccessLevel, "admin does not have permission to update initial_margin_ratio") | ||
} | ||
|
||
if msg.HasMaintenanceMarginRatioUpdate() && !p.HasPerm(MaintenanceMarginRationPerm) { | ||
return errors.Wrap(ErrInvalidAccessLevel, "admin does not have permission to update maintenance_margin_ratio") | ||
} | ||
|
||
return nil |
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.
Fix typographical errors in constant names.
The function uses constants InitialMarginRationPerm
and MaintenanceMarginRationPerm
which have typographical errors. They should be InitialMarginRatioPerm
and MaintenanceMarginRatioPerm
.
- if msg.HasInitialMarginRatioUpdate() && !p.HasPerm(InitialMarginRationPerm) {
+ if msg.HasInitialMarginRatioUpdate() && !p.HasPerm(InitialMarginRatioPerm) {
- if msg.HasMaintenanceMarginRatioUpdate() && !p.HasPerm(MaintenanceMarginRationPerm) {
+ if msg.HasMaintenanceMarginRatioUpdate() && !p.HasPerm(MaintenanceMarginRatioPerm) {
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.
func (p MarketAdminPermissions) CheckDerivativeMarketPermissions(msg *MsgUpdateDerivativeMarket) error { | |
if msg.HasTickerUpdate() && !p.HasPerm(TickerPerm) { | |
return errors.Wrap(ErrInvalidAccessLevel, "admin does not have permission to update ticker") | |
} | |
if msg.HasMinPriceTickSizeUpdate() && !p.HasPerm(MinPriceTickSizePerm) { | |
return errors.Wrap(ErrInvalidAccessLevel, "admin does not have permission to update min_price_tick_size") | |
} | |
if msg.HasMinQuantityTickSizeUpdate() && !p.HasPerm(MinQuantityTickSizePerm) { | |
return errors.Wrap(ErrInvalidAccessLevel, "admin does not have permission to update min_quantity_tick_size") | |
} | |
if msg.HasMinNotionalUpdate() && !p.HasPerm(MinNotionalPerm) { | |
return errors.Wrap(ErrInvalidAccessLevel, "admin does not have permission to update market min_notional") | |
} | |
if msg.HasInitialMarginRatioUpdate() && !p.HasPerm(InitialMarginRationPerm) { | |
return errors.Wrap(ErrInvalidAccessLevel, "admin does not have permission to update initial_margin_ratio") | |
} | |
if msg.HasMaintenanceMarginRatioUpdate() && !p.HasPerm(MaintenanceMarginRationPerm) { | |
return errors.Wrap(ErrInvalidAccessLevel, "admin does not have permission to update maintenance_margin_ratio") | |
} | |
return nil | |
func (p MarketAdminPermissions) CheckDerivativeMarketPermissions(msg *MsgUpdateDerivativeMarket) error { | |
if msg.HasTickerUpdate() && !p.HasPerm(TickerPerm) { | |
return errors.Wrap(ErrInvalidAccessLevel, "admin does not have permission to update ticker") | |
} | |
if msg.HasMinPriceTickSizeUpdate() && !p.HasPerm(MinPriceTickSizePerm) { | |
return errors.Wrap(ErrInvalidAccessLevel, "admin does not have permission to update min_price_tick_size") | |
} | |
if msg.HasMinQuantityTickSizeUpdate() && !p.HasPerm(MinQuantityTickSizePerm) { | |
return errors.Wrap(ErrInvalidAccessLevel, "admin does not have permission to update min_quantity_tick_size") | |
} | |
if msg.HasMinNotionalUpdate() && !p.HasPerm(MinNotionalPerm) { | |
return errors.Wrap(ErrInvalidAccessLevel, "admin does not have permission to update market min_notional") | |
} | |
if msg.HasInitialMarginRatioUpdate() && !p.HasPerm(InitialMarginRatioPerm) { | |
return errors.Wrap(ErrInvalidAccessLevel, "admin does not have permission to update initial_margin_ratio") | |
} | |
if msg.HasMaintenanceMarginRatioUpdate() && !p.HasPerm(MaintenanceMarginRatioPerm) { | |
return errors.Wrap(ErrInvalidAccessLevel, "admin does not have permission to update maintenance_margin_ratio") | |
} | |
return nil |
dev
to release them tomaster
to create the v1.51 release.