updates for light sync transactions
This commit is contained in:
+1
-1
@@ -30,7 +30,7 @@ type Block struct {
|
||||
ParentHash string `db:"parenthash"`
|
||||
Size string `db:"size"`
|
||||
Time int64 `db:"time"`
|
||||
Transactions []Transaction
|
||||
Transactions []TransactionModel
|
||||
UncleHash string `db:"uncle_hash"`
|
||||
UnclesReward float64 `db:"uncles_reward"`
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum"
|
||||
@@ -26,10 +27,11 @@ import (
|
||||
type BlockChain interface {
|
||||
ContractDataFetcher
|
||||
GetBlockByNumber(blockNumber int64) (Block, error)
|
||||
GetEthLogsWithCustomQuery(query ethereum.FilterQuery) ([]types.Log, error)
|
||||
GetHeaderByNumber(blockNumber int64) (Header, error)
|
||||
GetHeaderByNumbers(blockNumbers []int64) ([]Header, error)
|
||||
GetLogs(contract Contract, startingBlockNumber *big.Int, endingBlockNumber *big.Int) ([]Log, error)
|
||||
GetEthLogsWithCustomQuery(query ethereum.FilterQuery) ([]types.Log, error)
|
||||
GetTransactions(transactionHashes []common.Hash) ([]TransactionModel, error)
|
||||
LastBlock() (*big.Int, error)
|
||||
Node() Node
|
||||
}
|
||||
|
||||
@@ -19,5 +19,5 @@ package core
|
||||
type Contract struct {
|
||||
Abi string
|
||||
Hash string
|
||||
Transactions []Transaction
|
||||
Transactions []TransactionModel
|
||||
}
|
||||
|
||||
+17
-2
@@ -16,8 +16,8 @@
|
||||
|
||||
package core
|
||||
|
||||
type Transaction struct {
|
||||
Data string `db:"input_data"`
|
||||
type TransactionModel struct {
|
||||
Data []byte `db:"input_data"`
|
||||
From string `db:"tx_from"`
|
||||
GasLimit uint64
|
||||
GasPrice int64
|
||||
@@ -29,3 +29,18 @@ type Transaction struct {
|
||||
TxIndex int64 `db:"tx_index"`
|
||||
Value string
|
||||
}
|
||||
|
||||
type RpcTransaction struct {
|
||||
Nonce string `json:"nonce"`
|
||||
GasPrice string `json:"gasPrice"`
|
||||
GasLimit string `json:"gas"`
|
||||
Recipient string `json:"to"`
|
||||
Amount string `json:"value"`
|
||||
Payload []byte `json:"input"`
|
||||
V string `json:"v"`
|
||||
R string `json:"r"`
|
||||
S string `json:"s"`
|
||||
Hash string
|
||||
From string
|
||||
TransactionIndex string `json:"transactionIndex"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user