From 7ed4dcd1fa7cd8d586b7b4cb74baf4a2015e8f9a Mon Sep 17 00:00:00 2001 From: Rob Mulholand Date: Tue, 5 Mar 2019 10:12:28 -0600 Subject: [PATCH] Remove Tic logic --- libraries/shared/constants/data.go | 4 ---- libraries/shared/repository/repository.go | 12 ------------ pkg/fakes/data.go | 3 --- 3 files changed, 19 deletions(-) diff --git a/libraries/shared/constants/data.go b/libraries/shared/constants/data.go index 1e87e5ee..1011736a 100644 --- a/libraries/shared/constants/data.go +++ b/libraries/shared/constants/data.go @@ -17,7 +17,3 @@ package constants var DataItemLength = 32 - -// TODO: Move to Plugin -// TODO: Grab this from DB, since it can change through governance -var TTL = int64(10800) // 60 * 60 * 3 == 10800 seconds == 3 hours diff --git a/libraries/shared/repository/repository.go b/libraries/shared/repository/repository.go index fe8aaa4f..00cedddb 100644 --- a/libraries/shared/repository/repository.go +++ b/libraries/shared/repository/repository.go @@ -155,15 +155,3 @@ func CreateNotCheckedSQL(boolColumns []string, recheckHeaders constants.Transfor return result.String() } - -// TODO: Move to plugin -func GetTicInTx(headerID int64, tx *sql.Tx) (int64, error) { - var blockTimestamp int64 - err := tx.QueryRow(`SELECT block_timestamp FROM public.headers WHERE id = $1;`, headerID).Scan(&blockTimestamp) - if err != nil { - return 0, err - } - - tic := blockTimestamp + constants.TTL - return tic, nil -} diff --git a/pkg/fakes/data.go b/pkg/fakes/data.go index 07492d40..32eff1d3 100644 --- a/pkg/fakes/data.go +++ b/pkg/fakes/data.go @@ -24,7 +24,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/vulcanize/vulcanizedb/libraries/shared/constants" "github.com/vulcanize/vulcanizedb/pkg/core" ) @@ -49,5 +48,3 @@ func GetFakeHeader(blockNumber int64) core.Header { Timestamp: strconv.FormatInt(fakeTimestamp, 10), } } - -var FakeHeaderTic = fakeTimestamp + constants.TTL