Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
Merge pull request #13 from vulcanize/VDB-299-Cat-diff-parsing
Browse files Browse the repository at this point in the history
VDB-299 Cat diff parsing
  • Loading branch information
m0ar authored Feb 20, 2019
2 parents 04932c5 + 0efb8d4 commit 238a674
Show file tree
Hide file tree
Showing 18 changed files with 1,708 additions and 291 deletions.
1 change: 1 addition & 0 deletions cmd/parseStorageDiffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func parseStorageDiffs() {
// TODO: configure transformers
watcher := shared.NewStorageWatcher(tailer, db)
watcher.AddTransformers([]storage.TransformerInitializer{
transformers.GetCatStorageTransformer().NewTransformer,
transformers.GetPitStorageTransformer().NewTransformer,
transformers.GetVatStorageTransformer().NewTransformer,
transformers.GetVowStorageTransformer().NewTransformer,
Expand Down
106 changes: 106 additions & 0 deletions db/migrations/20190215160236_create_cat_storage_tables.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
-- +goose Up
CREATE TABLE maker.cat_nflip (
id SERIAL PRIMARY KEY,
block_number BIGINT,
block_hash TEXT,
nflip NUMERIC NOT NULL
);

CREATE TABLE maker.cat_live (
id SERIAL PRIMARY KEY,
block_number BIGINT,
block_hash TEXT,
live NUMERIC NOT NULL
);

CREATE TABLE maker.cat_vat (
id SERIAL PRIMARY KEY,
block_number BIGINT,
block_hash TEXT,
vat TEXT
);

CREATE TABLE maker.cat_pit (
id SERIAL PRIMARY KEY,
block_number BIGINT,
block_hash TEXT,
pit TEXT
);

CREATE TABLE maker.cat_vow (
id SERIAL PRIMARY KEY,
block_number BIGINT,
block_hash TEXT,
vow TEXT
);

CREATE TABLE maker.cat_ilk_flip (
id SERIAL PRIMARY KEY,
block_number BIGINT,
block_hash TEXT,
ilk TEXT,
flip TEXT
);

CREATE TABLE maker.cat_ilk_chop (
id SERIAL PRIMARY KEY,
block_number BIGINT,
block_hash TEXT,
ilk TEXT,
chop NUMERIC NOT NULL
);

CREATE TABLE maker.cat_ilk_lump (
id SERIAL PRIMARY KEY,
block_number BIGINT,
block_hash TEXT,
ilk TEXT,
lump NUMERIC NOT NULL
);

CREATE TABLE maker.cat_flip_ilk (
id SERIAL PRIMARY KEY,
block_number BIGINT,
block_hash TEXT,
flip NUMERIC NOT NULL,
ilk TEXT
);

CREATE TABLE maker.cat_flip_urn (
id SERIAL PRIMARY KEY,
block_number BIGINT,
block_hash TEXT,
flip NUMERIC NOT NULL,
urn TEXT
);

CREATE TABLE maker.cat_flip_ink (
id SERIAL PRIMARY KEY,
block_number BIGINT,
block_hash TEXT,
flip NUMERIC NOT NULL,
ink NUMERIC NOT NULL
);

CREATE TABLE maker.cat_flip_tab (
id SERIAL PRIMARY KEY,
block_number BIGINT,
block_hash TEXT,
flip NUMERIC NOT NULL,
tab NUMERIC NOT NULL
);


-- +goose Down
DROP TABLE maker.cat_nflip;
DROP TABLE maker.cat_live;
DROP TABLE maker.cat_vat;
DROP TABLE maker.cat_pit;
DROP TABLE maker.cat_vow;
DROP TABLE maker.cat_ilk_flip;
DROP TABLE maker.cat_ilk_chop;
DROP TABLE maker.cat_ilk_lump;
DROP TABLE maker.cat_flip_ilk;
DROP TABLE maker.cat_flip_urn;
DROP TABLE maker.cat_flip_ink;
DROP TABLE maker.cat_flip_tab;
Loading

0 comments on commit 238a674

Please sign in to comment.