-
Notifications
You must be signed in to change notification settings - Fork 62
[chore] recover NewTxConfig function #326
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
Conversation
WalkthroughThe update refactors the Cosmos SDK client context setup by introducing helper functions for creating a protobuf codec and transaction configuration. Codec and registry initialization logic is modularized into a new function, and transaction configuration is encapsulated in another. The main context creation function is streamlined to use these helpers, with improved error handling. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant ClientContext
participant CodecHelper
participant Keyring
Caller->>ClientContext: NewClientContext(chainId, fromSpec, kb)
ClientContext->>CodecHelper: createInjectiveProtoCodec()
CodecHelper-->>ClientContext: (codec, interfaceRegistry)
ClientContext->>ClientContext: NewTxConfig([SIGN_MODE_DIRECT])
ClientContext->>Keyring: Lookup key by Bech32 or name
Keyring-->>ClientContext: keyInfo / error
ClientContext-->>Caller: client.Context or error
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (3)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Pull Request Overview
This PR recovers a previously removed function that allows creating a TxConfig with configurable signing modes. The change refactors the existing code by extracting codec creation logic into a separate function and reintroducing the NewTxConfig utility function.
- Adds back the
NewTxConfigfunction for creating TxConfig with custom signing modes - Refactors codec creation logic into a reusable
createInjectiveProtoCodecfunction - Maintains existing functionality while improving code reusability
Comments suppressed due to low confidence (1)
client/chain/context.go:137
- [nitpick] The parameter name 'injectiveCodec' in the return signature is unnecessarily specific. Consider using 'marshaler' to be consistent with how it's used throughout the codebase.
func createInjectiveProtoCodec() (injectiveCodec *codec.ProtoCodec, interfaceRegistry types.InterfaceRegistry) {
Summary by CodeRabbit
Refactor
Bug Fixes
End-users may notice improved reliability and maintainability in transaction processing features. No changes to visible functionality.