Skip to content

Commit 7e81848

Browse files
authored
Merge pull request #279 from proto-kit/fix/ci-settlement-timeout
Fix/ci settlement timeout
2 parents 6449f7d + d5b8b64 commit 7e81848

File tree

5 files changed

+11
-17
lines changed

5 files changed

+11
-17
lines changed

packages/persistance/src/RedisConnection.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
StorageDependencyMinimumDependencies,
55
} from "@proto-kit/sequencer";
66
import { DependencyFactory } from "@proto-kit/common";
7+
import isArray from "lodash/isArray";
78

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

@@ -66,10 +67,16 @@ export class RedisConnectionModule
6667
});
6768
try {
6869
await this.redisClient.connect();
69-
} catch (error: unknown) {
70+
} catch (error: any) {
7071
if (error instanceof Error) {
7172
throw new Error(`Connection to Redis failed: ${error.message}`);
7273
}
74+
if (error.errors !== undefined && isArray(error.errors)) {
75+
const errors = (error.errors as Error[])
76+
.map((err) => err.message)
77+
.reduce((a, b) => `${a}\n${b}`);
78+
throw new Error(`Connection to Redis failed: \n${errors}`);
79+
}
7380
throw error;
7481
}
7582
}

packages/persistance/src/services/prisma/PrismaBlockStorage.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ export class PrismaBlockStorage
147147
stateRoot: encoded.stateRoot,
148148
blockHash: encoded.blockHash,
149149
blockHashRoot: encoded.blockHashRoot,
150+
witnessedRoots: encoded.witnessedRoots,
150151
},
151152
});
152153
}

packages/persistance/test-integration/SequencerRestart.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ describe("sequencer restart", () => {
7878
});
7979

8080
it("should be able to produce a block on top", async () => {
81-
console.log("2");
82-
8381
const blockTrigger = appChain.sequencer.resolve("BlockTrigger");
8482
await prepareBlock(appChain, sender.toPublicKey(), senderNonce);
8583
senderNonce++;

packages/sequencer/test/settlement/Settlement.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { MinaBaseLayerConfig } from "../../src";
44

55
import { settlementTestFn } from "./Settlement";
66

7-
describe.each(["mock-proofs" /*, "signed"*/] as const)(
7+
describe.each(["mock-proofs", "signed"] as const)(
88
"Settlement contracts: local blockchain - %s",
99
(type) => {
1010
const network: MinaBaseLayerConfig = {

packages/sequencer/test/settlement/Settlement.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,7 @@ export const settlementTestFn = (
253253
}
254254

255255
beforeAll(async () => {
256-
console.log("Setup");
257-
await sleep(100);
258256
appChain = setupAppChain();
259-
console.log("Start");
260-
await sleep(100);
261257

262258
await appChain.start(
263259
settlementType === "proven",
@@ -284,33 +280,26 @@ export const settlementTestFn = (
284280
const accountService = appChain.sequencer.dependencyContainer.resolve(
285281
MinaBlockchainAccounts
286282
);
287-
console.log("GetFunded");
288-
await sleep(100);
289283
const accs = await accountService.getFundedAccounts(3);
290284
testAccounts = accs.slice(1);
291285

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

296-
console.log("FundAccount");
297290
await sleep(100);
298291
await accountService.fundAccountFrom(
299292
accs[0],
300293
sequencerKey.toPublicKey(),
301294
20 * 1e9
302295
);
303-
304-
console.log("beforeAll finished");
305-
}, timeout);
296+
}, timeout * 3);
306297

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

311302
await appChain.close();
312-
313-
console.log("Afterall");
314303
});
315304

316305
let nonceCounter = 0;
@@ -788,4 +777,3 @@ export const settlementTestFn = (
788777
timeout
789778
);
790779
};
791-
/* eslint-enable no-inner-declarations */

0 commit comments

Comments
 (0)