mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
Update state_processor.go
This commit is contained in:
parent
891bbad9ce
commit
e5acf45a04
1 changed files with 15 additions and 4 deletions
|
|
@ -37,6 +37,7 @@ import (
|
||||||
type StateProcessor struct {
|
type StateProcessor struct {
|
||||||
config *params.ChainConfig // Chain configuration options
|
config *params.ChainConfig // Chain configuration options
|
||||||
chain *HeaderChain // Canonical header chain
|
chain *HeaderChain // Canonical header chain
|
||||||
|
signerFactory types.SignerFactory
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewStateProcessor initialises a new StateProcessor.
|
// NewStateProcessor initialises a new StateProcessor.
|
||||||
|
|
@ -44,6 +45,16 @@ func NewStateProcessor(config *params.ChainConfig, chain *HeaderChain) *StatePro
|
||||||
return &StateProcessor{
|
return &StateProcessor{
|
||||||
config: config,
|
config: config,
|
||||||
chain: chain,
|
chain: chain,
|
||||||
|
signerFactory: types.NewStandardSignerFactory(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewStateProcessorWithSignerFactory initialises a new StateProcessor with a specified signer factory.
|
||||||
|
func NewStateProcessorWithSignerFactory(config *params.ChainConfig, chain *HeaderChain, signerFactory types.SignerFactory) *StateProcessor {
|
||||||
|
return &StateProcessor{
|
||||||
|
config: config,
|
||||||
|
chain: chain,
|
||||||
|
signerFactory: signerFactory,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,7 +82,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
|
||||||
}
|
}
|
||||||
var (
|
var (
|
||||||
context vm.BlockContext
|
context vm.BlockContext
|
||||||
signer = types.MakeSigner(p.config, header.Number, header.Time)
|
signer = p.signerFactory.MakeSigner(p.config, header.Number, header.Time)
|
||||||
)
|
)
|
||||||
|
|
||||||
// Apply pre-execution system calls.
|
// Apply pre-execution system calls.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue