mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-15 23:38:19 +00:00
parent
1a42afe5f2
commit
393fcf6856
@ -51,6 +51,7 @@ type TxParseContext struct {
|
||||
Sighash [32]byte
|
||||
Sig [65]byte
|
||||
withSender bool
|
||||
withBor bool
|
||||
chainIDRequired bool
|
||||
IsProtected bool
|
||||
validateRlp func([]byte) error
|
||||
@ -64,6 +65,7 @@ func NewTxParseContext(chainID uint256.Int) *TxParseContext {
|
||||
}
|
||||
ctx := &TxParseContext{
|
||||
withSender: true,
|
||||
withBor: false,
|
||||
Keccak1: sha3.NewLegacyKeccak256(),
|
||||
Keccak2: sha3.NewLegacyKeccak256(),
|
||||
}
|
||||
@ -118,6 +120,7 @@ var ErrRlpTooBig = errors.New("txn rlp too big")
|
||||
|
||||
func (ctx *TxParseContext) ValidateRLP(f func(txnRlp []byte) error) { ctx.validateRlp = f }
|
||||
func (ctx *TxParseContext) WithSender(v bool) { ctx.withSender = v }
|
||||
func (ctx *TxParseContext) WithBor(v bool) { ctx.withBor = v }
|
||||
func (ctx *TxParseContext) ChainIDRequired() *TxParseContext {
|
||||
ctx.chainIDRequired = true
|
||||
return ctx
|
||||
@ -263,7 +266,7 @@ func (ctx *TxParseContext) ParseTransaction(payload []byte, pos int, slot *TxSlo
|
||||
slot.DataLen = dataLen
|
||||
isDataEmpty := dataLen == 0
|
||||
|
||||
if isEmptyHash && isDataEmpty && legacy {
|
||||
if ctx.withBor && isEmptyHash && isDataEmpty && legacy {
|
||||
slot.IsBor = true
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user