File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ const parser = yargs(hideBin(process.argv))
13
13
"Usage: $0 --private-key <private-key> --chain <chain-id> | --all-chains <testnet|mainnet>" ,
14
14
)
15
15
. options ( {
16
+ provider : {
17
+ type : "string" ,
18
+ desc : "Provider address to use for the request. Will use the default provider if not specified" ,
19
+ demandOption : false ,
20
+ } ,
16
21
chain : {
17
22
type : "string" ,
18
23
desc : "test latency for the contract on this chain" ,
@@ -30,8 +35,9 @@ const parser = yargs(hideBin(process.argv))
30
35
async function testLatency (
31
36
contract : EvmEntropyContract ,
32
37
privateKey : PrivateKey ,
38
+ provider ?: string ,
33
39
) {
34
- const provider = await contract . getDefaultProvider ( ) ;
40
+ provider = provider || await contract . getDefaultProvider ( ) ;
35
41
const userRandomNumber = contract . generateUserRandomNumber ( ) ;
36
42
const requestResponse = await contract . requestRandomness (
37
43
userRandomNumber ,
@@ -106,7 +112,7 @@ async function main() {
106
112
} else if ( argv . chain ) {
107
113
const chain = DefaultStore . getChainOrThrow ( argv . chain , EvmChain ) ;
108
114
const contract = findEntropyContract ( chain ) ;
109
- await testLatency ( contract , privateKey ) ;
115
+ await testLatency ( contract , privateKey , argv . provider ) ;
110
116
}
111
117
}
112
118
You can’t perform that action at this time.
0 commit comments