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

refactor(x/auth): Revert signature of TxSignBatchExec #18602

Merged
merged 5 commits into from
Nov 30, 2023

Conversation

raynaudoe
Copy link
Contributor

@raynaudoe raynaudoe commented Nov 30, 2023

Description

This PR partially reverts the changes introduced in #18564:

  • Restored cli/suite_test.go:TxSignBatchExec to its previous signature
  • Adapt cli/suite_test.go:TestCLISignBatchTotalFees to use clitestutil.ExecTestCLICmd instead of TxSignBatchExec

Author Checklist

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

I have...

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

Reviewers Checklist

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

I have...

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

Summary by CodeRabbit

  • Refactor

    • Simplified the transaction signing process by allowing a single file input instead of multiple files.
  • Tests

    • Updated integration and end-to-end tests to reflect the new transaction signing method.
  • Documentation

    • Updated CHANGELOG to note the changes in transaction signing behavior.
  • Bug Fixes

    • Fixed issues related to batch transaction signing to improve reliability and user experience.

Copy link
Contributor

coderabbitai bot commented Nov 30, 2023

Walkthrough

The overall change involves modifying the TxSignBatchExec function across various test suites and utility files to accept a single file name instead of a slice of file names for batch transaction signing. This change affects how arguments are constructed and passed to the function, with additional flags for sequence, account number, offline mode, and multisig being incorporated in various calls to accommodate different transaction signing scenarios.

Changes

File(s) Change Summary
tests/integration/auth/client/cli/suite_test.go
tests/e2e/auth/suite.go (multiple entries)
Updated TxSignBatchExec function calls to use a single string for the file name instead of a slice of strings. Added flags for sequence, account number, and offline mode in various function calls.
x/auth/CHANGELOG.md Documented the reversion of the TxSignBatchExec signature in the client/cli module, which affects batch transaction signing logic.
x/auth/client/testutil/helpers.go Modified TxSignBatchExec to accept a single filename instead of a slice of filenames, with adjustments to argument construction.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

@raynaudoe raynaudoe marked this pull request as ready for review November 30, 2023 13:43
@raynaudoe raynaudoe requested a review from a team as a code owner November 30, 2023 13:43
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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 7aa5635 and d4049cf.
Files selected for processing (3)
  • tests/integration/auth/client/cli/suite_test.go (4 hunks)
  • x/auth/CHANGELOG.md (1 hunks)
  • x/auth/client/testutil/helpers.go (1 hunks)
Additional comments: 7
tests/integration/auth/client/cli/suite_test.go (4)
  • 159-171: The calls to authtestutil.TxSignBatchExec correctly pass a single filename string instead of a slice of strings, aligning with the updated function signature.

  • 212-224: The introduction of batchSignArgs and its use in constructing arguments for clitestutil.ExecTestCLICmd is correctly implemented and aligns with the summary.

  • 798-803: The call to authtestutil.TxSignBatchExec correctly passes a single filename string instead of a slice of strings, aligning with the updated function signature.

  • 808-813: The call to authtestutil.TxSignBatchExec correctly passes a single filename string instead of a slice of strings, aligning with the updated function signature.

x/auth/CHANGELOG.md (1)
  • 36-36: The changelog entry correctly documents the reversion of the TxSignBatchExec signature and provides a link to the associated pull request.
x/auth/client/testutil/helpers.go (2)
  • 66-72: The change from a slice of filenames to a single filename in TxSignBatchExec is correctly implemented in the hunk. Ensure that all usages of this function in the codebase are updated to pass a single filename string.

  • 63-73: The summary of the pull request indicates a reversion of the function signature, but the hunk shows a change from accepting a slice of filenames to a single filename. Please clarify if the summary or the hunk is incorrect.

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between d4049cf and ff47402.
Files selected for processing (1)
  • tests/e2e/auth/suite.go (6 hunks)
Additional comments: 6
tests/e2e/auth/suite.go (6)
  • 226-263: The changes to TxSignBatchExec function calls to use a single string argument for the file name are consistent with the summary and correctly implemented.

  • 288-293: The changes to TxSignBatchExec function calls to use a single string argument for the file name are consistent with the summary and correctly implemented.

  • 1171-1176: The changes to TxSignBatchExec function calls to use a single string argument for the file name are consistent with the summary and correctly implemented.

  • 1181-1186: The changes to TxSignBatchExec function calls to use a single string argument for the file name are consistent with the summary and correctly implemented.

  • 1244-1249: The changes to TxSignBatchExec function calls to use a single string argument for the file name are consistent with the summary and correctly implemented.

  • 1254-1259: The changes to TxSignBatchExec function calls to use a single string argument for the file name are consistent with the summary and correctly implemented.

x/auth/CHANGELOG.md Outdated Show resolved Hide resolved
@julienrbrt julienrbrt changed the title fix: Revert signature of TxSignBatchExec refactor(x/auth): Revert signature of TxSignBatchExec Nov 30, 2023
Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

lgtm!, ty!

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between ff47402 and df3bd6c.
Files selected for processing (1)
  • tests/e2e/auth/suite.go (6 hunks)
Additional comments: 4
tests/e2e/auth/suite.go (4)
  • 228-230: The error message assertion should be updated to reflect the new error message format if it has changed due to the reversion of TxSignBatchExec function's signature.

  • 1171-1177: The --multisig flag is used correctly to enable multi-signature mode for the transaction signing process. Ensure that the TxSignBatchExec function supports this flag as expected.

  • 1244-1250: The use of --offline flag along with --account-number and --sequence is appropriate for offline transaction signing. Verify that the TxSignBatchExec function handles these flags correctly after the reversion.

  • 288-294: The assertion for the sequence number after signing the batch (s.Require().Equal(seq+1, seq1)) is correct, but ensure that the sequence number is being incremented as expected in the actual implementation.

@raynaudoe raynaudoe added this pull request to the merge queue Nov 30, 2023
Merged via the queue into main with commit 3c8ddab Nov 30, 2023
62 of 63 checks passed
@raynaudoe raynaudoe deleted the eze/revert_TxSignBatchExec branch November 30, 2023 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants