Skip to content

Commit

Permalink
Add srccompiler fix (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
maledorak authored Nov 24, 2023
1 parent 4136092 commit 2d68bd9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
13 changes: 7 additions & 6 deletions packages/srcmap-api/src/triggers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,23 @@ export const triggerSourceMapCompiler = async (_payload: ISrcMapApiPayload) => {
})

if (!payload.pathSourceData) {
const msg = '/Compiler Trigger/No source data found'
console.warn(payload.address, msg)
const message = '/Compiler Trigger/No source data found'
console.warn(payload.address, message)
return setDdbContractInfo({
...payload,
status: SrcMapStatus.COMPILATOR_TRIGGERRING_FAILED,
message: msg,
message,
})
}

if (!payload.compilerVersion) {
const msg = '/Compiler Trigger/No compiler version found'
console.warn(payload.address, msg)
const message = '/Compiler Trigger/No compiler version found'
console.warn(payload.address, message)
captureMessage(message, 'error')
return setDdbContractInfo({
...payload,
status: SrcMapStatus.COMPILATOR_TRIGGERRING_FAILED,
message: msg,
message,
})
}

Expand Down
2 changes: 1 addition & 1 deletion packages/srcmap-compiler/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export const compileFiles = async (
console.log(_payload.address, '/Compilation/Done')
const pathSourceMaps = await Promise.all(
sourceMaps.map(async (sourceMap) => {
const path = `contracts/${_payload.chainId}/${_payload.address}/source_maps/${sourceMap.fileName}`
const path = `contracts/${_payload.chainId}/${_payload.address}/source_maps/${sourceMap.fileName}_${sourceMap.contractName}`
await s3upload({
Key: path,
Bucket: BUCKET_NAME,
Expand Down
4 changes: 2 additions & 2 deletions packages/srcmap-compiler/src/solc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as solc from 'solcv0.8.9'
import * as solc from 'solcv0.8.22'

export const solcVersion = 'v0.8.9'
export const solcVersion = 'v0.8.22'
export default solc
2 changes: 1 addition & 1 deletion packages/srcmap-compiler/types/solc.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
declare module 'solcv0.8.9' {
declare module 'solcv0.8.22' {
export function compile(input: string): string
}

0 comments on commit 2d68bd9

Please sign in to comment.