-
Notifications
You must be signed in to change notification settings - Fork 33
Conversation
d1c4d50
to
b169d70
Compare
@@ -24,7 +24,6 @@ import ( | |||
type Repository interface { | |||
Create(headerID int64, models []interface{}) error | |||
MarkHeaderChecked(headerID int64) error | |||
MissingHeaders(startingBlockNumber, endingBlockNumber int64) ([]core.Header, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -37,7 +36,7 @@ func (transformer Transformer) NewTransformer(db *postgres.DB) transformer.Event | |||
return transformer | |||
} | |||
|
|||
func (transformer Transformer) Execute(logs []types.Log, header core.Header, recheckHeaders constants.TransformerExecution) error { | |||
func (transformer Transformer) Execute(logs []types.Log, header core.Header) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This recheckHeaders
argument is not being used in this Execute
method.
b169d70
to
48afe39
Compare
48afe39
to
adf91df
Compare
@@ -69,31 +69,6 @@ func MissingHeaders(startingBlockNumber, endingBlockNumber int64, db *postgres.D | |||
return result, err | |||
} | |||
|
|||
func RecheckHeaders(startingBlockNumber, endingBlockNumber int64, db *postgres.DB, checkedHeadersColumn string) ([]core.Header, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this method wasn't being called any longer.
Also, something else I hadn't realized previously was that in order to allow for rechecking headers, we need to pass in a CLI argument --recheck-headers
when running composeAndExecute
. 🌠
|
||
var result bytes.Buffer | ||
|
||
func CreateHeaderCheckedPredicateSQL(boolColumns []string, recheckHeaders constants.TransformerExecution) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored this method into two smaller ones & changed the name as I was trying to understand how it was working. If folks don't find this refactoring helpful, I'm happy to undo it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes more sense this way 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing dead code, my favorite 🎉 👍 🥇
@@ -153,10 +149,11 @@ var _ = Describe("Repository", func() { | |||
}) | |||
|
|||
AfterEach(func() { | |||
test_config.CleanCheckedHeadersTable(db, getExpectedColumnNames()) | |||
//test_config.CleanCheckedHeadersTable(db, getExpectedColumnNames()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to remove this AfterEach
entirely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh nice catch! i think I commented this out so I could get some data in my test db - I think it should still hang around.
actual := shared.CreateNotCheckedSQL(columns, constants.HeaderMissing) | ||
Expect(actual).To(Equal(expected)) | ||
}) | ||
Describe("CreateCustomColumnNamesSQL", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be "CreateHeaderCheckedPredicateSQL"
?
expected := fmt.Sprintf("NOT (columnA>=%s AND columnB>=%s)", constants.RecheckHeaderCap, constants.RecheckHeaderCap) | ||
actual := shared.CreateNotCheckedSQL(columns, constants.HeaderRecheck) | ||
Expect(actual).To(Equal(expected)) | ||
Describe("RecheckHeadersCustomColumnNames", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe rephrase to clarify how it's different from the above Describe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and I echo Rob's sentiment about removing dead code :) :)
|
||
var result bytes.Buffer | ||
|
||
func CreateHeaderCheckedPredicateSQL(boolColumns []string, recheckHeaders constants.TransformerExecution) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes more sense this way 💯
No description provided.