Skip to content

Commit

Permalink
improved error when chain doesn't have polytone
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Oct 5, 2024
1 parent 4fe4a0f commit 791045a
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ export const CreateCrossChainAccountComponent: ActionComponent = ({
if (
context.type !== ActionContextType.Dao ||
// Type check.
chainContext.type !== ActionChainContextType.Supported ||
!chainContext.config.polytone
chainContext.type !== ActionChainContextType.Supported
) {
throw new Error('Invalid context for this action.')
}

if (!chainContext.config.polytone) {
throw new Error(`Cross-chain accounts have not been enabled for ${name}.`)
}

const missingChainIds = Object.keys(chainContext.config.polytone).filter(
(chainId) => !(chainId in context.dao.info.polytoneProxies)
)
Expand Down

0 comments on commit 791045a

Please sign in to comment.