Skip to content

Add urn_bid_events query#105

Merged
gslaughl merged 1 commit intostagingfrom
vdb-1012-urn-bid-events
Feb 4, 2020
Merged

Add urn_bid_events query#105
gslaughl merged 1 commit intostagingfrom
vdb-1012-urn-bid-events

Conversation

@gslaughl
Copy link
Copy Markdown
Contributor

@gslaughl gslaughl commented Feb 2, 2020

No description provided.

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.

LGTM!


bidOneID = rand.Int()
bidTwoID = rand.Int()
flipIlkMetadata := types.GetValueMetadata(storage.Ilk, nil, types.Bytes32)
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.

Any reason not to use flip.IlkMetadata 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.

Nope! :D

ethBidUsrErr := repo.Create(diffID, headerOneID, flipBidUsrMetadata, usrOne)
Expect(ethBidUsrErr).NotTo(HaveOccurred())

flipBidUsrMetadata.Keys[constants.BidId] = strconv.Itoa(bidTwoID)
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 I'd be tempted to create a new metadata object for bidTwoID so that there's less risk of these tests failing if the order of operations are modified (e.g. if this assignment happened before the insert on line 49)

Expect(err).NotTo(HaveOccurred())

Expect(actualEvents).To(ConsistOf(expectedFlip))
})
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.

Reluctant to suggest this because these tests already require some weighty setup, but I think it'd be good to add a row for a different ilk and verify that we're correctly filtering on that field

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.

One other test that might provide helpful documentation could mention that it provides results from multiple auctions for an urn (if that urn has been flipped several times)

Copy link
Copy Markdown
Contributor

@elizabethengelman elizabethengelman left a comment

Choose a reason for hiding this comment

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

I like @rmulhol suggestions about the query test additions, but other than that this LGTM! :shipit:

@elizabethengelman elizabethengelman self-requested a review February 3, 2020 19:22
@gslaughl gslaughl force-pushed the vdb-1012-urn-bid-events branch from 47d9282 to ed2c431 Compare February 4, 2020 14:59
@gslaughl gslaughl force-pushed the vdb-1012-urn-bid-events branch from ed2c431 to 450e13e Compare February 4, 2020 17:51
@gslaughl gslaughl merged commit c54fa12 into staging Feb 4, 2020
@gslaughl gslaughl deleted the vdb-1012-urn-bid-events branch February 4, 2020 18:12
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