Skip to content

Commit

Permalink
fix: Second try fixing module import error
Browse files Browse the repository at this point in the history
  • Loading branch information
wottpal committed Oct 13, 2023
1 parent 58b3967 commit 8740867
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
4 changes: 1 addition & 3 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
/**
* @type {import('next').NextConfig}
**/
let nextConfig = {
transpilePackages: ['@inkathon/contracts'],
}
let nextConfig = {}

const withTwin = require('./withTwin.js')
nextConfig = withTwin(nextConfig)
Expand Down
15 changes: 7 additions & 8 deletions frontend/src/deployments/deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ export const getDeployments = async (): Promise<SubstrateDeployment[]> => {
const networks = env.supportedChains
const deployments: SubstrateDeployment[] = []

for (const network of networks) {
for (const networkId of networks) {
for (const contractId of Object.values(ContractIds)) {
deployments.push({
contractId: ContractIds.Greeter,
networkId: network,
abi: await import(`@inkathon/contracts/deployments/${contractId}/${contractId}.json`),
address: (await import(`@inkathon/contracts/deployments/${contractId}/${network}.ts`))
.address,
})
const abi = await import(`@inkathon/contracts/deployments/${contractId}/${contractId}.json`)
const { address } = await import(
`@inkathon/contracts/deployments/${contractId}/${networkId}.ts`
)

deployments.push({ contractId, networkId, abi, address })
}
}

Expand Down

0 comments on commit 8740867

Please sign in to comment.