mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 07:36:44 +00:00
feat: include fee vault address in trace api result (#208)
* include fee vault address in trace api result * use fee vault instead of coinbase if exists * retrigger checks * Update api_blocktrace_test.go --------- Co-authored-by: maskpp <maskpp266@gmail.com> Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
This commit is contained in:
parent
7c3657b61b
commit
aae2ea53df
2 changed files with 18 additions and 7 deletions
|
|
@ -94,9 +94,14 @@ func (api *API) createTraceEnv(ctx context.Context, config *TraceConfig, block *
|
|||
}
|
||||
|
||||
// get coinbase
|
||||
coinbase, err := api.backend.Engine().Author(block.Header())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
var coinbase common.Address
|
||||
if api.backend.ChainConfig().FeeVaultAddress != nil {
|
||||
coinbase = *api.backend.ChainConfig().FeeVaultAddress
|
||||
} else {
|
||||
coinbase, err = api.backend.Engine().Author(block.Header())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
env := &traceEnv{
|
||||
|
|
@ -127,6 +132,7 @@ func (api *API) createTraceEnv(ctx context.Context, config *TraceConfig, block *
|
|||
}
|
||||
env.Proofs[key] = wrappedProof
|
||||
}
|
||||
|
||||
return env, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -180,10 +180,15 @@ func checkStructLogs(t *testing.T, expect []*txTraceResult, actual []*types.Exec
|
|||
}
|
||||
|
||||
func checkCoinbase(t *testing.T, b *testBackend, wrapper *types.AccountWrapper) {
|
||||
header, err := b.HeaderByNumber(context.Background(), 1)
|
||||
assert.NoError(t, err)
|
||||
coinbase, err := b.engine.Author(header)
|
||||
assert.NoError(t, err)
|
||||
var coinbase common.Address
|
||||
if b.chainConfig.FeeVaultAddress != nil {
|
||||
coinbase = *b.chainConfig.FeeVaultAddress
|
||||
} else {
|
||||
header, err := b.HeaderByNumber(context.Background(), 1)
|
||||
assert.NoError(t, err)
|
||||
coinbase, err = b.engine.Author(header)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
assert.Equal(t, true, coinbase.String() == wrapper.Address.String())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue