Skip to content

Commit 8ffacd5

Browse files
mmd-afegbuakasparkallashellwolf
authored
[SUBGRAPH] Local subgraph test fix (#2072)
* test increased mocha timeout --------- Co-authored-by: Kaspar Kallas <git@kasparkallas.com> Co-authored-by: Miao ZhiCheng <miao@superfluid.finance>
1 parent c513b49 commit 8ffacd5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/subgraph/hardhat.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dotenvConfig();
1313
*/
1414
const config: HardhatUserConfig = {
1515
solidity: {
16-
version: "0.7.6",
16+
version: "0.8.26",
1717
settings: {
1818
optimizer: {
1919
enabled: true,

packages/subgraph/test/helpers/helpers.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export const beforeSetup = async (tokenAmount: number) => {
3232
(x, y) => ({ ...x, [y.address]: y }),
3333
{}
3434
);
35+
36+
console.log("Reading framework config...");
3537
const readFromDir = __dirname.split("test")[0] + "config/hardhat.json";
3638
const rawData = fs.readFileSync(readFromDir);
3739
const frameworkAddresses = JSON.parse(rawData.toString());
@@ -82,9 +84,9 @@ export const beforeSetup = async (tokenAmount: number) => {
8284
// we wait for the indexer to catch up before the tests start
8385
const txn = await resolver.set("supertokens.test.fDAIx", fDAIx.address);
8486
const receipt = await txn.wait();
87+
8588
await waitUntilBlockIndexed(receipt.blockNumber);
8689
const resolverFDAIxAddress = await resolver.get("supertokens.test.fDAIx");
87-
8890
if (resolverFDAIxAddress !== fDAIx.address) {
8991
throw new Error("fDAIx not set properly in resolver.");
9092
}
@@ -211,6 +213,7 @@ export const waitUntilBlockIndexed = async (txnBlockNumber: number) => {
211213
let currentBlock: number;
212214
do {
213215
currentBlock = await getCurrentBlockNumber();
216+
console.log(`Waiting for subgraph... Current: ${currentBlock}, Target: ${txnBlockNumber}`);
214217
await asleep(50);
215218
} while (txnBlockNumber > currentBlock);
216219
};

0 commit comments

Comments
 (0)