Summary
// GetSignBytes returns the sign bytes for the provided SignMode, SignerData and Tx,
// or an error
- GetSignBytes(mode signing.SignMode, data SignerData, tx sdk.Tx) ([]byte, error)
+ GetSignBytes(context.Context, mode signing.SignMode, data SignerData, tx sdk.Tx) ([]byte, error)
Problem Definition
In SIGN_MODE_TEXTUAL, when generating signatures (from a client) or verifying signatures (from the antehandler), we need to have access to the latest state. This can only be done if the sign mode handler has access to the context.Context at the point of generating/verifying the signature.
Proposal
Add context.Context argument to GetSignBytes.
Some notes:
- Existing sign modes will not use the new
context.Context arg.
- On the antehandler-side, the first arg will be
sdk.WrapContext(sdkCtx). The VerifySignature function also needs this new argument.
- On the client-side, it can be
context.Background() or some client-created context
- This should in general be an internal SDK method, so shouldn't impact SDK users much
Summary
Problem Definition
In SIGN_MODE_TEXTUAL, when generating signatures (from a client) or verifying signatures (from the antehandler), we need to have access to the latest state. This can only be done if the sign mode handler has access to the
context.Contextat the point of generating/verifying the signature.Proposal
Add
context.Contextargument toGetSignBytes.Some notes:
context.Contextarg.sdk.WrapContext(sdkCtx). The VerifySignature function also needs this new argument.context.Background()or some client-created context