mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
fix TestStructLogMarshalingOmitEmpty (#727)
This commit is contained in:
parent
675d81b417
commit
bdcede5221
1 changed files with 4 additions and 4 deletions
|
|
@ -93,13 +93,13 @@ func TestStructLogMarshalingOmitEmpty(t *testing.T) {
|
|||
want string
|
||||
}{
|
||||
{"empty err and no fields", &StructLog{},
|
||||
`{"pc":0,"op":0,"gas":"0x0","gasCost":"0x0","memSize":0,"stack":null,"depth":0,"refund":0,"opName":"STOP"}`},
|
||||
`{"pc":0,"op":0,"gas":"0x0","gasCost":"0x0","memSize":0,"stack":null,"depth":0,"refund":0,"extraData":null,"opName":"STOP"}`},
|
||||
{"with err", &StructLog{Err: errors.New("this failed")},
|
||||
`{"pc":0,"op":0,"gas":"0x0","gasCost":"0x0","memSize":0,"stack":null,"depth":0,"refund":0,"opName":"STOP","error":"this failed"}`},
|
||||
`{"pc":0,"op":0,"gas":"0x0","gasCost":"0x0","memSize":0,"stack":null,"depth":0,"refund":0,"extraData":null,"opName":"STOP","error":"this failed"}`},
|
||||
{"with mem", &StructLog{Memory: make([]byte, 2), MemorySize: 2},
|
||||
`{"pc":0,"op":0,"gas":"0x0","gasCost":"0x0","memory":"0x0000","memSize":2,"stack":null,"depth":0,"refund":0,"opName":"STOP"}`},
|
||||
`{"pc":0,"op":0,"gas":"0x0","gasCost":"0x0","memory":"0x0000","memSize":2,"stack":null,"depth":0,"refund":0,"extraData":null,"opName":"STOP"}`},
|
||||
{"with 0-size mem", &StructLog{Memory: make([]byte, 0)},
|
||||
`{"pc":0,"op":0,"gas":"0x0","gasCost":"0x0","memSize":0,"stack":null,"depth":0,"refund":0,"opName":"STOP"}`},
|
||||
`{"pc":0,"op":0,"gas":"0x0","gasCost":"0x0","memSize":0,"stack":null,"depth":0,"refund":0,"extraData":null,"opName":"STOP"}`},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
|
|
|||
Loading…
Reference in a new issue