Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emit transfer event on vault allocation, retrieval, and withdrawal #2303

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

tqin7
Copy link
Contributor

@tqin7 tqin7 commented Sep 19, 2024

Changelist

[Describe or list the changes made in this PR]

Test Plan

[Describe how this PR was tested (if applicable)]

Author/Reviewer Checklist

  • If this PR has changes that result in a different app state given the same prior state and transaction list, manually add the state-breaking label.
  • If the PR has breaking postgres changes to the indexer add the indexer-postgres-breaking label.
  • If this PR isn't state-breaking but has changes that modify behavior in PrepareProposal or ProcessProposal, manually add the label proposal-breaking.
  • If this PR is one of many that implement a specific feature, manually label them all feature:[feature-name].
  • If you wish to for mergify-bot to automatically create a PR to backport your change to a release branch, manually add the label backport/[branch-name].
  • Manually add any of the following labels: refactor, chore, bug.

Summary by CodeRabbit

  • New Features

    • Enhanced validation for positive QuoteQuantums in vault allocation and retrieval processes.
    • Introduced a structured transfer mechanism for fund transfers, improving clarity and reliability.
    • Added new message types for vault operations, including MsgAllocateToVault, MsgRetrieveFromVault, and MsgWithdrawFromMegavault.
  • Bug Fixes

    • Updated error handling for scenarios with zero or negative QuoteQuantums, ensuring invalid operations are prevented.
  • Tests

    • Expanded test cases for error handling in allocation and retrieval processes, ensuring robustness against invalid inputs.
    • Introduced comprehensive tests for new message types to validate their functionality and error handling.
  • Chores

    • Added a new error variable for improved error handling related to QuoteQuantums.

@tqin7 tqin7 requested a review from a team as a code owner September 19, 2024 21:54
Copy link
Contributor

coderabbitai bot commented Sep 19, 2024

Walkthrough

The changes across multiple files enhance the validation and error handling for the QuoteQuantums field in vault operations, ensuring that only positive values are processed. The transfer mechanisms have been updated to use a structured Transfer type, improving the clarity and organization of fund transfers. New test cases have been added to verify the correct handling of invalid input scenarios, while existing methods for transferring funds between subaccounts have been removed, reflecting a shift in the underlying transfer logic.

Changes

Files Change Summary
protocol/x/vault/keeper/deposit.go, protocol/x/vault/types/errors.go Updated error handling for invalid deposit amounts, changing ErrInvalidDepositAmount to ErrInvalidQuoteQuantums.
protocol/x/vault/keeper/msg_server_allocate_to_vault.go, protocol/x/vault/keeper/msg_server_retrieve_from_vault.go, protocol/x/vault/keeper/withdraw.go Modified fund transfer logic to use sendingKeeper.ProcessTransfer with a structured Transfer type, ensuring positive values for QuoteQuantums.
protocol/x/vault/keeper/msg_server_allocate_to_vault_test.go, protocol/x/vault/keeper/msg_server_retrieve_from_vault_test.go, protocol/x/vault/keeper/msg_server_withdraw_from_megavault_test.go Added test cases to validate error handling for zero and negative QuoteQuantums in various scenarios.
protocol/x/vault/types/expected_keepers.go Removed TransferFundsFromSubaccountToSubaccount method from SubaccountsKeeper interface, indicating a significant change in fund transfer functionality.
protocol/x/vault/types/msg_allocate_to_vault.go, protocol/x/vault/types/msg_deposit_to_megavault.go, protocol/x/vault/types/msg_retrieve_from_vault.go, protocol/x/vault/types/msg_withdraw_from_megavault.go Introduced ValidateBasic methods for new message types, ensuring that fields like Authority and QuoteQuantums are validated for correctness.

Possibly related PRs

Suggested labels

indexer, proto

Poem

🐇 In the vault where quantums play,
A check for positives leads the way.
Funds now transfer, clear and bright,
With tests to guard against the blight.
Hooray for changes, let’s all cheer,
For a safer vault, we hold so dear! 🎉


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c9feec3 and 8c24dca.

Files selected for processing (19)
  • protocol/x/vault/keeper/deposit.go (1 hunks)
  • protocol/x/vault/keeper/deposit_test.go (1 hunks)
  • protocol/x/vault/keeper/msg_server_allocate_to_vault.go (2 hunks)
  • protocol/x/vault/keeper/msg_server_allocate_to_vault_test.go (7 hunks)
  • protocol/x/vault/keeper/msg_server_deposit_to_megavault_test.go (2 hunks)
  • protocol/x/vault/keeper/msg_server_retrieve_from_vault.go (2 hunks)
  • protocol/x/vault/keeper/msg_server_retrieve_from_vault_test.go (10 hunks)
  • protocol/x/vault/keeper/msg_server_withdraw_from_megavault_test.go (15 hunks)
  • protocol/x/vault/keeper/withdraw.go (4 hunks)
  • protocol/x/vault/types/errors.go (2 hunks)
  • protocol/x/vault/types/expected_keepers.go (0 hunks)
  • protocol/x/vault/types/msg_allocate_to_vault.go (1 hunks)
  • protocol/x/vault/types/msg_allocate_to_vault_test.go (1 hunks)
  • protocol/x/vault/types/msg_deposit_to_megavault.go (1 hunks)
  • protocol/x/vault/types/msg_deposit_to_megavault_test.go (1 hunks)
  • protocol/x/vault/types/msg_retrieve_from_vault.go (1 hunks)
  • protocol/x/vault/types/msg_retrieve_from_vault_test.go (1 hunks)
  • protocol/x/vault/types/msg_withdraw_from_megavault.go (1 hunks)
  • protocol/x/vault/types/msg_withdraw_from_megavault_test.go (1 hunks)
Files not reviewed due to no reviewable changes (1)
  • protocol/x/vault/types/expected_keepers.go
Files skipped from review as they are similar to previous changes (13)
  • protocol/x/vault/keeper/deposit.go
  • protocol/x/vault/keeper/deposit_test.go
  • protocol/x/vault/keeper/msg_server_allocate_to_vault.go
  • protocol/x/vault/keeper/msg_server_retrieve_from_vault.go
  • protocol/x/vault/keeper/withdraw.go
  • protocol/x/vault/types/errors.go
  • protocol/x/vault/types/msg_allocate_to_vault.go
  • protocol/x/vault/types/msg_allocate_to_vault_test.go
  • protocol/x/vault/types/msg_deposit_to_megavault.go
  • protocol/x/vault/types/msg_retrieve_from_vault.go
  • protocol/x/vault/types/msg_retrieve_from_vault_test.go
  • protocol/x/vault/types/msg_withdraw_from_megavault.go
  • protocol/x/vault/types/msg_withdraw_from_megavault_test.go
Additional comments not posted (32)
protocol/x/vault/types/msg_deposit_to_megavault_test.go (3)

42-42: LGTM!

The change to use the types.ErrInvalidQuoteQuantums.Error() constant for the expected error message improves consistency and maintainability.


49-49: LGTM!

The change to use the types.ErrInvalidQuoteQuantums.Error() constant for the expected error message improves consistency and maintainability.


56-56: LGTM!

The change to use the types.ErrInvalidQuoteQuantums.Error() constant for the expected error message improves consistency and maintainability.

protocol/x/vault/keeper/msg_server_deposit_to_megavault_test.go (3)

214-214: LGTM!

Using the predefined error type vaulttypes.ErrInvalidQuoteQuantums improves consistency and maintainability. The error message is also more descriptive and aligns with the actual error condition.


222-222: LGTM!

Using the predefined error type vaulttypes.ErrInvalidQuoteQuantums improves consistency and maintainability. The error message is also more descriptive and aligns with the actual error condition.


233-233: LGTM!

Using the predefined error type vaulttypes.ErrInvalidQuoteQuantums improves consistency and maintainability. The error message is also more descriptive and aligns with the actual error condition.

protocol/x/vault/keeper/msg_server_allocate_to_vault_test.go (6)

4-6: LGTM!

The added imports are necessary for the new test cases and look good.


9-11: LGTM!

The updated imports for abcitypes and sdktypes look good and are likely due to dependency updates.


34-41: LGTM!

The new fields added to the test case struct are necessary for testing authorization, error messages, and failure scenarios. The changes look good.


Line range hint 43-126: Great job on adding new test cases!

The new test cases improve the test coverage and help ensure the correctness of the MsgAllocateToVault message by covering important edge cases and failure scenarios. The changes look good and are crucial for maintaining the stability and security of the system.


224-270: Excellent additions to the test function!

The new sections that invoke and verify the CheckTx and DeliverTx phases significantly improve the test coverage. Verifying the CheckTx response helps ensure that invalid transactions are caught early and appropriate error messages are returned, while verifying the DeliverTx phase helps ensure that the state transitions are correct and the system behaves as expected. The changes look good and enhance the overall quality of the test suite.


Line range hint 276-326: Great job on verifying the state changes!

The new section that verifies the state changes after the DeliverTx phase is crucial for ensuring the correctness of the system. Checking the main vault and sub vault balances helps ensure that the funds are transferred correctly and the balances are updated as expected, while checking the vault params helps ensure that the vault status is updated correctly based on the allocation. The changes look good and further enhance the reliability of the test suite.

protocol/x/vault/keeper/msg_server_retrieve_from_vault_test.go (11)

45-58: LGTM!

The test case correctly sets up the initial state, sends a valid message to retrieve 50 quantums from the vault, and expects the transaction to succeed. The test case covers a valid success scenario for retrieving funds from a vault in the quoting status.


59-72: LGTM!

The test case correctly sets up the initial state, sends a valid message to retrieve all available quantums from the vault, and expects the transaction to succeed. The test case covers a valid success scenario for retrieving all funds from a vault that is closed for anything other than retrieval.


73-93: LGTM!

The test case correctly sets up the initial state, sends an invalid message attempting to retrieve more than the maximum allowable uint64 quantums from the vault, and expects the CheckTx to fail with an appropriate error message. The test case covers a valid failure scenario for retrieving an invalid amount of funds from a vault.


Line range hint 94-109: LGTM!

The test case correctly sets up the initial state, sends an invalid message attempting to retrieve zero quantums from the vault, and expects the CheckTx to fail with an appropriate error message. The test case covers a valid failure scenario for retrieving an invalid amount of funds from a vault.


110-125: LGTM!

The test case correctly sets up the initial state, sends an invalid message attempting to retrieve a negative amount of quantums from the vault, and expects the CheckTx to fail with an appropriate error message. The test case covers a valid failure scenario for retrieving an invalid amount of funds from a vault.


Line range hint 126-141: LGTM!

The test case correctly sets up the initial state, sends a message attempting to retrieve more quantums than available in the sub vault with no open position, and expects the CheckTx to succeed but the DeliverTx to fail. The test case covers a valid failure scenario for retrieving more funds than available in a vault.


Line range hint 142-160: LGTM!

The test case correctly sets up the initial state with an open position in the sub vault, sends a message to retrieve an amount that exactly meets the initial margin requirement based on the open position, and expects the transaction to succeed. The test case covers a valid success scenario for retrieving funds from a vault while maintaining the required margin for an open position.


Line range hint 161-181: LGTM!

The test case correctly sets up the initial state with an open position in the sub vault, sends a message attempting to retrieve an amount that would result in undercollateralization based on the open position, and expects the CheckTx to succeed but the DeliverTx to fail. The test case covers a valid failure scenario for retrieving funds from a vault that would violate the margin requirement for an open position.


Line range hint 182-194: LGTM!

The test case correctly sets up the initial state, sends a message attempting to retrieve funds from a non-existent vault, and expects the CheckTx to succeed but the DeliverTx to fail. The test case covers a valid failure scenario for retrieving funds from a vault that does not exist.


Line range hint 195-207: LGTM!

The test case correctly sets up the initial state, sends a message with an invalid authority that does not match the operator, and expects the CheckTx to succeed but the DeliverTx to fail. The test case covers a valid failure scenario for retrieving funds with an unauthorized authority.


Line range hint 208-220: LGTM!

The test case correctly sets up the initial state, sends a message with an empty authority, and expects the CheckTx to fail with an appropriate error message. The test case covers a valid failure scenario for retrieving funds with an invalid empty authority.

protocol/x/vault/keeper/msg_server_withdraw_from_megavault_test.go (9)

40-40: Update mainVaultBalance to *big.Int for handling large balances

Changing mainVaultBalance from uint64 to *big.Int allows testing scenarios with balances exceeding the uint64 limit. This ensures that the tests can handle very large numbers without encountering integer overflow issues.


58-60: Add checkTxResponseContains and checkTxFails fields to enhance test validations

Introducing checkTxResponseContains and checkTxFails in the test struct improves the ability to validate CheckTx responses. It allows specific assertions on error messages and expected failure conditions during testing.


109-118: Handle rounding down of redeemed quote quantums to zero

In the test case "Failure: Withdraw some unlocked shares (1% of total), No sub-vaults, Redeemed quantums rounds down to 0", the calculation of redeemedQuoteQuantums results in zero due to rounding down. This is appropriately tested by setting deliverTxFails to true and ensuring that the withdrawal fails when the redeemed amount is insufficient.


135-145: Ensure proper error handling when withdrawing zero shares

