core/types: encode receipt status in PostState field
This fixes a regression where the new Failed field in ReceiptForStorage rejected previously stored receipts. Fix it by removing the new field and store status in the PostState field. This also removes massive RLP hackery around the status field.
This commit is contained in:
@@ -340,7 +340,7 @@ func TestBlockReceiptStorage(t *testing.T) {
|
||||
db, _ := ethdb.NewMemDatabase()
|
||||
|
||||
receipt1 := &types.Receipt{
|
||||
PostState: []byte{0x01},
|
||||
Failed: true,
|
||||
CumulativeGasUsed: big.NewInt(1),
|
||||
Logs: []*types.Log{
|
||||
{Address: common.BytesToAddress([]byte{0x11})},
|
||||
@@ -351,7 +351,7 @@ func TestBlockReceiptStorage(t *testing.T) {
|
||||
GasUsed: big.NewInt(111111),
|
||||
}
|
||||
receipt2 := &types.Receipt{
|
||||
PostState: []byte{0x02},
|
||||
PostState: common.Hash{2}.Bytes(),
|
||||
CumulativeGasUsed: big.NewInt(2),
|
||||
Logs: []*types.Log{
|
||||
{Address: common.BytesToAddress([]byte{0x22})},
|
||||
|
Reference in New Issue
Block a user