WritePrivateReceipt writes private receipt associated with specified transaction.
(receipt *types.Receipt, txHash common.Hash, db database.Database)
| 51 | |
| 52 | // WritePrivateReceipt writes private receipt associated with specified transaction. |
| 53 | func WritePrivateReceipt(receipt *types.Receipt, txHash common.Hash, db database.Database) error { |
| 54 | hash := getPrivateReceiptKey(txHash) |
| 55 | // Write receipt to trie db. |
| 56 | storageReceipt := (*types.ReceiptForStorage)(receipt) |
| 57 | bytesToWrite, _ := rlp.EncodeToBytes(storageReceipt) |
| 58 | db.Put(hash.Bytes(), bytesToWrite) |
| 59 | log.Info("Write private transaction receipt", "hash", hash.String(), "receipt", fmt.Sprintf("%+v", receipt)) |
| 60 | return nil |
| 61 | } |
| 62 | |
| 63 | // ReadPrivateReceipt reads private receipt associated with specified transaction. |
| 64 | func ReadPrivateReceipt(txHash common.Hash, db database.Database) (*types.Receipt, error) { |