The test case "Failure: Withdraw zero shares" correctly checks that attempting to withdraw zero shares results in an error. It verifies that CheckTx fails with the expected error message ErrNonPositiveShares.


148-158: Validate error on negative shares withdrawal

In the test case "Failure: Withdraw negative shares", withdrawing a negative number of shares should fail. The test appropriately checks that CheckTx fails and contains the error ErrNonPositiveShares.


337-352: Test withdrawal exceeding uint64 limits

The test case "Failure: Withdraw more than max uint64" evaluates the system's behavior when mainVaultBalance exceeds math.MaxUint64. This ensures that the transition to *big.Int effectively handles balances larger than uint64 without causing overflows or unexpected behavior.


505-513: Add validation for CheckTx responses in tests

The added code enhances test reliability by checking if the CheckTx response contains the expected error messages and whether it fails as intended. This makes the tests more robust and ensures that error conditions are properly validated.


Line range hint 219-232: Consider handling zero main vault balance with quoting sub-vaults

In the test case "Success: Withdraw some unlocked shares (~0.67% of total), 0 quantums in main vault, one quoting sub-vault with 0 leverage", the mainVaultBalance is zero, and the redeemed quote quantums come solely from the sub-vault. Ensure that the logic correctly handles scenarios where the main vault has no balance but sub-vaults contribute to the withdrawal.

To confirm the correctness, check that the redeemed amount is accurately calculated from the sub-vault's equity proportionally to the shares withdrawn.


Line range hint 248-303: Validate calculation of redeemed amounts with multiple sub-vaults and leverage

In the test case involving multiple sub-vaults with different statuses and leverage, ensure that the redeemed quote quantums are calculated correctly, especially considering the leverage adjustments. This is critical to accurately reflect the vault's equity during withdrawals.

Verify the redeemed quote quantums calculation:

  • Main vault withdrawal: 500 * 100 / 1,000 = 50
  • Sub-vault 0 withdrawal: 345 * 100 / 1,000 = 34
  • Sub-vault 1 withdrawal adjusted for leverage and initial margin factor (IMF):
    Redeemed = 2,000,000,000 * (Shares Withdrawn / Total Shares) * (1 - Leverage * IMF)
             = 2,000,000,000 * (100 / 1,000) * (1 - 1.5 * 0.2)
             = 200,000,000 * (1 - 0.3)
             = 200,000,000 * 0.7
             = 140,000,000
    
  • Total redeemed quote quantums: 50 + 34 + 140,000,000 = 140,000,084

The test case expects redeemedQuoteQuantums as 170,225,084, which suggests a discrepancy. Please review the calculations for accuracy.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

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

Other keywords and placeholders

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

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between cee80fc and a9f83a8.

Files selected for processing (7)
  • protocol/x/vault/keeper/msg_server_allocate_to_vault.go (3 hunks)
  • protocol/x/vault/keeper/msg_server_allocate_to_vault_test.go (1 hunks)
  • protocol/x/vault/keeper/msg_server_retrieve_from_vault.go (3 hunks)
  • protocol/x/vault/keeper/msg_server_retrieve_from_vault_test.go (1 hunks)
  • protocol/x/vault/keeper/withdraw.go (3 hunks)
  • protocol/x/vault/types/errors.go (1 hunks)
  • protocol/x/vault/types/expected_keepers.go (0 hunks)
Files not reviewed due to no reviewable changes (1)
  • protocol/x/vault/types/expected_keepers.go
Additional comments not posted (10)
protocol/x/vault/keeper/msg_server_retrieve_from_vault.go (1)

19-25: LGTM!

The changes introduce a validation check for the QuoteQuantums field, ensuring that only positive values are processed. This enhances the robustness of the function by preventing invalid operations with non-positive amounts.

The error handling for the validation check is appropriate, using errorsmod.Wrapf to provide context and the custom error type types.ErrInvalidQuoteQuantums.

The updated transfer mechanism improves code clarity by using a structured Transfer object, encapsulating the sender, recipient, asset ID, and amount. The amount in the Transfer object is guaranteed to be positive due to the earlier validation check, ensuring that the transfer operation is safe and valid.

Also applies to: 45-52

protocol/x/vault/keeper/msg_server_allocate_to_vault.go (3)

20-26: LGTM!

The validation check for QuoteQuantums is a good addition. It ensures that only positive values are processed and returns a descriptive error message for invalid input. This improves the robustness of the AllocateToVault function.


11-11: LGTM!

The import of the sendingtypes package is necessary to support the usage of the Transfer type in the updated transfer method.


