Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function run() {
chainId: 10000,
initialHeight: 0,
// snapshot: {
// path: "../../f07a7068c50e2e5591beaa572070933008744425d727c792d328d1d5e2fac306.compressed",
// path: "../../62b828b447bb37642fc267c971621db611e19c8a92ee3fe0dc89a080118fc47a.compressed",
// },
});

Expand Down
12 changes: 9 additions & 3 deletions packages/snapshot-legacy-exporter/source/application-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { ServiceProvider as CryptoAddressKeccak256 } from "@mainsail/crypto-address-keccak256";
import { ServiceProvider as CryptoKeyPairEcdsa } from "@mainsail/crypto-key-pair-ecdsa";
import { ServiceProvider as CryptoValidation } from "@mainsail/crypto-validation";
import { Application } from "@mainsail/kernel";
import { Application, Services } from "@mainsail/kernel";

Check warning on line 6 in packages/snapshot-legacy-exporter/source/application-factory.ts

View check run for this annotation

Codecov / codecov/patch

packages/snapshot-legacy-exporter/source/application-factory.ts#L6

Added line #L6 was not covered by tests
import { ServiceProvider as Logger } from "@mainsail/logger-pino";
import { ServiceProvider as Validation } from "@mainsail/validation";
import { dirSync, setGracefulCleanup } from "tmp";
Expand All @@ -16,8 +16,9 @@

const app = new Application(new Container());
app.bind(Identifiers.Application.Name).toConstantValue(options.name);
app.bind(Identifiers.Application.Thread).toConstantValue("");

Check warning on line 20 in packages/snapshot-legacy-exporter/source/application-factory.ts

View check run for this annotation

Codecov / codecov/patch

packages/snapshot-legacy-exporter/source/application-factory.ts#L19-L20

Added lines #L19 - L20 were not covered by tests
app.bind(Identifiers.Services.EventDispatcher.Service).toConstantValue({});
app.bind(Identifiers.Services.Log.Service).toConstantValue({});

setGracefulCleanup();
app.rebind("path.data").toConstantValue(dirSync().name);
Expand All @@ -30,7 +31,12 @@
await app.resolve(CryptoValidation).register();
await app.resolve(CryptoKeyPairEcdsa).register();
await app.resolve(CryptoAddressKeccak256).register();
await app.resolve(Logger).register();

await app.resolve(Services.Log.ServiceProvider).register();

const logger = app.resolve(Logger);
logger.setConfig({ all: () => ({ levels: { console: "info" } }) } as unknown as any);
await logger.register();

Check warning on line 39 in packages/snapshot-legacy-exporter/source/application-factory.ts

View check run for this annotation

Codecov / codecov/patch

packages/snapshot-legacy-exporter/source/application-factory.ts#L34-L39

Added lines #L34 - L39 were not covered by tests

//
app.bind(InternalIdentifiers.Snapshot.Generator).to(Generator);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@
const jsonString = JSON.stringify(snapshot);
const compressedBuffer = await promisify(brotliCompress)(jsonString);
await writeFile(path, compressedBuffer);
this.logger.info(`Wrote ${snapshot.wallets.length} wallets to '${path}'`);
this.logger.info(
`Wrote ${JSON.stringify(snapshot.chainTip)} with ${snapshot.wallets.length} wallets to '${path}'`,
);

Check warning on line 175 in packages/snapshot-legacy-exporter/source/snapshot/generator.ts

View check run for this annotation

Codecov / codecov/patch

packages/snapshot-legacy-exporter/source/snapshot/generator.ts#L173-L175

Added lines #L173 - L175 were not covered by tests
}
}

Expand Down
Loading