Skip to content

Commit

Permalink
Handle case when libName is longer than 38 chars in SourcifyDBService…
Browse files Browse the repository at this point in the history
… conversion from library-map.json
  • Loading branch information
kuzdogan committed Jul 24, 2024
1 parent b7b18a7 commit 806221a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ export class SourcifyDatabaseService
} else {
// Solidity < 0.5.0 is __MyLib__________ (total 40 characters)
const libName = key.split(":")[1];
formattedKey = "__" + libName.padEnd(38, "_");
const trimmedLibName = libName.slice(0, 36); // in case it's longer
formattedKey = "__" + trimmedLibName.padEnd(38, "_");
}

Check warning on line 327 in services/server/src/server/services/storageServices/SourcifyDatabaseService.ts

View check run for this annotation

Codecov / codecov/patch

services/server/src/server/services/storageServices/SourcifyDatabaseService.ts#L323-L327

Added lines #L323 - L327 were not covered by tests
formattedLibraries[formattedKey] = value;
}
Expand Down

0 comments on commit 806221a

Please sign in to comment.