From 2a70526fe7817b012320d77273995fc531450470 Mon Sep 17 00:00:00 2001 From: maradini77 <140460067+maradini77@users.noreply.github.com> Date: Mon, 29 Sep 2025 16:28:59 +0200 Subject: [PATCH] Update transaction_signing.go --- core/types/transaction_signing.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/core/types/transaction_signing.go b/core/types/transaction_signing.go index 01aa67c6ba..5c32a87c32 100644 --- a/core/types/transaction_signing.go +++ b/core/types/transaction_signing.go @@ -31,6 +31,25 @@ import ( var ErrInvalidChainId = errors.New("invalid chain id for signer") +/ SignerFactory abstracts the creation of a Signer for a given +// chain configuration and fork schedule point (block number/time). +// +// The default implementation returns the same Signer as MakeSigner. +type SignerFactory interface { + MakeSigner(config *params.ChainConfig, blockNumber *big.Int, blockTime uint64) Signer +} + +// StandardSignerFactory is the default SignerFactory which mirrors MakeSigner. +type StandardSignerFactory struct{} + +// NewStandardSignerFactory creates a StandardSignerFactory instance. +func NewStandardSignerFactory() *StandardSignerFactory { return &StandardSignerFactory{} } + +// MakeSigner implements SignerFactory by delegating to types.MakeSigner. +func (ssf *StandardSignerFactory) MakeSigner(config *params.ChainConfig, blockNumber *big.Int, blockTime uint64) Signer { + return MakeSigner(config, blockNumber, blockTime) +} + // sigCache is used to cache the derived sender and contains // the signer used to derive it. type sigCache struct {