-
Notifications
You must be signed in to change notification settings - Fork 1
/
transaction.go
47 lines (44 loc) · 1.25 KB
/
transaction.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package model
import "cloud.google.com/go/bigquery"
type Transaction struct {
BlockHash string
BlockNumber string
EthHash string
From string
Gas string
GasPrice string
Hash string
Input string
Nonce string
R string
S string
ShardID int64
Timestamp string
To string
ToShardID int64
TransactionIndex string
V string
Value string
}
func (txn *Transaction) Save() (map[string]bigquery.Value, string, error) {
return map[string]bigquery.Value{
"blockHash": txn.BlockHash,
"blockNumber": txn.BlockNumber,
"ethHash": txn.EthHash,
"from": txn.From,
"gas": txn.Gas,
"gasPrice": txn.GasPrice,
"hash": txn.Hash,
"input": txn.Input,
"nonce": txn.Nonce,
"r": txn.R,
"s": txn.S,
"shardID": txn.ShardID,
"timestamp": txn.Timestamp,
"to": txn.To,
"toShardID": txn.ToShardID,
"transactionIndex": txn.TransactionIndex,
"v": txn.V,
"value": txn.Value,
}, bigquery.NoDedupeID, nil
}