Skip to content

Commit

Permalink
superfluous casts remove
Browse files Browse the repository at this point in the history
  • Loading branch information
kev1n-peters authored and evan-gray committed Oct 6, 2024
1 parent 405463d commit 899ac24
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cloud_functions/src/getSolanaEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ import * as ethers from 'ethers';
import * as bs58 from 'bs58';
import { deserialize } from 'borsh';
import { assertEnvironmentVariable, EventData } from '@wormhole-foundation/wormhole-monitor-common';
import { Chain, ChainId, chainToChainId, isChain } from '@wormhole-foundation/sdk-base';
import { ChainId, chainToChainId, isChain } from '@wormhole-foundation/sdk-base';

function convertDefiLlamaChainToChainId(chain: string): ChainId {
if (chain === 'avax') {
return chainToChainId('Avalanche');
}
// DefiLlama uses lowercase chain names
chain = chain.charAt(0).toUpperCase() + chain.slice(1);
if (!isChain(chain as Chain)) {
if (!isChain(chain)) {
throw new Error('invalid chain');
}
return chainToChainId(chain as Chain);
return chainToChainId(chain);
}

export async function getSolanaEvents(req: any, res: any) {
Expand Down

0 comments on commit 899ac24

Please sign in to comment.