Skip to content

Commit

Permalink
rebased development
Browse files Browse the repository at this point in the history
  • Loading branch information
kev1n-peters committed Apr 1, 2024
1 parent af4f4cc commit 6923d6b
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 14 deletions.
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions wormhole-connect/src/config/testnet/nttGroups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,7 @@ export const TESTNET_NTT_GROUPS: NttGroups = {
chainName: 'solana',
address: 'nTTh3bZ5Aer6xboWZe39RDEft4MeVxSQ8D1EYAVLZw9',
tokenKey: 'TEST_NTTsolana',
transceivers: [
{
address: 'nTTh3bZ5Aer6xboWZe39RDEft4MeVxSQ8D1EYAVLZw9',
type: 'wormhole',
},
],
transceivers: [],
solanaQuoter: 'NqTdGLLL6b6bFo7YESNEezocgF8onH5cst5EdH791en',
},
],
Expand Down
11 changes: 11 additions & 0 deletions wormhole-connect/src/config/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,17 @@ export const mergeNttGroups = (
continue;
}

// if any of the chain names in the custom group are duplicated, skip
if (
new Set(customGroup.nttManagers.map((manager) => manager.chainName))
.size !== customGroup.nttManagers.length
) {
console.warn(
`Skipping custom NTT group config for "${key}" because it contains duplicate chain names`,
);
continue;
}

console.info(`Accepted custom NTT group config for "${key}"`);
builtin[key] = custom[key];
}
Expand Down
8 changes: 4 additions & 4 deletions wormhole-connect/src/store/transferInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ const performModificationsIfFromChainChanged = (state: TransferInputState) => {
}
if (isNttRoute(route) && destToken) {
const groupKey = getNttGroupKey(tokenConfig, config.tokens[destToken]);
if (groupKey) {
state.token = getNttTokenByGroupKey(groupKey, fromChain!)?.key || '';
if (groupKey && fromChain) {
state.token = getNttTokenByGroupKey(groupKey, fromChain)?.key || '';
} else {
state.token = '';
}
Expand Down Expand Up @@ -222,8 +222,8 @@ const performModificationsIfToChainChanged = (state: TransferInputState) => {
}
if (isNttRoute(route) && token) {
const groupKey = getNttGroupKey(tokenConfig, config.tokens[token]);
if (groupKey) {
state.destToken = getNttTokenByGroupKey(groupKey, toChain!)?.key || '';
if (groupKey && toChain) {
state.destToken = getNttTokenByGroupKey(groupKey, toChain)?.key || '';
} else {
state.destToken = '';
}
Expand Down
4 changes: 2 additions & 2 deletions wormhole-connect/src/utils/ntt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ export const getNttManagerConfigByAddress = (
isEqualCaseInsensitive(manager.address, managerAddress) &&
manager.chainName === chainName,
),
)[0];
)?.[0];
};

export const getNttManagerConfigByGroupKey = (
groupKey: string,
chainName: ChainName,
): NttManagerConfig | undefined => {
return config.nttGroups[groupKey].nttManagers.find(
return config.nttGroups[groupKey]?.nttManagers.find(
(manager) => manager.chainName === chainName,
);
};
Expand Down
1 change: 1 addition & 0 deletions wormhole-connect/src/views/Redeem/NttInboundQueued.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ const NttInboundQueued = () => {
<Header
chain={signedMessage.toChain}
address={signedMessage.recipient}
side="destination"
/>
{!expired ? (
<div>
Expand Down
3 changes: 1 addition & 2 deletions wormhole-connect/src/views/Redeem/Redeem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,8 @@ function Redeem({
while (signed === undefined && !cancelled) {
try {
signed = await RouteOperator.getSignedMessage(route, txData);
} catch (e) {
} catch {
signed = undefined;
console.log(e);
}
if (cancelled) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const RelayerDeliveryFailed = () => {
chain={txData.toChain}
address={txData.recipient}
txHash={redeemTx}
side="destination"
/>
<div className={classes.root}>
<Typography>
Expand Down

0 comments on commit 6923d6b

Please sign in to comment.