Skip to content

feat(contract-manager): Add optional provider address for entropy script #2728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions contract_manager/scripts/latency_entropy_with_callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ const parser = yargs(hideBin(process.argv))
"Usage: $0 --private-key <private-key> --chain <chain-id> | --all-chains <testnet|mainnet>",
)
.options({
provider: {
type: "string",
desc: "Provider address to use for the request. Will use the default provider if not specified",
demandOption: false,
},
chain: {
type: "string",
desc: "test latency for the contract on this chain",
Expand All @@ -30,8 +35,9 @@ const parser = yargs(hideBin(process.argv))
async function testLatency(
contract: EvmEntropyContract,
privateKey: PrivateKey,
provider?: string,
) {
const provider = await contract.getDefaultProvider();
provider = provider || await contract.getDefaultProvider();
const userRandomNumber = contract.generateUserRandomNumber();
const requestResponse = await contract.requestRandomness(
userRandomNumber,
Expand Down Expand Up @@ -106,7 +112,7 @@ async function main() {
} else if (argv.chain) {
const chain = DefaultStore.getChainOrThrow(argv.chain, EvmChain);
const contract = findEntropyContract(chain);
await testLatency(contract, privateKey);
await testLatency(contract, privateKey, argv.provider);
}
}

Expand Down
Loading