65-72: Verify the impact of the updated transfer method.

The change from subaccountsKeeper.TransferFundsFromSubaccountToSubaccount to sendingKeeper.ProcessTransfer improves the clarity and organization of fund transfers. The Transfer type encapsulates the transfer logic within a structured format, making it easier to manage.

However, please ensure that this change is consistently applied across the codebase and does not introduce any unintended side effects.

Run the following script to verify the usage of the updated transfer method:

Verification successful

To gather more information about the usage of the old transfer method and understand why it's still present, let's run the following script:


The new ProcessTransfer method is an abstraction layer, not a replacement.

The change from subaccountsKeeper.TransferFundsFromSubaccountToSubaccount to sendingKeeper.ProcessTransfer is not a complete refactoring, but rather an addition of an abstraction layer in the sending module. Here's a breakdown of the current structure:

  1. The TransferFundsFromSubaccountToSubaccount method is still a core part of the subaccounts module and is used directly in various parts of the codebase.
  2. The new ProcessTransfer method in the sending module acts as a wrapper around the old method, adding functionality like telemetry and event generation.
  3. This abstraction allows for centralized processing of transfers in the sending module, which can include additional logic, checks, or side effects.

The presence of both methods is intentional and serves different purposes in the architecture. The vault module now uses the higher-level ProcessTransfer method, which provides a more feature-rich transfer process.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the updated transfer method across the codebase.

# Test: Search for the usage of the old transfer method. Expect: No occurrences.
rg --type go -A 5 $'subaccountsKeeper.TransferFundsFromSubaccountToSubaccount'

# Test: Search for the usage of the new transfer method. Expect: Consistent usage across the codebase.
rg --type go -A 5 $'sendingKeeper.ProcessTransfer'

Length of output: 2892


Script:

#!/bin/bash
# Description: Investigate the usage of the old transfer method

# Check the content of the file where the old method is present
echo "Content of protocol/x/sending/keeper/transfer.go:"
cat protocol/x/sending/keeper/transfer.go

# Look for any other occurrences of the old method being called
echo "\nOther occurrences of TransferFundsFromSubaccountToSubaccount:"
rg --type go "TransferFundsFromSubaccountToSubaccount" -C 5

Length of output: 15258

protocol/x/vault/types/errors.go (1)

148-152: LGTM!

The new error variable ErrInvalidQuoteQuantums is registered correctly with the module name, a unique error code, and a clear error message. This addition enhances the error handling capabilities of the module by providing a specific error for cases where the QuoteQuantums value is non-positive.

Please ensure that the error code 29 is unique within the module and doesn't conflict with any existing error codes.

protocol/x/vault/keeper/msg_server_allocate_to_vault_test.go (2)

70-80: LGTM!

The test case correctly verifies the error handling for allocating zero quantums to a vault. It sets up the necessary preconditions, such as the operator authority and vault balances, and expects the appropriate error message. This addition enhances the robustness of the test suite by ensuring that the system correctly handles invalid input for quantum allocation.


81-91: LGTM!

The test case correctly verifies the error handling for allocating negative quantums to a vault. It sets up the necessary preconditions, such as the operator authority and vault balances, and expects the appropriate error message. This addition further enhances the robustness of the test suite by ensuring that the system correctly handles invalid input for quantum allocation.

protocol/x/vault/keeper/msg_server_retrieve_from_vault_test.go (2)

62-75: LGTM!

This test case correctly verifies that attempting to retrieve zero quantums from a vault returns an error indicating invalid quote quantums. It's an important edge case to cover.


76-89: Looks good!

This test case correctly verifies that attempting to retrieve negative quantums from a vault returns an error indicating invalid quote quantums. It's another important edge case to cover alongside the zero quantums case.

protocol/x/vault/keeper/withdraw.go (1)

229-240: Verify if skipping vaults with non-positive quantumsToTransfer is expected

The code skips vaults where quantumsToTransfer is zero or negative, logging an informational message. Verify if this behavior is expected. If quantumsToTransfer should always be positive, encountering a zero or negative value might indicate an issue elsewhere in the computation. Consider logging a warning or error to aid in debugging unexpected cases.

protocol/x/vault/keeper/withdraw.go Outdated Show resolved Hide resolved
protocol/x/vault/keeper/withdraw.go Outdated Show resolved Hide resolved
@tqin7 tqin7 merged commit 3752694 into main Sep 20, 2024
22 checks passed
@tqin7 tqin7 deleted the tq/use-sending branch September 20, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants