-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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!: use x/tx/signing in client.TxConfig #15822
Conversation
I 💯 agree with merged registry as a parameter. When code uses depinject this is doable, but if we're supporting non-depinject initialization we can only do this by introducing further API breakage, specifically If we're willing to break @tac0turtle @aaronc curious your thoughts on breaking |
We don't need to change anything. |
x/auth/tx/config.go
Outdated
) client.TxConfig { | ||
// protoFiles should perhaps be a parameter to this function, but the choice was made here to not break the | ||
// NewTxConfig API. | ||
protoFiles := registry.MergedProtoRegistry() |
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.
protoFiles := registry.MergedProtoRegistry() |
// NewTxConfig API. | ||
protoFiles := registry.MergedProtoRegistry() | ||
typeResolver := protoregistry.GlobalTypes | ||
signersContext, err := txsigning.NewGetSignersContext(txsigning.GetSignersOptions{ProtoFiles: protoFiles}) |
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.
This is unnecessary because of #15873. Just use codec.InterfaceRegistry().SigningContext()
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.
This is a compile error right now. I think it is OK to land this in main first then work on #15873 (which is still failing tests) then refactor?
I hadn't noticed that Personally I'd prefer breaking the API, and maybe |
See how it's handled in #15873. Changing NewInterfaceRegistry will be too painful on tests. We just have an overload with options to deal with this |
I am leaning toward merging and then refactoring out the global proto.MergedRegistry usages after #15873 lands since I'll be working on that anyway. |
it is being called in init() lifecycle before all proto files are loaded. the result is much wasted work right now.
return NewTxConfigWithHandler(protoCodec, makeSignModeHandler(enabledSignModes, textual, customSignModes...)) | ||
// | ||
// Deprecated: use NewTxConfigWithOptions instead. | ||
func NewTxConfigWithTextual(protoCodec codec.ProtoCodecMarshaler, _ []signingtypes.SignMode, |
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.
This has never been released, is there a reason to deprecate it instead of completely removing it?
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.
No, I'll remove it in a follow up.
TypeResolver: typeResolver, | ||
Encoder: &aminoJSONEncoder, | ||
} | ||
case signingtypes.SignMode_SIGN_MODE_TEXTUAL: |
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.
I think the panic message should be changed with the right function
@@ -27,25 +31,66 @@ type config struct { | |||
// NOTE: Use NewTxConfigWithHandler to provide a custom signing handler in case the sign mode | |||
// is not supported by default (eg: SignMode_SIGN_MODE_EIP_191). Use NewTxConfigWithTextual |
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.
Here too.
Description
Closes: #15698
This patch changes the type of
client.TxConfig.SignModeHandler
from x/auth/tx/SignModeHandler to x/tx/SignModeHandler, then fixes all resulting breakage. This deprecates signing in x/auth/tx in favor of the packages in x/tx.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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
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...
!
in the type prefix if API or client breaking change