File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @bgd-labs/toolbox " : patch
3+ " @bgd-labs/cli " : patch
4+ ---
5+
6+ Fix codeDiffs when no compiler settings provided by the explorer
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ export function registerCodeDiff(program: Command) {
5656 )
5757 : parseEtherscanStyleSourceCode ( sources [ 0 ] . SourceCode ) ;
5858 const source2 : StandardJsonInput = (
59- sources [ 0 ] as BlockscoutStyleSourceCode
59+ sources [ 1 ] as BlockscoutStyleSourceCode
6060 ) . AdditionalSources
6161 ? parseBlockscoutStyleSourceCode (
6262 sources [ 1 ] as BlockscoutStyleSourceCode ,
Original file line number Diff line number Diff line change @@ -11,10 +11,10 @@ export async function diffCode(
1111) {
1212 const changes : Record < string , string > = { } ;
1313
14- // diff settings
14+ // diff settings (skip if either source doesn't have settings, e.g. some explorers don't return it)
1515 const settingsBefore = JSON . stringify ( before . settings , null , 2 ) ;
1616 const settingsAfter = JSON . stringify ( after . settings , null , 2 ) ;
17- if ( settingsBefore !== settingsAfter )
17+ if ( settingsBefore && settingsAfter && settingsBefore !== settingsAfter )
1818 changes . settings = createPatch ( "settings" , settingsBefore , settingsAfter ) ;
1919 const contractsBefore = await Promise . all (
2020 Object . entries ( before . sources ) . map ( async ( [ path , source ] ) => [
You can’t perform that action at this time.
0 commit comments