Skip to content

(VDB-1038) Add Pot drip transformer#64

Merged
rmulhol merged 1 commit intostagingfrom
vdb-1038-pot-drip
Dec 17, 2019
Merged

(VDB-1038) Add Pot drip transformer#64
rmulhol merged 1 commit intostagingfrom
vdb-1038-pot-drip

Conversation

@rmulhol
Copy link
Copy Markdown
Contributor

@rmulhol rmulhol commented Dec 13, 2019

No description provided.

Copy link
Copy Markdown
Contributor

@gslaughl gslaughl left a comment

Choose a reason for hiding this comment

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

A couple nitpicks + questions, but LGTM! 🚢

google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
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 want to check this in?

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 so, but would be happy to remove if others disagree. As I understand it, the purpose of the go.sum is to cache the checksums of all deps - so it seems like we should include basically anything that's added other than sensitive/private files.

Comment on lines +6 to +7
log_id BIGINT NOT NULL REFERENCES header_sync_logs (id) ON DELETE CASCADE,
msg_sender INTEGER NOT NULL REFERENCES addresses (id) ON DELETE CASCADE,
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.

Postgraphile will probably ask for indexes on log_id and msg_sender

"github.com/makerdao/vdb-mcd-transformers/transformers/shared/constants"
"github.com/makerdao/vulcanizedb/libraries/shared/factories/event"
"github.com/makerdao/vulcanizedb/pkg/core"
"math/rand"
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.

nbd but goimports could help out here

msgSender := common.BytesToAddress(log.Log.Topics[1].Bytes()).Hex()
addressId, addressErr := shared.GetOrCreateAddress(msgSender, db)
if addressErr != nil {
_ = shared.ErrCouldNotCreateFK(addressErr)
Copy link
Copy Markdown
Contributor

@gslaughl gslaughl Dec 16, 2019

Choose a reason for hiding this comment

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

We probably want to return the error here

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!

Address: common.HexToAddress(PotAddress()),
Topics: []common.Hash{
common.HexToHash(constants.PotDripSignature()),
common.HexToHash("0x00000000000000000000000087e76b0a50efc20259cafe0530f75ae0e816aaf2"),
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 this approach of not including more topics than necessary in our test data. Now that I think about it, would it make sense to omit the Data field on line 19 for converters that don't need log data?

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.

tbh I removed them because I saw some error when they were included. But I'm not able to reproduce that and thinking maybe I copy/pasted the empty topics wrong. I'm inclined to re-add them and keep everything to accurately simulate what we'd expect over the RPC

@rmulhol rmulhol merged commit 32eacee into staging Dec 17, 2019
@rmulhol rmulhol deleted the vdb-1038-pot-drip branch December 17, 2019 15:56
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.

2 participants