Skip to content

Commit

Permalink
test: add optional nodeUri to getWeb3 fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzkirstein committed May 7, 2023
1 parent 417171a commit 470aaf1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/fixtures/Web3.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Web3 from 'web3'
import { nodeUri } from './chainConfig.json'
import chainConfig from './chainConfig.json'
import dotenv from 'dotenv'
dotenv.config()

export function getWeb3() {
const web3 = new Web3(nodeUri)
export function getWeb3(nodeUri?: string) {
const web3 = new Web3(nodeUri || chainConfig.nodeUri)
const account = web3.eth.accounts.privateKeyToAccount(process.env.PRIVATE_KEY)
web3.eth.accounts.wallet.add(account)
web3.defaultAccount = account.address
Expand Down

0 comments on commit 470aaf1

Please sign in to comment.