Skip to content

Commit

Permalink
Remove pkey used in tests (#1102)
Browse files Browse the repository at this point in the history
* remove pkey used in tests

* Update main/test/wallet-backend.test.js

Co-authored-by: Miroslav Bajtoš <[email protected]>

---------

Co-authored-by: Miroslav Bajtoš <[email protected]>
  • Loading branch information
juliangruber and bajtos authored Nov 13, 2023
1 parent c3bbffe commit bff99c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ jobs:
- name: Test backend
run: npm run test:backend
env:
TEST_SEED_PHRASE: ${{ secrets.TEST_SEED_PHRASE }}

- name: Test frontend
run: npm run test:ui
Expand Down
12 changes: 6 additions & 6 deletions main/test/wallet-backend.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const { WalletBackend } = require('../wallet-backend')
const assert = require('assert').strict
const { ethers } = require('ethers')

const { TEST_SEED_PHRASE } = process.env

const randomSeed = () => {
const wallet = ethers.Wallet.createRandom()
const seed = wallet.mnemonic.phrase
Expand Down Expand Up @@ -46,13 +48,11 @@ describe('Wallet Backend', function () {

describe('fetchAllTransactions()', function () {
it('fetches all transactions', /** @this {Mocha.Test} */ async function () {
// We need a seed for a wallet that already has some transactions
if (!TEST_SEED_PHRASE) return this.skip()
this.timeout(20_000)

await backend.setup(
// Here we want a seed for a wallet that already has some transactions
// eslint-disable-next-line max-len
'insane believe defy best among myself mistake account paddle episode life music fame impact below define habit rotate clay innocent history depart slice series'
)
await backend.setup(TEST_SEED_PHRASE)
await pRetry(() => backend.fetchAllTransactions(), { retries: 10 })
assert.notStrictEqual(backend.transactions.length, 0, 'has transactions')
for (const tx of backend.transactions) {
Expand All @@ -67,7 +67,7 @@ describe('Wallet Backend', function () {

describe('fetchScheduledRewards()', function () {
it('fetches rewards scheduled for disbursement', async function () {
// We want a random wallet that doesn't have any scheduled rewards
// We need a new wallet that doesn't have any scheduled rewards
await backend.setup(randomSeed())
const amount = await pRetry(
() => backend.fetchScheduledRewards(),
Expand Down

0 comments on commit bff99c8

Please sign in to comment.