Skip to content

Commit a0a0793

Browse files
Regenerate receipt json code to remove omit empty,
update schema to clarify while it's required we don't tag it as such for backwards compatibility. Update tests which were treating it as omit empty.
1 parent bbcb5ea commit a0a0793

File tree

9 files changed

+17
-8
lines changed

9 files changed

+17
-8
lines changed

cmd/evm/t8n_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,17 +275,18 @@ func TestT8n(t *testing.T) {
275275
tt.Run("evm-test", args...)
276276
// Compare the expected output, if provided
277277
if tc.expOut != "" {
278-
want, err := os.ReadFile(fmt.Sprintf("%v/%v", tc.base, tc.expOut))
278+
file := fmt.Sprintf("%v/%v", tc.base, tc.expOut)
279+
want, err := os.ReadFile(file)
279280
if err != nil {
280281
t.Fatalf("test %d: could not read expected output: %v", i, err)
281282
}
282283
have := tt.Output()
283284
ok, err := cmpJson(have, want)
284285
switch {
285286
case err != nil:
286-
t.Fatalf("test %d, json parsing failed: %v", i, err)
287+
t.Fatalf("test %d file %v:, json parsing failed: %v", i, file, err)
287288
case !ok:
288-
t.Fatalf("test %d: output wrong, have \n%v\nwant\n%v\n", i, string(have), string(want))
289+
t.Fatalf("test %d file %v: output wrong, have \n%v\nwant\n%v\n", i, file, string(have), string(want))
289290
}
290291
}
291292
tt.WaitExit()

cmd/evm/testdata/1/exp.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"transactionHash": "0x0557bacce3375c98d806609b8d5043072f0b6a8bae45ae5a67a00d3a1a18d673",
2929
"contractAddress": "0x0000000000000000000000000000000000000000",
3030
"gasUsed": "0x5208",
31+
"effectiveGasPrice": null,
3132
"blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
3233
"transactionIndex": "0x0"
3334
}

cmd/evm/testdata/13/exp2.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"transactionHash": "0xa98a24882ea90916c6a86da650fbc6b14238e46f0af04a131ce92be897507476",
1717
"contractAddress": "0x0000000000000000000000000000000000000000",
1818
"gasUsed": "0x84d0",
19+
"effectiveGasPrice": null,
1920
"blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
2021
"transactionIndex": "0x0"
2122
},
@@ -29,6 +30,7 @@
2930
"transactionHash": "0x36bad80acce7040c45fd32764b5c2b2d2e6f778669fb41791f73f546d56e739a",
3031
"contractAddress": "0x0000000000000000000000000000000000000000",
3132
"gasUsed": "0x84d0",
33+
"effectiveGasPrice": null,
3234
"blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
3335
"transactionIndex": "0x1"
3436
}

cmd/evm/testdata/23/exp.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"transactionHash": "0x72fadbef39cd251a437eea619cfeda752271a5faaaa2147df012e112159ffb81",
1616
"contractAddress": "0x0000000000000000000000000000000000000000",
1717
"gasUsed": "0x520b",
18+
"effectiveGasPrice": null,
1819
"blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
1920
"transactionIndex": "0x0"
2021
}

cmd/evm/testdata/24/exp.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"transactionHash": "0x92ea4a28224d033afb20e0cc2b290d4c7c2d61f6a4800a680e4e19ac962ee941",
3232
"contractAddress": "0x0000000000000000000000000000000000000000",
3333
"gasUsed": "0xa861",
34+
"effectiveGasPrice": null,
3435
"blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
3536
"transactionIndex": "0x0"
3637
},
@@ -43,6 +44,7 @@
4344
"transactionHash": "0x16b1d912f1d664f3f60f4e1b5f296f3c82a64a1a253117b4851d18bc03c4f1da",
4445
"contractAddress": "0x0000000000000000000000000000000000000000",
4546
"gasUsed": "0x5aa5",
47+
"effectiveGasPrice": null,
4648
"blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
4749
"transactionIndex": "0x1"
4850
}

cmd/evm/testdata/25/exp.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"transactionHash": "0x92ea4a28224d033afb20e0cc2b290d4c7c2d61f6a4800a680e4e19ac962ee941",
2828
"contractAddress": "0x0000000000000000000000000000000000000000",
2929
"gasUsed": "0x5208",
30+
"effectiveGasPrice": null,
3031
"blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
3132
"transactionIndex": "0x0"
3233
}

cmd/evm/testdata/3/exp.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"transactionHash": "0x72fadbef39cd251a437eea619cfeda752271a5faaaa2147df012e112159ffb81",
2929
"contractAddress": "0x0000000000000000000000000000000000000000",
3030
"gasUsed": "0x521f",
31+
"effectiveGasPrice": null,
3132
"blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
3233
"transactionIndex": "0x0"
3334
}

core/types/gen_receipt_json.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/types/receipt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ type Receipt struct {
6262
TxHash common.Hash `json:"transactionHash" gencodec:"required"`
6363
ContractAddress common.Address `json:"contractAddress"`
6464
GasUsed uint64 `json:"gasUsed" gencodec:"required"`
65-
EffectiveGasPrice *big.Int `json:"effectiveGasPrice"`
65+
EffectiveGasPrice *big.Int `json:"effectiveGasPrice"` // required, but tag omitted for backwards compatibility
6666

6767
// Inclusion information: These fields provide information about the inclusion of the
6868
// transaction corresponding to this receipt.

0 commit comments

Comments
 (0)