Skip to content

Commit

Permalink
integrations/txinputs: revert
Browse files Browse the repository at this point in the history
Now that we have declaritive based indexing, this compiled integration
no longer makes sense. Here is the equivalent config:

{
    "pg_url": "postgres:///e2pg",
    "eth_sources": [{"name": "main", "chain_id": 1, "url": ""}],
    "integrations": [{
	"name": "txinputs",
	"enabled": true,
	"sources": [{"name": "main"}],
	"table": {
	    "name": "txi",
	    "columns": [
		{"name": "chain_id", "type": "numeric"},
		{"name": "block_hash", "type": "bytea"},
		{"name": "block_num", "type": "numeric"},
		{"name": "tx_hash", "type": "bytea"},
		{"name": "tx_idx", "type": "numeric"},
		{"name": "tx_signer", "type": "bytea"},
		{"name": "tx_to", "type": "bytea"},
		{"name": "tx_input", "type": "bytea"}
	    ]
	},
	"block": [
	    {"name": "chain_id", "column": "chain_id"},
	    {"name": "block_hash", "column": "block_hash"},
	    {"name": "block_num", "column": "block_num"},
	    {"name": "tx_hash", "column": "tx_hash"},
	    {"name": "tx_idx", "column": "tx_idx"},
	    {"name": "tx_signer", "column": "tx_signer"},
	    {"name": "tx_to", "column": "tx_to"},
	    {"name": "tx_input", "column": "tx_input"}
	]
    }]
}
  • Loading branch information
ryandotsmith committed Oct 10, 2023
1 parent 1fe5281 commit 418966e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 182 deletions.
10 changes: 4 additions & 6 deletions e2pg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,16 @@ import (
"github.com/indexsupply/x/integrations/erc20"
"github.com/indexsupply/x/integrations/erc4337"
"github.com/indexsupply/x/integrations/erc721"
"github.com/indexsupply/x/integrations/txinputs"
"github.com/indexsupply/x/jrpc2"
"github.com/indexsupply/x/rlps"
"github.com/jackc/pgx/v5/pgxpool"
)

var compiled = map[string]e2pg.Integration{
"erc20": erc20.Integration,
"erc721": erc721.Integration,
"erc1155": erc1155.Integration,
"erc4337": erc4337.Integration,
"txinputs": txinputs.Integration,
"erc20": erc20.Integration,
"erc721": erc721.Integration,
"erc1155": erc1155.Integration,
"erc4337": erc4337.Integration,
}

type EthSource struct {
Expand Down
17 changes: 1 addition & 16 deletions e2pg/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,28 +99,13 @@ var Migrations = map[int]pgmig.Migration{
6: pgmig.Migration{
SQL: `alter table task set schema e2pg`,
},
7: pgmig.Migration{
SQL: `
create table tx_inputs (
task_id numeric,
chain_id numeric,
block_hash bytea,
block_number numeric,
tx_hash bytea,
tx_index numeric,
tx_signer bytea,
tx_to bytea,
tx_input bytea
)
`,
},
7: pgmig.Migration{SQL: ``}, //reverted tx_inputs
8: pgmig.Migration{
SQL: `
alter table e2pg.task alter column id type text;
alter table nft_transfers alter column task_id type text;
alter table erc20_transfers alter column task_id type text;
alter table erc4337_userops alter column task_id type text;
alter table tx_inputs alter column task_id type text;
`,
},
}
14 changes: 0 additions & 14 deletions e2pg/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,6 @@ CREATE TABLE public.nft_transfers (



CREATE TABLE public.tx_inputs (
task_id text,
chain_id numeric,
block_hash bytea,
block_number numeric,
tx_hash bytea,
tx_index numeric,
tx_signer bytea,
tx_to bytea,
tx_input bytea
);



ALTER TABLE ONLY e2pg.migrations
ADD CONSTRAINT migrations_pkey PRIMARY KEY (idx, hash);

Expand Down
98 changes: 0 additions & 98 deletions integrations/txinputs/inputs.go

This file was deleted.

48 changes: 0 additions & 48 deletions integrations/txinputs/inputs_test.go

This file was deleted.

0 comments on commit 418966e

Please sign in to comment.