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
9 changes: 8 additions & 1 deletion packages/persistance/src/RedisConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
StorageDependencyMinimumDependencies,
} from "@proto-kit/sequencer";
import { DependencyFactory } from "@proto-kit/common";
import isArray from "lodash/isArray";

import { RedisMerkleTreeStore } from "./services/redis/RedisMerkleTreeStore";

Expand Down Expand Up @@ -66,10 +67,16 @@ export class RedisConnectionModule
});
try {
await this.redisClient.connect();
} catch (error: unknown) {
} catch (error: any) {
if (error instanceof Error) {
throw new Error(`Connection to Redis failed: ${error.message}`);
}
if (error.errors !== undefined && isArray(error.errors)) {
const errors = (error.errors as Error[])
.map((err) => err.message)
.reduce((a, b) => `${a}\n${b}`);
throw new Error(`Connection to Redis failed: \n${errors}`);
}
throw error;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export class PrismaBlockStorage
stateRoot: encoded.stateRoot,
blockHash: encoded.blockHash,
blockHashRoot: encoded.blockHashRoot,
witnessedRoots: encoded.witnessedRoots,
},
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ describe("sequencer restart", () => {
});

it("should be able to produce a block on top", async () => {
console.log("2");

const blockTrigger = appChain.sequencer.resolve("BlockTrigger");
await prepareBlock(appChain, sender.toPublicKey(), senderNonce);
senderNonce++;
Expand Down
2 changes: 1 addition & 1 deletion packages/sequencer/test/settlement/Settlement.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MinaBaseLayerConfig } from "../../src";

import { settlementTestFn } from "./Settlement";

describe.each(["mock-proofs" /*, "signed"*/] as const)(
describe.each(["mock-proofs", "signed"] as const)(
"Settlement contracts: local blockchain - %s",
(type) => {
const network: MinaBaseLayerConfig = {
Expand Down
14 changes: 1 addition & 13 deletions packages/sequencer/test/settlement/Settlement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,7 @@ export const settlementTestFn = (
}

beforeAll(async () => {
console.log("Setup");
await sleep(100);
appChain = setupAppChain();
console.log("Start");
await sleep(100);

await appChain.start(
settlementType === "proven",
Expand All @@ -284,33 +280,26 @@ export const settlementTestFn = (
const accountService = appChain.sequencer.dependencyContainer.resolve(
MinaBlockchainAccounts
);
console.log("GetFunded");
await sleep(100);
const accs = await accountService.getFundedAccounts(3);
testAccounts = accs.slice(1);

console.log(
`Funding ${sequencerKey.toPublicKey().toBase58()} from ${accs[0].toPublicKey().toBase58()}`
);

console.log("FundAccount");
await sleep(100);
await accountService.fundAccountFrom(
accs[0],
sequencerKey.toPublicKey(),
20 * 1e9
);

console.log("beforeAll finished");
}, timeout);
}, timeout * 3);

afterAll(async () => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
SettlementSmartContractBase.args = undefined as any;

await appChain.close();

console.log("Afterall");
});

let nonceCounter = 0;
Expand Down Expand Up @@ -788,4 +777,3 @@ export const settlementTestFn = (
timeout
);
};
/* eslint-enable no-inner-declarations */