Conversation
d8c0e10 to
fb665f4
Compare
|
|
||
| addrID, addrErr := shared.GetOrCreateAddress("0x87e76b0a50efc20259cafE0530f75aE0e816aaF2", db) | ||
| Expect(addrErr).NotTo(HaveOccurred()) | ||
| Expect(err).NotTo(HaveOccurred()) |
| return err | ||
| } | ||
|
|
||
| var insertUserPieDiff diffInserter = func(addressID int64, tx *sqlx.Tx) error { |
| queryErr := db.Get(&count, query) | ||
| Expect(queryErr).NotTo(HaveOccurred()) | ||
| Expect(count).To(Equal(1)) | ||
| }) |
There was a problem hiding this comment.
Why not uses the shared behaviors here?
There was a problem hiding this comment.
The "persists a record" test is more complex than the shared test suite, because it has to deal with the address FK. But the "duplicate record" test is identical to the one in the shared suite, so maybe it would be worth breaking apart the shared test suite to allow us to extract only the "duplicate record" one in cases like these.
There was a problem hiding this comment.
ah, that makes sense - would be interested in refactors that make it easier to use the shared tests for fields including a FK, but definitely doesn't need to be a part of this PR 👍
| UNION | ||
| SELECT addresses.address | ||
| FROM maker.pot_exit | ||
| LEFT JOIN public.addresses ON pot_exit.msg_sender = addresses.id`) |
There was a problem hiding this comment.
Seems legit and follows the pattern we've used, but there should never be an address exiting without a prior join - right? Totally fine with leaving things as is to avoid errors from missed events, just curious
There was a problem hiding this comment.
Yeah, totally! I hadn't really thought about that. Hopefully one day we'll have a node so reliable that we won't need to be redundant :)
fb665f4 to
18d5d35
Compare
- Use schema and table name constants
18d5d35 to
2d4c9b6
Compare
I also had to go back and add
msg.senderto thejoinandexitevents, since I forgot to include it when I initially wrote those event transformers.Also I don't have any storage diffs handy, so I fudged the component tests, but it should be pretty easy to go back and amend them if we get ahold of any real diffs.