use the witness in statedb, revert applyTx signature (#36)

* use the witness in statedb, revert applyTx signature

* fix miner tests

* fix catalyst build
This commit is contained in:
Guillaume Ballet
2021-11-25 22:04:00 +01:00
parent 7360d168c8
commit 909049c5fe
4 changed files with 15 additions and 26 deletions

View File

@ -104,17 +104,10 @@ func (b *BlockGen) AddTxWithChain(bc *BlockChain, tx *types.Transaction) {
b.SetCoinbase(common.Address{})
}
b.statedb.Prepare(tx.Hash(), len(b.txs))
receipt, accesses, err := ApplyTransaction(b.config, bc, &b.header.Coinbase, b.gasPool, b.statedb, b.header, tx, &b.header.GasUsed, vm.Config{})
receipt, err := ApplyTransaction(b.config, bc, &b.header.Coinbase, b.gasPool, b.statedb, b.header, tx, &b.header.GasUsed, vm.Config{})
if err != nil {
panic(err)
}
if accesses != nil {
if b.statedb.Witness() != nil {
b.statedb.Witness().Merge(accesses)
} else {
b.statedb.SetWitness(accesses)
}
}
b.txs = append(b.txs, tx)
b.receipts = append(b.receipts, receipt)
}