Skip to content

Commit

Permalink
Add block time consts
Browse files Browse the repository at this point in the history
  • Loading branch information
barnjamin committed Oct 16, 2023
1 parent 7a1e8e7 commit 87362ce
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
1 change: 0 additions & 1 deletion connect/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ describe("Chain Tests", () => {
let c: ChainContext<PlatformName>;
beforeEach(() => {
const wh = new Wormhole(network, allPlatformCtrs);
const p = wh.getPlatform("Ethereum");
c = wh.getChain("Ethereum");
});

Expand Down
2 changes: 1 addition & 1 deletion connect/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export async function signSendWait(
}
}

if (txbuff.length > -1) {
if (txbuff.length > 0) {
const signed = await signer.sign(txbuff);
const txids = await chain.sendWait(signed);
txHashes.push(...txids);
Expand Down
39 changes: 39 additions & 0 deletions core/base/src/constants/finality.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,42 @@ const finalityThresholds = [
>;

export const finalityThreshold = constMap(finalityThresholds);

const blockTimeMilliseconds = [
["Acala", 12000],
["Algorand", 3300],
["Aptos", 4000],
["Arbitrum", 300],
["Aurora", 3000],
["Avalanche", 2000],
["Base", 2000],
["Bsc", 3000],
["Celo", 5000],
["Cosmoshub", 5000],
["Ethereum", 15000],
["Evmos", 2000],
["Fantom", 2500],
["Gnosis", 5000],
["Injective", 2500],
["Karura", 12000],
["Klaytn", 1000],
["Kujira", 3000],
["Moonbeam", 12000],
["Near", 1500],
["Neon", 30000],
["Oasis", 6000],
["Optimism", 2000],
["Osmosis", 6000],
["Polygon", 2000],
["Rootstock", 30000],
["Sei", 400],
["Sepolia", 15000],
["Solana", 400],
["Sui", 3000],
["Terra", 6000],
["Terra2", 6000],
["Xpla", 5000],
["Wormchain", 5000],
] as const satisfies RoArray<readonly [ChainName, number]>;

export const blockTime = constMap(blockTimeMilliseconds);

0 comments on commit 87362ce

Please sign in to comment.