Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion apps/entropy-tester/config.sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
{
"chain-id": "blast",
"interval": "10m"
"interval": "10m",
"endpoint": "https://rpc.blast.io"
}
]
2 changes: 1 addition & 1 deletion apps/entropy-tester/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pythnetwork/entropy-tester",
"version": "1.0.2",
"version": "1.1.0",
"description": "Utility to test entropy provider callbacks",
"private": true,
"type": "module",
Expand Down
12 changes: 12 additions & 0 deletions apps/entropy-tester/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import fs from "node:fs/promises";

import type { PrivateKey } from "@pythnetwork/contract-manager/core/base";
import { toPrivateKey } from "@pythnetwork/contract-manager/core/base";
import { EvmChain } from "@pythnetwork/contract-manager/core/chains";
import { EvmEntropyContract } from "@pythnetwork/contract-manager/core/contracts/evm";
import { DefaultStore } from "@pythnetwork/contract-manager/node/store";
import type { Logger } from "pino";
Expand Down Expand Up @@ -44,6 +45,7 @@ async function loadConfig(configPath: string): Promise<LoadedConfig[]> {
z.strictObject({
"chain-id": z.string(),
interval: z.string(),
endpoint: z.string().optional(),
}),
);
const configContent = (await import(configPath, {
Expand All @@ -66,6 +68,16 @@ async function loadConfig(configPath: string): Promise<LoadedConfig[]> {
`Multiple contracts found for chain ${config["chain-id"]}, check contract manager store.`,
);
}
if (config.endpoint) {
const evmChain = firstContract.chain;
firstContract.chain = new EvmChain(
evmChain.getId(),
evmChain.isMainnet(),
evmChain.getNativeToken(),
config.endpoint,
evmChain.networkId,
);
}
return { contract: firstContract, interval };
});
return loadedConfigs;
Expand Down
4 changes: 2 additions & 2 deletions contract_manager/src/core/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ export class EvmChain extends Chain {
id: string,
mainnet: boolean,
nativeToken: TokenId | undefined,
private rpcUrl: string,
private networkId: number,
public rpcUrl: string,
public networkId: number,
) {
// On EVM networks we use the chain id as the wormhole chain name
super(id, mainnet, id, nativeToken);
Expand Down
Loading