mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
eth/tracers: rename callContext to traceContext
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
5b716fdf9d
commit
c20cf72e34
4 changed files with 6 additions and 5 deletions
|
|
@ -66,7 +66,7 @@ type callTrace struct {
|
||||||
// callTracerTest defines a single test to check the call tracer against.
|
// callTracerTest defines a single test to check the call tracer against.
|
||||||
type callTracerTest struct {
|
type callTracerTest struct {
|
||||||
Genesis *core.Genesis `json:"genesis"`
|
Genesis *core.Genesis `json:"genesis"`
|
||||||
Context *callContext `json:"context"`
|
Context *traceContext `json:"context"`
|
||||||
Input string `json:"input"`
|
Input string `json:"input"`
|
||||||
TracerConfig json.RawMessage `json:"tracerConfig"`
|
TracerConfig json.RawMessage `json:"tracerConfig"`
|
||||||
Result *callTrace `json:"result"`
|
Result *callTrace `json:"result"`
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ type flatCallTraceResult struct {
|
||||||
// flatCallTracerTest defines a single test to check the call tracer against.
|
// flatCallTracerTest defines a single test to check the call tracer against.
|
||||||
type flatCallTracerTest struct {
|
type flatCallTracerTest struct {
|
||||||
Genesis *core.Genesis `json:"genesis"`
|
Genesis *core.Genesis `json:"genesis"`
|
||||||
Context *callContext `json:"context"`
|
Context *traceContext `json:"context"`
|
||||||
Input string `json:"input"`
|
Input string `json:"input"`
|
||||||
TracerConfig json.RawMessage `json:"tracerConfig"`
|
TracerConfig json.RawMessage `json:"tracerConfig"`
|
||||||
Result []flatCallTrace `json:"result"`
|
Result []flatCallTrace `json:"result"`
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ type account struct {
|
||||||
// testcase defines a single test to check the stateDiff tracer against.
|
// testcase defines a single test to check the stateDiff tracer against.
|
||||||
type testcase struct {
|
type testcase struct {
|
||||||
Genesis *core.Genesis `json:"genesis"`
|
Genesis *core.Genesis `json:"genesis"`
|
||||||
Context *callContext `json:"context"`
|
Context *traceContext `json:"context"`
|
||||||
Input string `json:"input"`
|
Input string `json:"input"`
|
||||||
TracerConfig json.RawMessage `json:"tracerConfig"`
|
TracerConfig json.RawMessage `json:"tracerConfig"`
|
||||||
Result interface{} `json:"result"`
|
Result interface{} `json:"result"`
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,8 @@ func camel(str string) string {
|
||||||
return strings.Join(pieces, "")
|
return strings.Join(pieces, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
type callContext struct {
|
// traceContext defines a context used to construct the block context
|
||||||
|
type traceContext struct {
|
||||||
Number math.HexOrDecimal64 `json:"number"`
|
Number math.HexOrDecimal64 `json:"number"`
|
||||||
Difficulty *math.HexOrDecimal256 `json:"difficulty"`
|
Difficulty *math.HexOrDecimal256 `json:"difficulty"`
|
||||||
Time math.HexOrDecimal64 `json:"timestamp"`
|
Time math.HexOrDecimal64 `json:"timestamp"`
|
||||||
|
|
@ -51,7 +52,7 @@ type callContext struct {
|
||||||
BaseFee *math.HexOrDecimal256 `json:"baseFeePerGas"`
|
BaseFee *math.HexOrDecimal256 `json:"baseFeePerGas"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *callContext) toBlockContext(genesis *core.Genesis) vm.BlockContext {
|
func (c *traceContext) toBlockContext(genesis *core.Genesis) vm.BlockContext {
|
||||||
context := vm.BlockContext{
|
context := vm.BlockContext{
|
||||||
CanTransfer: core.CanTransfer,
|
CanTransfer: core.CanTransfer,
|
||||||
Transfer: core.Transfer,
|
Transfer: core.Transfer,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue