Skip to content

VDB-1599 cat file box [beta]#282

Merged
elizabethengelman merged 8 commits intobetafrom
vdb-1599-cat-file-box
Sep 3, 2020
Merged

VDB-1599 cat file box [beta]#282
elizabethengelman merged 8 commits intobetafrom
vdb-1599-cat-file-box

Conversation

@elizabethengelman
Copy link
Copy Markdown
Contributor

No description provided.

@elizabethengelman elizabethengelman marked this pull request as draft August 31, 2020 22:07
@elizabethengelman elizabethengelman force-pushed the vdb-1599-cat-file-box branch 2 times, most recently from 8dbc222 to a3ac8d6 Compare August 31, 2020 22:18
@elizabethengelman elizabethengelman marked this pull request as ready for review September 1, 2020 13:37
@elizabethengelman elizabethengelman requested review from paytonrules, rmulhol and yaoandrew and removed request for paytonrules and rmulhol September 1, 2020 13:37
@elizabethengelman elizabethengelman changed the title Vdb 1599 cat file box [beta] VDB-1599 cat file box [beta] Sep 1, 2020
Transformer: vow.Transformer{},
Describe("1.1.0 Cat Contract", func() {
var catFileConfig = event.TransformerConfig{
ContractAddresses: []string{test_data.Cat110Address()},
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a good example of how this may be confusing/unclear to future developers - like for testing cat_file_box we have to use the 1.1.0 version. But for the other events, we could use either contract, and I'm not sure that this is really clear anywhere in the code. I don't have a good idea on how to clarify this some, but just wanted to point it out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, just thinking that maybe it would be good to include tests for the other events, but for 1.1.0. 🤔

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally. I'm confused 🤪 just thinking about this. So for something like cat_file_vow that exists in both versions and is unchanged, we won't duplicate those tests for 1.1.0? And since cat_file_box was introduced in 1.1.0 we'll only have tests for it there? We should probably see how this plays out as we make changes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we'd end up duplicating tests for 1.1.0... which isn't ideal either. I'm good with holding off with making that change for now, and seeing how the rest of these changes pan out before making a decision.

"github.com/makerdao/vdb-mcd-transformers/transformers/test_data"
"github.com/makerdao/vulcanizedb/pkg/core"

//"github.com/makerdao/vdb-mcd-transformers/transformers/events/cat_file/box"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need these commented out imports?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch! 🙈

Expect(CatFileVowSignature()).To(Equal("0xd4e8be8300000000000000000000000000000000000000000000000000000000"))
})

It("generates cat file box signature", func() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be in a different place alphabetically? This is probably super OCD and obviously non-blocking 😅

yaoandrew
yaoandrew previously approved these changes Sep 2, 2020
Copy link
Copy Markdown
Contributor

@yaoandrew yaoandrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM all non-blocking comments :shipit: 🚀

models, toModelsErr := transformer.ToModels(constants.Cat110ABI(), []core.EventLog{test_data.CatFileBoxEventLog}, db)
Expect(toModelsErr).NotTo(HaveOccurred())

contractAddressID, msgSenderErr := shared.GetOrCreateAddress(test_data.Cat110Address(), db)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 I like the way this reads much better. I was putting something like this in my tests - shared.GetOrCreateAddress(test_data.CatFileBoxEventLog.Log.Address.Hex(), db)

yaoandrew
yaoandrew previously approved these changes Sep 2, 2020
func (e exporter) Export() ([]event.TransformerInitializer, []storage.TransformerInitializer, []interface1.ContractTransformerInitializer) {
return []event.TransformerInitializer{},
return []event.TransformerInitializer{
cat_file_box.EventTransformerInitializer,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be removed from this file if we don't want to kick off a backfill

"github.com/makerdao/vulcanizedb/pkg/core"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nbd but I don't think these newlines are necessary in the imports

Copy link
Copy Markdown
Contributor

@rmulhol rmulhol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@elizabethengelman elizabethengelman merged commit 1697f7c into beta Sep 3, 2020
@elizabethengelman elizabethengelman deleted the vdb-1599-cat-file-box branch September 3, 2020 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants