Skip to content

Commit 8cda49b

Browse files
committed
fix type errors
1 parent 2aa3b38 commit 8cda49b

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/dev-connection/index.test.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { define } from '@aggre/ullr'
88
import { html, render } from 'lit'
99
import { rpcEndpoints, waitForUpdated } from '../lib/test'
1010
import { filter } from 'rxjs'
11-
import { type Provider } from 'ethers'
11+
import type { Signer, Provider, ContractRunner } from 'ethers'
1212

1313
define(Connection)
1414

@@ -176,7 +176,7 @@ describe('dev-connection', () => {
176176
it('when setEip1193Provider is called, listen disconnect event and update signer stream', async () => {
177177
const el = connection()
178178
const signer = new ethers.VoidSigner(ethers.ZeroAddress)
179-
el.signer.next(signer)
179+
el.signer.next(signer as unknown as Signer)
180180
await waitForUpdated(el.signer.pipe(filter((x) => x !== undefined)))
181181
expect(el.signer.getValue()).to.be.equal(signer)
182182

@@ -192,7 +192,7 @@ describe('dev-connection', () => {
192192
it('when setEip1193Provider is called, remove disconnect listener for previous provider', async () => {
193193
const el = connection()
194194
const signer = new ethers.VoidSigner(ethers.ZeroAddress)
195-
el.signer.next(signer)
195+
el.signer.next(signer as unknown as Signer)
196196
await waitForUpdated(el.signer)
197197
expect(el.signer.getValue()).to.be.equal(signer)
198198

@@ -207,7 +207,7 @@ describe('dev-connection', () => {
207207
await waitForUpdated(el.signer)
208208
expect(el.signer.getValue()).to.be.equal(undefined)
209209

210-
el.signer.next(signer)
210+
el.signer.next(signer as unknown as Signer)
211211

212212
await waitForUpdated(el.signer)
213213
expect(el.signer.getValue()).to.be.equal(signer)
@@ -235,7 +235,7 @@ describe('dev-connection', () => {
235235
const mock = ethers.Wallet.createRandom().connect(
236236
new ethers.JsonRpcProvider(rpcEndpoints[0]),
237237
)
238-
el.signer.next(mock)
238+
el.signer.next(mock as unknown as Signer)
239239

240240
expect(el.signer.getValue()).to.be.equal(mock)
241241
expect(_count).to.be.equal(2)
@@ -247,7 +247,7 @@ describe('dev-connection', () => {
247247
const mock = ethers.Wallet.createRandom().connect(
248248
new ethers.JsonRpcProvider(rpcEndpoints[0]),
249249
)
250-
el.signer.next(mock)
250+
el.signer.next(mock as unknown as Signer)
251251

252252
await waitForUpdated(el.account)
253253
expect(el.account.getValue()).to.be.equal(await mock.getAddress())
@@ -258,7 +258,7 @@ describe('dev-connection', () => {
258258
const mock = ethers.Wallet.createRandom().connect(
259259
new ethers.JsonRpcProvider(rpcEndpoints[0]),
260260
)
261-
el.signer.next(mock)
261+
el.signer.next(mock as unknown as Signer)
262262
await waitForUpdated(el.account)
263263

264264
el.signer.next(undefined)
@@ -272,7 +272,7 @@ describe('dev-connection', () => {
272272
const mock = ethers.Wallet.createRandom().connect(
273273
new ethers.JsonRpcProvider(rpcEndpoints[0]),
274274
)
275-
el.signer.next(mock)
275+
el.signer.next(mock as unknown as Signer)
276276
expect(el.provider.getValue()).to.be.equal(mock.provider)
277277

278278
el.signer.next(undefined)
@@ -286,14 +286,14 @@ describe('dev-connection', () => {
286286
const mock = ethers.Wallet.createRandom().connect(
287287
new ethers.JsonRpcProvider(rpcEndpoints[0]),
288288
)
289-
el.signer.next(mock)
289+
el.signer.next(mock as unknown as Signer)
290290

291291
expect(el.provider.getValue()).to.be.equal(mock.provider)
292292
})
293293
it('when signer is changed and the provider is not set, provider will update to undefined', async () => {
294294
const el = connection()
295295
const d = new ethers.JsonRpcProvider(rpcEndpoints[1])
296-
el.provider.next(d)
296+
el.provider.next(d as unknown as ContractRunner)
297297
expect(el.provider.getValue()).to.be.equal(d)
298298

299299
const _mock = ethers.Wallet.createRandom().connect(
@@ -322,7 +322,7 @@ describe('dev-connection', () => {
322322
expect(el.provider.getValue()).to.be.equal(undefined)
323323

324324
const mock = new ethers.JsonRpcProvider(rpcEndpoints[0])
325-
el.provider.next(mock)
325+
el.provider.next(mock as unknown as ContractRunner)
326326

327327
expect(el.provider.getValue()).to.be.equal(mock)
328328
expect(_count).to.be.equal(2)
@@ -332,15 +332,15 @@ describe('dev-connection', () => {
332332
expect(el.chain.getValue()).to.be.equal(undefined)
333333

334334
const mock = new ethers.JsonRpcProvider(rpcEndpoints[0])
335-
el.provider.next(mock)
335+
el.provider.next(mock as unknown as ContractRunner)
336336

337337
await waitForUpdated(el.chain.pipe(filter((x) => x !== undefined)))
338338
expect(el.chain.getValue()).to.be.equal(42161)
339339
})
340340
it('when provider is changed to undefined, chain will update to undefined', async () => {
341341
const el = connection()
342342
const mock = new ethers.JsonRpcProvider(rpcEndpoints[0])
343-
el.provider.next(mock)
343+
el.provider.next(mock as unknown as ContractRunner)
344344

345345
await waitForUpdated(el.chain.pipe(filter((x) => x !== undefined)))
346346
expect(el.chain.getValue()).to.be.equal(42161)

0 commit comments

Comments
 (0)