core: implement Metropolis EIP 658, receipt status byte
This commit is contained in:
committed by
Péter Szilágyi
parent
2fd5ba6bd4
commit
28aea46ac0
@ -523,7 +523,8 @@ func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, txHash common.
|
||||
|
||||
// Run the transaction with tracing enabled.
|
||||
vmenv := vm.NewEVM(context, statedb, api.config, vm.Config{Debug: true, Tracer: tracer})
|
||||
ret, gas, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(tx.Gas()))
|
||||
// TODO utilize failed flag
|
||||
ret, gas, _, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(tx.Gas()))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("tracing failed: %v", err)
|
||||
}
|
||||
@ -570,7 +571,7 @@ func (api *PrivateDebugAPI) computeTxEnv(blockHash common.Hash, txIndex int) (co
|
||||
|
||||
vmenv := vm.NewEVM(context, statedb, api.config, vm.Config{})
|
||||
gp := new(core.GasPool).AddGas(tx.Gas())
|
||||
_, _, err := core.ApplyMessage(vmenv, msg, gp)
|
||||
_, _, _, err := core.ApplyMessage(vmenv, msg, gp)
|
||||
if err != nil {
|
||||
return nil, vm.Context{}, nil, fmt.Errorf("tx %x failed: %v", tx.Hash(), err)
|
||||
}
|
||||
|
@ -35,11 +35,11 @@ func TestMipmapUpgrade(t *testing.T) {
|
||||
chain, receipts := core.GenerateChain(params.TestChainConfig, genesis, db, 10, func(i int, gen *core.BlockGen) {
|
||||
switch i {
|
||||
case 1:
|
||||
receipt := types.NewReceipt(nil, new(big.Int))
|
||||
receipt := types.NewReceipt(nil, false, new(big.Int))
|
||||
receipt.Logs = []*types.Log{{Address: addr}}
|
||||
gen.AddUncheckedReceipt(receipt)
|
||||
case 2:
|
||||
receipt := types.NewReceipt(nil, new(big.Int))
|
||||
receipt := types.NewReceipt(nil, false, new(big.Int))
|
||||
receipt.Logs = []*types.Log{{Address: addr}}
|
||||
gen.AddUncheckedReceipt(receipt)
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ import (
|
||||
)
|
||||
|
||||
func makeReceipt(addr common.Address) *types.Receipt {
|
||||
receipt := types.NewReceipt(nil, new(big.Int))
|
||||
receipt := types.NewReceipt(nil, false, new(big.Int))
|
||||
receipt.Logs = []*types.Log{
|
||||
{Address: addr},
|
||||
}
|
||||
@ -145,7 +145,7 @@ func TestFilters(t *testing.T) {
|
||||
var receipts types.Receipts
|
||||
switch i {
|
||||
case 1:
|
||||
receipt := types.NewReceipt(nil, new(big.Int))
|
||||
receipt := types.NewReceipt(nil, false, new(big.Int))
|
||||
receipt.Logs = []*types.Log{
|
||||
{
|
||||
Address: addr,
|
||||
@ -155,7 +155,7 @@ func TestFilters(t *testing.T) {
|
||||
gen.AddUncheckedReceipt(receipt)
|
||||
receipts = types.Receipts{receipt}
|
||||
case 2:
|
||||
receipt := types.NewReceipt(nil, new(big.Int))
|
||||
receipt := types.NewReceipt(nil, false, new(big.Int))
|
||||
receipt.Logs = []*types.Log{
|
||||
{
|
||||
Address: addr,
|
||||
@ -165,7 +165,7 @@ func TestFilters(t *testing.T) {
|
||||
gen.AddUncheckedReceipt(receipt)
|
||||
receipts = types.Receipts{receipt}
|
||||
case 998:
|
||||
receipt := types.NewReceipt(nil, new(big.Int))
|
||||
receipt := types.NewReceipt(nil, false, new(big.Int))
|
||||
receipt.Logs = []*types.Log{
|
||||
{
|
||||
Address: addr,
|
||||
@ -175,7 +175,7 @@ func TestFilters(t *testing.T) {
|
||||
gen.AddUncheckedReceipt(receipt)
|
||||
receipts = types.Receipts{receipt}
|
||||
case 999:
|
||||
receipt := types.NewReceipt(nil, new(big.Int))
|
||||
receipt := types.NewReceipt(nil, false, new(big.Int))
|
||||
receipt.Logs = []*types.Log{
|
||||
{
|
||||
Address: addr,
|
||||
|
Reference in New Issue
Block a user