Commit Graph

378 Commits

Author SHA1 Message Date
Rob Mulholand
47a3c35938 Use transformer factory for Price Feed events 2018-10-26 11:25:16 -05:00
Elizabeth
bd428e752a Update vat grab to use transformer factory (#85)
* Update vat grab to use transformer factory
2018-10-26 11:02:39 -05:00
Rob Mulholand
745b3a460e Add test for updating existing checked header row 2018-10-26 10:45:49 -05:00
Rob Mulholand
e37447ae9a Use transformer factory for Vat fold 2018-10-26 10:45:49 -05:00
Takayuki Goto
0e7f316568 flip kick integration test (#83)
* flip kick integration test

* use timestamp instead to compare date

* fix after rebase staging
2018-10-26 10:26:22 -05:00
Rob Mulholand
3ec5b4afab Remove unused param in integration test helper 2018-10-25 10:02:06 -05:00
Rob Mulholand
8831586fba Extract shared mock converter and repository 2018-10-25 10:02:06 -05:00
Rob Mulholand
f5b9a21a8c Use transformer factory for Vat slip 2018-10-25 10:02:06 -05:00
Rob Mulholand
1e7ee08af5 Use transformer factory for Vat toll 2018-10-25 10:02:06 -05:00
Rob Mulholand
6d662a6ce7 Add test for can't create Vat tune of wrong type 2018-10-25 10:02:06 -05:00
Rob Mulholand
a0cae99437 Use transformer factory for Vat flux 2018-10-25 10:02:06 -05:00
Edvard Hübinette
be249437c2 VDB-117: Add Vow.flog transformer (#80)
* Add DB migrations for flog

* Add Vow addresses and constants

* Add err logging to ABI signature getter, test for flog sig

* Add flog transformer

* Add tests+data for flog transformer

* Prepend DB tables and columns with vow_

* Panic on failure to get method sig
2018-10-25 12:19:46 +02:00
Rob Mulholand
78d746bb5b Use transformer factory for Vat tune 2018-10-24 15:49:19 -05:00
Elizabeth
5682ee988b Add log index to various events (#78)
* Add log_index field to flip kick

* Add log index to flop kick

* Add repo tests for Cat.file

* Add log_index to vat_flux

* Add log_index to vat_slip

* Add log_index to vat_toll

* Add log_index to vat_tune

* Add test to repos for updating checked headers
2018-10-23 16:33:04 -05:00
Takayuki Goto
28f8861f81 Merge pull request #71 from 8thlight/VDB-150-vat-flux-integration-test
integration test for vat flux
2018-10-23 16:01:42 -05:00
Rob Mulholand
42d60c3cbd Add log index to Vat move 2018-10-23 15:25:21 -05:00
Rob Mulholand
4ac896c246 Add log index to Vat init 2018-10-23 15:25:21 -05:00
Rob Mulholand
702f90367a Add log index to Vat heal 2018-10-23 15:25:21 -05:00
Rob Mulholand
650bbf5874 Add log index to Vat grab 2018-10-23 15:25:21 -05:00
Rob Mulholand
1e74c73591 Add log index to Vat fold 2018-10-23 15:25:21 -05:00
Rob Mulholand
db52955669 Add log index to Tend 2018-10-23 15:25:21 -05:00
Rob Mulholand
e0253cce55 Add log index to Price Feed events 2018-10-23 15:25:21 -05:00
Rob Mulholand
a0a86871b5 Add log index to Frob 2018-10-23 15:25:21 -05:00
Rob Mulholand
b3d00fe3c5 Add log index to Pit file events 2018-10-23 15:25:21 -05:00
Edvard
a0deb5eb62 Add and use transformer labels in shared constants 2018-10-23 11:23:31 +02:00
Edvard
f55449d0e5 Replace GinkgoRandomSeed with proper randomisation 2018-10-23 10:47:01 +02:00
Edvard
794a7e5f99 Nuke some leftover converter interfaces 2018-10-23 10:47:01 +02:00
Edvard
6d9547a888 Fix invalidated test for tend repository 2018-10-23 10:47:01 +02:00
Edvard
7ee3329baf Privatise DB repository field and add transformer test 2018-10-23 10:47:01 +02:00
Edvard
cb74cbe990 Add cast error checking to refactored transformers 2018-10-23 10:47:01 +02:00
Edvard
b7f8432e65 Fix git whitespace warnings 2018-10-23 10:47:00 +02:00
Edvard
bb204b6b14 Remove unnecessary type washing in factory transformer 2018-10-23 10:45:48 +02:00
Edvard
e7e511764e Implement skip to next header on empty matchingLogs 2018-10-23 10:45:48 +02:00
Edvard
33f1f62c11 Implement SingleTransformerConfig 2018-10-23 10:45:48 +02:00
Edvard
7d3bf1f0f6 Fixes after rebase 2018-10-23 10:45:48 +02:00
Edvard
70722fc9e3 Add todo for changing to single topic in shared transformer config 2018-10-23 10:45:48 +02:00
Edvard
2a9fafca08 Update drip_file tests 2018-10-23 10:45:48 +02:00
Edvard
dc4eb009c1 Refactor drip_file transformers 2018-10-23 10:45:48 +02:00
Edvard
ccca6e0229 Update old pit file shared config references 2018-10-23 10:43:03 +02:00
Edvard
d9b6603109 Update pit file debt ceiling tests 2018-10-23 10:43:03 +02:00
Edvard
24199cb67e Refactor pit file debt ceiling transformer 2018-10-23 10:43:03 +02:00
Edvard
0239c4daf6 Fix sneaky missing asterisk 2018-10-23 10:43:03 +02:00
Edvard
399b3b78a0 Update tests for pit file ilk transformer 2018-10-23 10:43:03 +02:00
Edvard
98062a7970 Refactor pit file ilk transfomer 2018-10-23 10:43:03 +02:00
Edvard
837a777c8a Update transformer name for stability fee 2018-10-23 10:43:03 +02:00
Edvard
3412866182 Update tests for stability_fee 2018-10-23 10:43:03 +02:00
Edvard
2cc303a2f5 Refactor stability_fee transfomer 2018-10-23 10:43:03 +02:00
Edvard
57b3744085 Update tend tests 2018-10-23 10:43:03 +02:00
Edvard
a4df8f348d Refactor Tend transformer using factory 2018-10-23 10:43:03 +02:00
Edvard
4d36f6200d Further refactor move and init tests 2018-10-23 10:43:03 +02:00
Edvard
c4d3783f8b Expand error logging in transformer 2018-10-23 10:43:03 +02:00
Edvard
719ffd5819 Update vat init tests for factory 2018-10-23 10:43:03 +02:00
Edvard
fedbce80f6 Refactor vat init transformer to use factory 2018-10-23 10:43:03 +02:00
Edvard
177d212cc4 Add SetDB test for vat move 2018-10-23 10:43:03 +02:00
Edvard
32654ffabc Add transformer name to config for logging in factory transformer 2018-10-23 10:43:03 +02:00
Edvard
46d8ea8d97 Snag transformer topics from config in factory 2018-10-23 10:43:03 +02:00
Edvard
155569a1d8 Update vat_move tests 2018-10-23 10:43:03 +02:00
Edvard
af1dfbc489 Implement vat_move transformer using factory 2018-10-23 10:43:03 +02:00
Edvard
15e33db33d Fix transformer factory 2018-10-23 10:43:03 +02:00
Edvard
1b9e6491da Add transformer factory 2018-10-23 10:43:03 +02:00
Elizabeth
954fcf2378 integration tests (#75)
* Deal integration test

* Add LogIndex to CatFileChopLump to update unique constraint

* Add LogIndex to cat_file_pit_vow records

* Add integration tests for Cat.file transformers

* Add log index to Cat.file flip
2018-10-22 13:28:42 -05:00
Rob Mulholand
d87fb14c6b Add log index to Drip file events 2018-10-22 12:14:43 -05:00
Rob Mulholand
de294ad8ea Add log index to Drip drip 2018-10-22 12:14:43 -05:00
Rob Mulholand
e5ba0496a6 Add log index to Dent 2018-10-22 12:14:43 -05:00
Rob Mulholand
1aafb7201e Add log index to Deal 2018-10-22 12:14:43 -05:00
Rob Mulholand
495f39abb8 Add log index to Bite 2018-10-22 12:14:43 -05:00
Rob Mulholand
ea3de51792 Add Flop kick integration test 2018-10-19 14:21:57 -05:00
Rob Mulholand
fa828cf041 Add Tend integration test 2018-10-19 14:21:57 -05:00
Rob Mulholand
cbb5ffa3c7 Add Pit file stability fee integration test 2018-10-19 14:21:57 -05:00
Rob Mulholand
3449a1e246 Add Pit file debt ceiling integration test 2018-10-19 14:21:57 -05:00
Rob Mulholand
a83bf5ed0d Add Pit file ilk integration test 2018-10-19 14:21:57 -05:00
Rob Mulholand
677e78891d Add Drip file vow integration test 2018-10-19 14:21:57 -05:00
Rob Mulholand
0ce3e3d829 Add Bite integration test 2018-10-19 14:21:57 -05:00
Rob Mulholand
ddc7ee5143 Add Drip drip integration test 2018-10-19 10:56:28 -05:00
Rob Mulholand
b067ba565e Add Vat fold integration test 2018-10-19 10:56:28 -05:00
Rob Mulholand
fdbe0b0b44 Add Vat heal integration test 2018-10-19 10:56:28 -05:00
Rob Mulholand
a7b9b825c8 Add Vat init integration test 2018-10-19 10:56:28 -05:00
Rob Mulholand
9b427ea1e9 Add Vat move integration test 2018-10-19 10:56:28 -05:00
Taka Goto
21088eb3a2 integration test for vat flux 2018-10-17 16:25:12 -05:00
Konstantin Zolotarev
b38c29ce43 Merge pull request #64 from 8thlight/contract_addresses
Added configuration for contract addresses
2018-10-17 21:34:25 +03:00
Rob Mulholand
130d11d0aa Add Vat slip transformer 2018-10-17 13:30:35 -05:00
Elizabeth
3baca64903 Update address formatting (#67)
* Add getSignatures command for list of signatures in constants

* Update VatTune converter's formatting of addresses

and added an integration test

* Move VatTune and PriceFeeds integration tests to a common suite

* Update VatGrab converter for address format

* Update frob converter to fix urn and ilk formatting/decoding

* Update formatting

* Update make test command and add integrationtest command

* Add integration test to travis build

* Update creating headers in integration tests to include Raw and Timestamp fields
2018-10-17 13:04:55 -05:00
Taka Goto
4721a91faa use before each for transformer test 2018-10-17 12:15:15 -05:00
Taka Goto
a3ca319e9b remove unnecessary byte slicing 2018-10-17 12:04:11 -05:00
Taka Goto
2f64269ab3 update from pr feedback; update tests and use shared fake header 2018-10-17 11:48:57 -05:00
Taka Goto
f32a4fa2a5 use kovan vat contract address 2018-10-17 10:55:30 -05:00
Taka Goto
2e72a7e940 vat flux transformer 2018-10-17 10:53:53 -05:00
Rob Mulholand
d0226dbce5 Convert Bite event field types to numeric
- Enables arithmetic operations when constructing views
- Also removes application-level references to DB ID
2018-10-16 15:27:13 -05:00
Rob Mulholand
d3df685c46 Add timestamp to block header
- Enables quickly deriving timestamp from header for log events
2018-10-12 12:00:02 -05:00
Rob Mulholand
5f67161f41 Convert raw header to JSON
- Enables parsing values off of header via Postgres migration
2018-10-12 12:00:02 -05:00
Edvard Hübinette
be58dd4ac8 Add vat_move transformer (#47)
* Add vat_move transformer base

* Add vat_move migrations

* Add test data for vat_move

* Add vat_move transformer to initialisers

* Add numeric cast to psql insert of Rad

* Add new db schema

* Dependency update

* Expand abbreviation in repository

* Add test suite for vat_move

* Add header checking to transformer and mock repository

* Remove trailing zero in test data

* Fix minor mishaps

* Go fmt nitpicking

* Refactoring in tests

* Add tests covering checked headers stuff (and fix revealed bugs)

* go fmt fixes

* Implement batching behaviour of transformer

* Small fixes after review

* Go fmt
2018-10-12 16:13:13 +02:00
Konstantin Zolotarev
0b281eab47 Added default addresses to config & rename fallback var 2018-10-12 11:11:31 +03:00
Konstantin Zolotarev
245732b7f4 Added configuration for contract addresses 2018-10-11 19:10:53 +03:00
Elizabeth
6c77f369d9 Vat heal (#56)
* VatHeal Converter

* Add VatHeal repository

* Add VatHeal transformer

* Add VatHeal to continuousLogSync command

* Mark vat_init_checked as true when creating vat init records

* Update urn and v converting

* Return error if Repository.MarkCheckedHeader fails

* Add deleting vat heal from test cleanup method
2018-10-10 11:56:06 -05:00
David Terry
0bb3737027 vat.fold: pull common test setup into BeforeEach blocks 2018-10-10 18:13:10 +03:00
David Terry
b1745a6403 Merge branch 'staging' into VDB-101-vat-fold-transformer
Conflicts:
	cmd/continuousLogSync.go
	db/schema.sql
	pkg/transformers/shared/constants.go
	pkg/transformers/transformers.go
	test_config/test_config.go
2018-10-10 14:09:14 +03:00
David Terry
89ec0a1cab documentation: document config file for transformers 2018-10-10 14:06:00 +03:00
David Terry
95f1c94bf5 vat.fold: check for errors in insert before updating checked_headers 2018-10-10 14:03:37 +03:00
David Terry
1273acb733 vat.fold: add repository tests for MarkHeaderChecked 2018-10-10 13:51:44 +03:00
David Terry
3778d7ac06 vat.fold: add transformer tests for MarkHeaderChecked 2018-10-10 13:40:25 +03:00
David Terry
7e7ad13de6 vat.fold: handle errors 2018-10-10 13:39:33 +03:00
David Terry
dde57178f1 vat.fold: break out of loop in transformer if no logs found 2018-10-10 13:38:57 +03:00
David Terry
724839ce4a documentation: document vat event types 2018-10-10 13:37:59 +03:00
Rob Mulholand
e935f2f553 Add Vat grab transformer 2018-10-09 16:48:19 -05:00
Rob Mulholand
61dca314c4 Add Vat tune transformer 2018-10-09 14:37:26 -05:00
Rob Mulholand
8ee106e14d Add Vat toll transformer 2018-10-09 11:40:35 -05:00
David Terry
ecef1cbcdb transformers: add step by step docs 2018-10-09 14:25:27 +03:00
David Terry
09770b2e50 Merge branch 'staging' into VDB-101-vat-fold-transformer 2018-10-09 14:15:07 +03:00
David Terry
81dec589fc vat.fold: rollback broken test refactoring 2018-10-09 14:11:02 +03:00
David Terry
e040383fa5 vat.fold: add test for signature generation 2018-10-09 14:10:42 +03:00
David Terry
3e9901864b vat.fold: switch to batched interface 2018-10-09 13:34:22 +03:00
Taka Goto
347a339687 update frob and bite converters and repository 2018-10-07 22:02:14 -05:00
Taka Goto
7e6302c662 update bite to take in string for urn and ilk 2018-10-04 16:35:51 -05:00
David Terry
b3e2218eb5 Merge branch 'staging' into VDB-101-vat-fold-transformer 2018-10-04 18:49:38 +03:00
David Terry
53a74c39f7 Vat.fold: correct typo 2018-10-04 17:47:03 +03:00
David Terry
dde57ea70b Vat.fold: run transformer 2018-10-04 16:04:53 +03:00
David Terry
c8cb079da5 Vat.fold: add transformer & mocks 2018-10-04 14:34:30 +03:00
David Terry
46bba30938 Vat.fold: refactor repository tests 2018-10-03 19:38:47 +02:00
David Terry
ef0e3f9e11 Vat.fold: add repository & tests 2018-10-03 18:22:05 +02:00
David Terry
0c58e0ac5b Vat.fold: verify that the event signature is correct 2018-10-03 18:21:27 +02:00
David Terry
96f8279421 Vat.fold: update test data so it matches a real deployed kovan event 2018-10-03 16:03:30 +02:00
David Terry
b3295e3a86 Vat.fold: add converter & tests 2018-10-03 14:08:01 +02:00
David Terry
ce4d928fb8 transformers: tweak docs 2018-10-03 14:07:32 +02:00
David Terry
22fb019d3f docs: add links 2018-10-03 12:50:28 +02:00
David Terry
377c57ce1b transformers: format documentation 2018-10-03 12:44:05 +02:00
Rob Mulholand
bf44ec614a Log checked headers for MCD events (#43)
* Log checked headers for Bite events

* Log checked headers for Drip drip events

* Log checked headers for Drip file events

- mark headers checked for 3 implementations of file on the Drip contract

* Log checked headers for Frob frob events

* Log checked headers for Pit file events

- mark headers checked for 3 implementations of file on the Pit contract

* Log checked headers for Vat init events
2018-10-02 17:25:38 -05:00
David Terry
cf437e4007 VDB-101: Add signature for vat.fold 2018-09-28 16:31:29 +02:00
David Terry
f56c882b9d increase timeout on price feeds integration tests 2018-09-28 14:19:40 +02:00
Rob Mulholand
02853014b2 Fix Pit file converters
- Use topics 2 & 3 instead of topic 1 (call data instead of msg.sender)
- Prefer extracting fields from topics rather than data
2018-09-27 10:32:08 -05:00
Rob Mulholand
c17ad1f826 Add missing Describe statements 2018-09-27 10:32:08 -05:00
Rob Mulholand
58f17a24ae Add transformers for Cat file events
- transform logs from 3 implementations of file on the Cat contract
2018-09-27 10:32:08 -05:00
Elizabeth
b0cd852aa3 Flop deal (#39)
*Refactor deal transformer to take in several contract addresses
* Add flop address to deal transformer
2018-09-27 10:12:29 -05:00
Elizabeth
31516ea87e Flop kick (#28)
* FlopKick transformer
2018-09-26 09:42:52 -05:00
Rob Mulholand
a0ba6ca6bd Return error if RPC returns empty header
- Enables graceful failure if RPC returns empty data with no error
2018-09-25 14:11:35 -05:00
Rob Mulholand
92525ca575 Make price feed log persistence atomic per block
- Prevents marking header as checked if only one of several price feed
  logs is successfully persisted
2018-09-25 14:11:35 -05:00
Rob Mulholand
ac362650db Log checked headers for tend events 2018-09-25 14:11:35 -05:00
Rob Mulholand
009cbb8aa0 Log checked headers for flip kick events 2018-09-25 14:11:35 -05:00
Rob Mulholand
d8b1a61ff5 Log checked headers for dent events 2018-09-25 14:11:35 -05:00
Rob Mulholand
c3f1fcf796 Log checked headers for deal events
- mark header as checked if no matching logs
- mark header as checked if all matching logs persisted successfully
- batch convert and insert matching logs to enable transactional persist
- enable skipping previously checked block headers when restarting a sync
2018-09-25 14:11:35 -05:00
Elizabeth
cee824f7ad Add transformer documentation (#32) 2018-09-24 15:39:00 -05:00
Rob Mulholand
e138e58120 Set timeout before assertions in integration tests
- Prevent early evaluation from triggering failure
2018-09-21 11:28:17 -05:00
Rob Mulholand
56c45b6841 Add logging for every transformer
- Also add drip file transformer initializer
2018-09-19 11:00:20 -05:00
Rob Mulholand
a735698f77 Update config for Kovan 2018-09-19 11:00:20 -05:00
Rob Mulholand
042f1142c0 Handle headers from POA chain
- Fetching headers from Kovan requires custom type without mixHash/Nonce
2018-09-19 11:00:20 -05:00
Rob Mulholand
778517f33f Add integration tests for price feed transformer
- Verify eth/usd, mkr/usd, and rep/usd price feed logs are successfully
  fetched from Kovan and persisted to Postgres
2018-09-19 11:00:20 -05:00
Elizabeth
cfc8773c5d Continuous sync (#23) 2018-09-19 10:14:49 -05:00
Elizabeth
60901d9095 Update tend, flipkick and dent tables for consistency (#24) 2018-09-18 09:27:14 -05:00
Rob Mulholand
06881db350 Sync unchecked headers for price feeds
- Indicate that a header has been checked for logs if no logs returned
- Indicate that a header has been checked for logs when persisting a log
- Fetch headers that need to be checked based on absence of the above
2018-09-17 14:14:52 -05:00
Rob Mulholand
f5595bee78 Add Drip drip transformer 2018-09-13 16:35:10 -05:00
Rob Mulholand
560305f601 Update dependencies
- uses newer version of go-ethereum required for go1.11
2018-09-13 16:14:35 -05:00