Skip to content

Commit

Permalink
Add comments around testData().expirationBlock
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
atodorov committed Oct 2, 2023
1 parent 57d7173 commit 9fc2a6c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions creditcoin-js/src/testUtils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' }),
Expand Down

0 comments on commit 9fc2a6c

Please sign in to comment.