Rename transactions to full_sync_transactions

- Table has foreign key to blocks
- Add transaction RLP and transaction index to table
- Enables other tables with standalone transactions or transactions
  associated with other data structures (e.g. headers)
This commit is contained in:
Rob Mulholand
2019-03-28 14:31:17 -05:00
parent 48f6114791
commit d93006321b
30 changed files with 498 additions and 272 deletions
+40
View File
@@ -17,6 +17,7 @@
package fakes
import (
"bytes"
"encoding/json"
"errors"
"strconv"
@@ -48,3 +49,42 @@ func GetFakeHeader(blockNumber int64) core.Header {
Timestamp: strconv.FormatInt(fakeTimestamp, 10),
}
}
var fakeTransaction types.Transaction
var rawTransaction bytes.Buffer
var _ = fakeTransaction.EncodeRLP(&rawTransaction)
var FakeTransaction = core.Transaction{
Data: "",
From: "",
GasLimit: 0,
GasPrice: 0,
Hash: "",
Nonce: 0,
Raw: rawTransaction.Bytes(),
Receipt: core.Receipt{},
To: "",
TxIndex: 0,
Value: "0",
}
func GetFakeTransaction(hash string, receipt core.Receipt) core.Transaction {
gethTransaction := types.Transaction{}
var raw bytes.Buffer
err := gethTransaction.EncodeRLP(&raw)
if err != nil {
panic("failed to marshal transaction creating test fake")
}
return core.Transaction{
Data: "",
From: "",
GasLimit: 0,
GasPrice: 0,
Hash: hash,
Nonce: 0,
Raw: raw.Bytes(),
Receipt: receipt,
To: "",
TxIndex: 0,
Value: "0",
}
}