From 9fc2a6ccc0a42d1860ca534c84013315d3895220 Mon Sep 17 00:00:00 2001 From: Alex Todorov Date: Fri, 29 Sep 2023 20:46:55 +0300 Subject: [PATCH] Add comments around testData().expirationBlock - explicitly warn not to hard-code the value and point to examples/loan-cycle.ts - explicitly mention that this function is used only for testing Developer note: testData() is used in many places (I also think as part of creditcoin-squid test suite) usually prior to calling beforeAll() and thus the Creditcoin API isn't initialized yet. IMO it's too many changes just to be able to read the last block number from a running chain. --- creditcoin-js/src/testUtils/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/creditcoin-js/src/testUtils/index.ts b/creditcoin-js/src/testUtils/index.ts index 622e36524f..d39bd32e2a 100644 --- a/creditcoin-js/src/testUtils/index.ts +++ b/creditcoin-js/src/testUtils/index.ts @@ -26,6 +26,8 @@ export type TestData = { export const testData = (ethereumChain: Blockchain, createWalletF: CreateWalletFunc): TestData => { return { blockchain: ethereumChain, + // WARNING: don't hard-code this, see examples/loan-cycle.ts + // NOTICE: this function is only used during testing before the Creditcoin API has been initialized expirationBlock: 10_000_000, createWallet: createWalletF, keyring: new Keyring({ type: 'sr25519' }),