-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(feat) Added a new config option to disable the auto fix of sequence … #220
Conversation
…mismatch. Added configuration for local network.
WalkthroughThe recent updates focus on refining error handling and configuration options across several components. A notable enhancement includes the introduction of a condition to address "account sequence mismatch" errors selectively. This is complemented by a new function for building signed transactions. Additionally, the network loading function now supports a "local" configuration, enhancing flexibility. Changes
Recent Review DetailsConfiguration used: .coderabbit.yaml Files selected for processing (3)
Additional comments not posted (6)
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 Configration File (
|
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
return c.buildSignedTx(clientCtx, txf, msgs...) | ||
} |
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.
Add documentation for BuildSignedTx
.
This method is public and complex enough to warrant a detailed comment explaining its parameters, return type, and usage. Would you like me to draft a suggested doc comment?
|
||
func (c *chainClient) buildSignedTx(clientCtx client.Context, txf tx.Factory, msgs ...sdk.Msg) ([]byte, error) { |
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.
Refactor buildSignedTx
to handle simulation and signing separately.
The buildSignedTx
method currently handles both transaction simulation and signing within the same function. This could be split into separate methods for clarity and reusability.
txBytes, err := c.buildSignedTx(clientCtx, txf, msgs...) | ||
if err != nil { | ||
err = errors.Wrap(err, "failed to BuildUnsignedTx") | ||
return nil, err | ||
} | ||
|
||
txn.SetFeeGranter(clientCtx.GetFeeGranterAddress()) | ||
err = tx.Sign(txf, clientCtx.GetFromName(), txn, true) | ||
if err != nil { | ||
err = errors.Wrap(err, "failed to Sign Tx") | ||
return nil, err | ||
} | ||
|
||
txBytes, err := clientCtx.TxConfig.TxEncoder()(txn.GetTx()) | ||
if err != nil { | ||
err = errors.Wrap(err, "failed TxEncoder to encode Tx") | ||
err = errors.Wrap(err, "failed to build signed Tx") |
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.
Improve error handling in broadcastTx
.
The error handling in broadcastTx
could be improved by specifically checking for known errors and handling them accordingly, rather than wrapping all errors in a generic message.
This PR has been created to replace #213
It implements the same changes but on top of
dev
branchlocal
Network configurationSummary by CodeRabbit
New Features
LoadNetwork
function.Enhancements