Skip to content

SignModeHandler's GetSignBytes: add Context arg #13646

@amaury1093

Description

@amaury1093

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

Metadata

Metadata

Assignees

Labels

T: API BreakingBreaking changes that impact APIs and the SDK only (not state machine).

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions