fix(chainwatch): gas columns are snake_cased; fix SQL bugs

This commit is contained in:
Mike Greenberg 2020-08-06 18:28:54 -04:00
parent e1de0e3408
commit 79b701d347

View File

@ -30,9 +30,9 @@ create table if not exists messages
"to" text not null, "to" text not null,
nonce bigint not null, nonce bigint not null,
value text not null, value text not null,
gasfeecap bigint not null, gas_fee_cap bigint not null,
gaspremium bigint not null, gas_premium bigint not null,
gaslimit bigint not null, gas_limit bigint not null,
method bigint, method bigint,
params bytea params bytea
); );
@ -220,7 +220,7 @@ create temp table msgs (like messages excluding constraints) on commit drop;
return xerrors.Errorf("prep temp: %w", err) return xerrors.Errorf("prep temp: %w", err)
} }
stmt, err := tx.Prepare(`copy msgs (cid, "from", "to", nonce, "value", gaspremium, gasfeecap gaslimit, method, params) from stdin `) stmt, err := tx.Prepare(`copy msgs (cid, "from", "to", nonce, "value", gas_premium, gas_fee_cap, gas_limit, method, params) from stdin `)
if err != nil { if err != nil {
return err return err
} }
@ -232,8 +232,8 @@ create temp table msgs (like messages excluding constraints) on commit drop;
m.To.String(), m.To.String(),
m.Nonce, m.Nonce,
m.Value.String(), m.Value.String(),
m.GasFeeCap.String(),
m.GasPremium.String(), m.GasPremium.String(),
m.GasFeeCap.String(),
m.GasLimit, m.GasLimit,
m.Method, m.Method,
m.Params, m.Params,