@@ -94,7 +94,8 @@ describe('EthAvatar', function () {
94
94
} )
95
95
96
96
it ( 'should use provided ENS domain' , async function ( ) {
97
- const web3 = new Web3 ( 'https://cloudflare-eth.com' )
97
+ const provider = process . env . INFURA_PROJECT_ID ? 'https://mainnet.infura.io/v3/' + process . env . INFURA_PROJECT_ID : 'https://cloudflare-eth.com'
98
+ const web3 = new Web3 ( provider )
98
99
const ethavatar = new EthAvatar ( web3 )
99
100
100
101
const domain = 'ethereum.eth'
@@ -121,7 +122,8 @@ describe('EthAvatar', function () {
121
122
} )
122
123
123
124
it ( 'should not use ENS on unexisting domain' , async function ( ) {
124
- const web3 = new Web3 ( 'https://cloudflare-eth.com' )
125
+ const provider = process . env . INFURA_PROJECT_ID ? 'https://mainnet.infura.io/v3/' + process . env . INFURA_PROJECT_ID : 'https://cloudflare-eth.com'
126
+ const web3 = new Web3 ( provider )
125
127
const ethavatar = new EthAvatar ( web3 )
126
128
127
129
const domain = 'this-domain-does-not-exist-on-mainnet-because-it-is-only-for-testing-of-unexisting-domains.eth'
@@ -204,8 +206,8 @@ describe('EthAvatar', function () {
204
206
describe ( '#watch()' , function ( ) {
205
207
it ( 'should watch for avatar changes' , async function ( ) {
206
208
ethavatar . watch ( async ( result ) => {
207
- const expected = web3 . eth . accounts [ 0 ]
208
- const actual = result . hashAddres
209
+ const expected = ( await web3 . eth . getAccounts ( ) ) [ 0 ]
210
+ const actual = result . hashAddress
209
211
210
212
assert . strictEqual ( actual , expected , 'Watching address is not correct' )
211
213
} )
0 commit comments