This commit is contained in:
hatim boufnichel 2024-04-25 19:28:26 +02:00
parent c893042857
commit 2b99225d29
2 changed files with 11 additions and 2 deletions

View file

@ -15,11 +15,13 @@ export class BitcoinCoreWrapper {
timeout: 5 * 60 * 1000, timeout: 5 * 60 * 1000,
}) })
} }
InitAddress = async () => {
this.addr = await this.core.getNewAddress()
}
Init = async () => { Init = async () => {
const wallet = await this.core.createWallet(''); const wallet = await this.core.createWallet('');
console.log({ wallet }) console.log({ wallet })
this.addr = await this.core.getNewAddress() await this.InitAddress()
console.log({ addr: this.addr }) console.log({ addr: this.addr })
await this.Mine(101) await this.Mine(101)
const info = await this.core.getWalletInfo(); const info = await this.core.getWalletInfo();

View file

@ -1,4 +1,6 @@
import { globby } from 'globby' import { globby } from 'globby'
import { LoadTestSettingsFromEnv } from '../services/main/settings.js'
import { BitcoinCoreWrapper } from './bitcoinCore.js'
import { setupNetwork } from './networkSetup.js' import { setupNetwork } from './networkSetup.js'
import { Describe, SetupTest, teardown, TestBase } from './testBase.js' import { Describe, SetupTest, teardown, TestBase } from './testBase.js'
@ -22,6 +24,11 @@ const getDescribe = (fileName: string): Describe => {
const start = async () => { const start = async () => {
if (process.argv[2] === 'setup_network') { if (process.argv[2] === 'setup_network') {
await setupNetwork() await setupNetwork()
} else {
const core = new BitcoinCoreWrapper(LoadTestSettingsFromEnv())
await core.InitAddress()
await core.Mine(1)
await new Promise((resolve) => setTimeout(resolve, 1000))
} }
const files = await globby(["**/*.spec.js", "!**/node_modules/**"]) const files = await globby(["**/*.spec.js", "!**/node_modules/**"])
const modules: { file: string, module: TestModule }[] = [] const modules: { file: string, module: TestModule }[] = []