Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jsy1218 committed Jul 18, 2024
1 parent 8ad66d4 commit 224fe78
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/mocha/unit/rpc/UniJsonRpcProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -704,9 +704,9 @@ describe('UniJsonRpcProvider', () => {
// Shadow evaluate call should be made
expect(spy0.callCount).to.equal(0)
expect(spy1.callCount).to.equal(1)
expect(spy1.getCalls()[0].firstArg).to.equal('getBlockNumber')
expect(spy1.getCalls()[0].lastArg).to.equal('getBlockNumber')
expect(spy2.callCount).to.equal(1)
expect(spy2.getCalls()[0].firstArg).to.equal('getBlockNumber')
expect(spy2.getCalls()[0].lastArg).to.equal('getBlockNumber')

expect(uniProvider['providers'][1]['lastLatencyEvaluationTimestampInMs']).equals(timestamp)
expect(uniProvider['providers'][2]['lastLatencyEvaluationTimestampInMs']).equals(timestamp)
Expand Down Expand Up @@ -746,9 +746,9 @@ describe('UniJsonRpcProvider', () => {
// Shadow evaluate call should be made
expect(spy0.callCount).to.equal(0)
expect(spy1.callCount).to.equal(1)
expect(spy1.getCalls()[0].firstArg).to.equal('getBlockNumber')
expect(spy1.getCalls()[0].lastArg).to.equal('getBlockNumber')
expect(spy2.callCount).to.equal(1)
expect(spy2.getCalls()[0].firstArg).to.equal('getBlockNumber')
expect(spy2.getCalls()[0].lastArg).to.equal('getBlockNumber')

expect(uniProvider['providers'][1]['lastLatencyEvaluationTimestampInMs']).equals(timestamp)
expect(uniProvider['providers'][2]['lastLatencyEvaluationTimestampInMs']).equals(timestamp)
Expand All @@ -774,10 +774,10 @@ describe('UniJsonRpcProvider', () => {
await uniProvider.getBlockNumber('sessionId')

expect(spy1.callCount).to.equal(1)
expect(spy1.getCalls()[0].firstArg).to.equal('getBlockNumber')
expect(spy1.getCalls()[0].lastArg).to.equal('getBlockNumber')
expect(uniProvider['providers'][1]['lastLatencyEvaluationTimestampInMs']).equals(timestamp + 16000)
expect(spy2.callCount).to.equal(1)
expect(spy2.getCalls()[0].firstArg).to.equal('getBlockNumber')
expect(spy2.getCalls()[0].lastArg).to.equal('getBlockNumber')
expect(uniProvider['providers'][2]['lastLatencyEvaluationTimestampInMs']).equals(timestamp + 16000)
})

Expand Down Expand Up @@ -822,9 +822,9 @@ describe('UniJsonRpcProvider', () => {

expect(spy0.callCount).to.equal(0)
expect(spy1.callCount).to.equal(5)
expect(spy1.getCalls()[0].firstArg).to.equal('getBlockNumber')
expect(spy1.getCalls()[0].lastArg).to.equal('getBlockNumber')
expect(spy2.callCount).to.equal(5)
expect(spy2.getCalls()[0].firstArg).to.equal('getBlockNumber')
expect(spy2.getCalls()[0].lastArg).to.equal('getBlockNumber')

expect(uniProvider['providers'][1]['lastLatencyEvaluationTimestampInMs']).equals(timestamp)
expect(uniProvider['providers'][2]['lastLatencyEvaluationTimestampInMs']).equals(timestamp)
Expand Down Expand Up @@ -946,9 +946,9 @@ describe('UniJsonRpcProvider', () => {
// 0.4 < 0.5, Shadow evaluate call should be made
expect(spy0.callCount).to.equal(0)
expect(spy1.callCount).to.equal(1)
expect(spy1.getCalls()[0].firstArg).to.equal('getBlockNumber')
expect(spy1.getCalls()[0].lastArg).to.equal('getBlockNumber')
expect(spy2.callCount).to.equal(1)
expect(spy2.getCalls()[0].firstArg).to.equal('getBlockNumber')
expect(spy2.getCalls()[0].lastArg).to.equal('getBlockNumber')
})

it('Test use of healthCheckSampleProb', async () => {
Expand Down

0 comments on commit 224fe78

Please sign in to comment.