mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
Update transaction_signing.go
This commit is contained in:
parent
e5acf45a04
commit
2a70526fe7
1 changed files with 19 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue