fix flaky test

This commit is contained in:
Ian Norden 2020-08-05 11:03:18 -05:00
parent 1137436ac0
commit 2b8e5ad05a
3 changed files with 8 additions and 8 deletions

View File

@ -2,7 +2,7 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/vulcanize/ipfs-blockchain-watcher)](https://goreportcard.com/report/github.com/vulcanize/ipfs-blockchain-watcher) [![Go Report Card](https://goreportcard.com/badge/github.com/vulcanize/ipfs-blockchain-watcher)](https://goreportcard.com/report/github.com/vulcanize/ipfs-blockchain-watcher)
> ipfs-blockchain-watcher is used to extract, transform, and load all eth or btc data into an IPFS-backing Postgres datastore while generating useful secondary indexes around that data in other Postgres tables > ipfs-blockchain-watcher is used to extract, transform, and load all eth or btc data into an IPFS-backing Postgres datastore while generating useful secondary indexes around the data in other Postgres tables
## Table of Contents ## Table of Contents
1. [Background](#background) 1. [Background](#background)
@ -102,7 +102,7 @@ Warning: There is a good chance even a fully synced archive node has incomplete
The output from geth should mention that it is `Starting statediff service` and block synchronization should begin shortly thereafter. The output from geth should mention that it is `Starting statediff service` and block synchronization should begin shortly thereafter.
Note that until it receives a subscriber, the statediffing process does nothing but wait for one. Once a subscription is received, this Note that until it receives a subscriber, the statediffing process does nothing but wait for one. Once a subscription is received, this
will be indicated in the output and node will begin processing and sending statediffs. will be indicated in the output and the node will begin processing and sending statediffs.
Also in the output will be the endpoints that will be used to interface with the node. Also in the output will be the endpoints that will be used to interface with the node.
The default ws url is "127.0.0.1:8546" and the default http url is "127.0.0.1:8545". The default ws url is "127.0.0.1:8546" and the default http url is "127.0.0.1:8545".

View File

@ -47,7 +47,7 @@ var (
BlockNumber = big.NewInt(1) BlockNumber = big.NewInt(1)
MockHeader = types.Header{ MockHeader = types.Header{
Time: 0, Time: 0,
Number: BlockNumber, Number: new(big.Int).Set(BlockNumber),
Root: common.HexToHash("0x0"), Root: common.HexToHash("0x0"),
TxHash: common.HexToHash("0x0"), TxHash: common.HexToHash("0x0"),
ReceiptHash: common.HexToHash("0x0"), ReceiptHash: common.HexToHash("0x0"),
@ -298,7 +298,7 @@ var (
} }
MockStateDiff = statediff.StateObject{ MockStateDiff = statediff.StateObject{
BlockNumber: BlockNumber, BlockNumber: new(big.Int).Set(BlockNumber),
BlockHash: MockBlock.Hash(), BlockHash: MockBlock.Hash(),
Nodes: StateDiffs, Nodes: StateDiffs,
} }
@ -414,7 +414,7 @@ var (
} }
MockCIDWrapper = &eth.CIDWrapper{ MockCIDWrapper = &eth.CIDWrapper{
BlockNumber: big.NewInt(1), BlockNumber: new(big.Int).Set(BlockNumber),
Header: eth.HeaderModel{ Header: eth.HeaderModel{
BlockNumber: "1", BlockNumber: "1",
BlockHash: MockBlock.Hash().String(), BlockHash: MockBlock.Hash().String(),
@ -459,7 +459,7 @@ var (
StorageIPLD, _ = blocks.NewBlockWithCid(StorageLeafNode, StorageCID) StorageIPLD, _ = blocks.NewBlockWithCid(StorageLeafNode, StorageCID)
MockIPLDs = eth.IPLDs{ MockIPLDs = eth.IPLDs{
BlockNumber: big.NewInt(1), BlockNumber: new(big.Int).Set(BlockNumber),
Header: ipfs.BlockModel{ Header: ipfs.BlockModel{
Data: HeaderIPLD.RawData(), Data: HeaderIPLD.RawData(),
CID: HeaderIPLD.Cid().String(), CID: HeaderIPLD.Cid().String(),
@ -533,7 +533,7 @@ func createTransactionsAndReceipts() (types.Transactions, types.Receipts, common
trx1 := types.NewTransaction(0, Address, big.NewInt(1000), 50, big.NewInt(100), []byte{}) trx1 := types.NewTransaction(0, Address, big.NewInt(1000), 50, big.NewInt(100), []byte{})
trx2 := types.NewTransaction(1, AnotherAddress, big.NewInt(2000), 100, big.NewInt(200), []byte{}) trx2 := types.NewTransaction(1, AnotherAddress, big.NewInt(2000), 100, big.NewInt(200), []byte{})
trx3 := types.NewContractCreation(2, big.NewInt(1500), 75, big.NewInt(150), []byte{0, 1, 2, 3, 4, 5}) trx3 := types.NewContractCreation(2, big.NewInt(1500), 75, big.NewInt(150), []byte{0, 1, 2, 3, 4, 5})
transactionSigner := types.MakeSigner(params.MainnetChainConfig, BlockNumber) transactionSigner := types.MakeSigner(params.MainnetChainConfig, new(big.Int).Set(BlockNumber))
mockCurve := elliptic.P256() mockCurve := elliptic.P256()
mockPrvKey, err := ecdsa.GenerateKey(mockCurve, rand.Reader) mockPrvKey, err := ecdsa.GenerateKey(mockCurve, rand.Reader)
if err != nil { if err != nil {

View File

@ -34,7 +34,7 @@ func init() {
func setTestConfig() { func setTestConfig() {
vip := viper.New() vip := viper.New()
vip.SetConfigName("testing") vip.SetConfigName("testing")
vip.AddConfigPath("$GOPATH/src/github.com/vulcanize/vulcanizedb/environments/") vip.AddConfigPath("$GOPATH/src/github.com/vulcanize/ipfs-blockchain-watcher/environments/")
if err := vip.ReadInConfig(); err != nil { if err := vip.ReadInConfig(); err != nil {
logrus.Fatal(err) logrus.Fatal(err)
} }