5
5
ResponseListener ,
6
6
ReturnType ,
7
7
} from '../../src'
8
- import { setupLocalTestnet } from '../utils'
8
+ import { setupLocalTestnetFixture } from '../utils'
9
9
10
10
import { utils } from 'ethers'
11
11
@@ -22,7 +22,7 @@ describe('Local Functions Testnet', () => {
22
22
let getFunds : GetFunds
23
23
24
24
beforeAll ( async ( ) => {
25
- const testSetup = await setupLocalTestnet ( 8003 )
25
+ const testSetup = await setupLocalTestnetFixture ( 8003 )
26
26
linkTokenAddress = testSetup . linkTokenAddress
27
27
functionsRouterAddress = testSetup . functionsRouterAddress
28
28
exampleClient = testSetup . exampleConsumer
@@ -77,7 +77,7 @@ describe('Local Functions Testnet', () => {
77
77
utils . formatBytes32String ( simulatedDonId ) ,
78
78
)
79
79
80
- const req = await reqTx . wait ( 1 )
80
+ const req = await reqTx . wait ( )
81
81
const requestId = req . events [ 0 ] . topics [ 1 ]
82
82
const response = await functionsListener . listenForResponse ( requestId )
83
83
@@ -116,7 +116,7 @@ describe('Local Functions Testnet', () => {
116
116
codeLocation : 0 ,
117
117
secretsLocation : 1 ,
118
118
language : 0 ,
119
- source : 'return Functions.encodeUint256(Math.floor(Math.random() * 1_000_000_000))' ,
119
+ source : 'return Functions.encodeUint256(Math.floor(( Math.random() + 0.1 ) * 1_000_000_000))' ,
120
120
encryptedSecretsReference : '0xabcd' ,
121
121
requestSignature : [ ] ,
122
122
args : [ 'hello' , 'world' ] ,
@@ -126,7 +126,7 @@ describe('Local Functions Testnet', () => {
126
126
utils . formatBytes32String ( simulatedDonId ) ,
127
127
)
128
128
129
- const req = await reqTx . wait ( 1 )
129
+ const req = await reqTx . wait ( )
130
130
const requestId = req . events [ 0 ] . topics [ 1 ]
131
131
const response = await functionsListener . listenForResponse ( requestId )
132
132
@@ -164,7 +164,7 @@ describe('Local Functions Testnet', () => {
164
164
codeLocation : 0 ,
165
165
secretsLocation : 1 ,
166
166
language : 0 ,
167
- source : 'throw Error(`${Math.floor(Math.random() * 100)}`)' ,
167
+ source : 'throw Error(`${Math.floor(( Math.random() + 0.1 ) * 100)}`)' ,
168
168
encryptedSecretsReference : '0xabcd' ,
169
169
requestSignature : [ ] ,
170
170
args : [ 'hello' , 'world' ] ,
@@ -174,7 +174,7 @@ describe('Local Functions Testnet', () => {
174
174
utils . formatBytes32String ( simulatedDonId ) ,
175
175
)
176
176
177
- const req = await reqTx . wait ( 1 )
177
+ const req = await reqTx . wait ( )
178
178
const requestId = req . events [ 0 ] . topics [ 1 ]
179
179
const response = await functionsListener . listenForResponse ( requestId )
180
180
0 commit comments