Skip to content

Commit

Permalink
Merge pull request #4 from vulcanize/tx_typing
Browse files Browse the repository at this point in the history
Tx typing and access list support
  • Loading branch information
i-norden authored May 3, 2021
2 parents ed0a404 + 3716299 commit d9344ce
Show file tree
Hide file tree
Showing 4 changed files with 298 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ TEST_CONNECT_STRING = postgresql://$(USER)@$(HOST_NAME):$(PORT)/$(TEST_DB)?sslmo
test: | $(GINKGO)
dropdb --if-exists $(TEST_DB)
createdb $(TEST_DB)
$(GOOSE) -dir db/migrations postgres "$(TEST_CONNECT_STRING)" up
make migrate NAME=$(TEST_DB)
$(GOOSE) -dir db/migrations postgres "$(TEST_CONNECT_STRING)" reset

## Build docker image
Expand Down
7 changes: 7 additions & 0 deletions db/migrations/00022_add_tx_type_to_transaction_cids.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- +goose Up
ALTER TABLE eth.transaction_cids
ADD COLUMN tx_type BYTEA;

-- +goose Down
ALTER TABLE eth.transaction_cids
DROP COLUMN tx_type;
15 changes: 15 additions & 0 deletions db/migrations/00023_create_access_list_table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- +goose Up
CREATE TABLE eth.access_list_element (
id SERIAL PRIMARY KEY,
tx_id INTEGER NOT NULL REFERENCES eth.transaction_cids (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
index INTEGER NOT NULL,
address VARCHAR(66),
storage_keys VARCHAR(66)[],
UNIQUE (tx_id, index)
);

CREATE INDEX accesss_list_element_address_index ON eth.access_list_element USING btree (address);

-- +goose Down
DROP INDEX eth.accesss_list_element_address_index;
DROP TABLE eth.access_list_element;
Loading

0 comments on commit d9344ce

Please sign in to comment.