core, eth, miner, xeth: receipt storage fix

* Added GetReceiptsFromBlock, GetReceipt, PutReceipts
* Added ContractAddress to receipt. See #1042
This commit is contained in:
Jeffrey Wilcke
2015-07-04 02:25:04 +02:00
parent acd85fe95f
commit 2feb23c1da
8 changed files with 78 additions and 60 deletions

View File

@ -64,12 +64,9 @@ func TestPutReceipt(t *testing.T) {
Index: 0,
}})
PutReceipts(db, hash, types.Receipts{receipt})
receipts, err := getBlockReceipts(db, hash)
if err != nil {
t.Error("got err:", err)
}
if len(receipts) != 1 {
t.Error("expected to get 1 receipt, got", len(receipts))
PutReceipts(db, types.Receipts{receipt})
receipt = GetReceipt(db, common.Hash{})
if receipt == nil {
t.Error("expected to get 1 receipt, got none.")
}
}