VDB-120 include tic in dent and tend (#118)

* Add constants for TTL and tic for fakeHeader

* Add tic to tend transformer

* Update tests for tend

* Fix string conversion bug in fakes

* Fix tend integration tests after staging rebase

* Add tic to dent transformer

* Update dent tests

* Change integration tests to use hardcoded block timestamp
This commit is contained in:
Edvard Hübinette
2018-11-15 12:57:29 +01:00
committed by GitHub
parent 8f4648a9e3
commit 40408e8300
15 changed files with 86 additions and 35 deletions
+9 -4
View File
@@ -6,18 +6,21 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/vulcanize/vulcanizedb/pkg/core"
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
"strconv"
)
var (
FakeError = errors.New("failed")
FakeHash = common.BytesToHash([]byte{1, 2, 3, 4, 5})
FakeError = errors.New("failed")
FakeHash = common.BytesToHash([]byte{1, 2, 3, 4, 5})
fakeTimestamp = int64(111111111)
)
var rawFakeHeader, _ = json.Marshal(types.Header{})
var FakeHeader = core.Header{
Hash: FakeHash.String(),
Raw: rawFakeHeader,
Timestamp: "111111111",
Timestamp: strconv.FormatInt(fakeTimestamp, 10),
}
func GetFakeHeader(blockNumber int64) core.Header {
@@ -25,6 +28,8 @@ func GetFakeHeader(blockNumber int64) core.Header {
Hash: FakeHash.String(),
BlockNumber: blockNumber,
Raw: rawFakeHeader,
Timestamp: "111111111",
Timestamp: strconv.FormatInt(fakeTimestamp, 10),
}
}
var FakeHeaderTic = fakeTimestamp + constants.TTL