Skip to content

Commit

Permalink
shovel-config-ts: bugfix. s/pgURL/pg_url. s/batchSize/batch_size
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandotsmith committed Feb 10, 2024
1 parent 99d8763 commit 5addcdb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion shovel-config-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "0.0.4",
"version": "0.0.5",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"description": "Types and functions for building a Shovel config file.",
Expand Down
10 changes: 5 additions & 5 deletions shovel-config-ts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export type Source = {
url: string;
chain_id: EnvRef | number;
concurrency?: EnvRef | number;
batchSize?: EnvRef | number;
batch_size?: EnvRef | number;
};

export type SourceReference = {
Expand All @@ -112,21 +112,21 @@ export type Dashboard = {

export type Config = {
dashboard: Dashboard;
pgURL: string;
pg_url: string;
sources: Source[];
integrations: Integration[];
};

export function makeConfig(args: {
dashboard?: Dashboard;
pgURL: string;
pg_url: string;
sources: Source[];
integrations: Integration[];
}): Config {
//TODO validation
return {
dashboard: args.dashboard || {},
pgURL: args.pgURL,
pg_url: args.pg_url,
sources: args.sources,
integrations: args.integrations,
};
Expand All @@ -138,7 +138,7 @@ export function toJSON(c: Config, space: number = 0): string {
return JSON.stringify(
{
dashboard: c.dashboard,
pg_url: c.pgURL,
pg_url: c.pg_url,
eth_sources: c.sources,
integrations: c.integrations,
},
Expand Down
4 changes: 2 additions & 2 deletions shovel-config-ts/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ test("makeConfig", () => {
},
];
const c = makeConfig({
pgURL: "",
pg_url: "",
sources: [mainnet],
integrations: integrations,
});

expect(c).toEqual({
dashboard: {},
pgURL: "",
pg_url: "",
sources: [
{
name: "mainnet",
Expand Down

0 comments on commit 5addcdb

Please sign in to comment.