Require compiler
field in published artifacts for v3 (#1961)
This commit is contained in:
parent
6d6e7e1468
commit
a977957946
@ -7,6 +7,7 @@ export const REQUIRED_PROPERTIES: string[] = [
|
||||
'compilerOutput.evm.bytecode.object',
|
||||
'compilerOutput.abi',
|
||||
'compilerOutput.devdoc',
|
||||
'compiler',
|
||||
];
|
||||
|
||||
export const FORBIDDEN_PROPERTIES: string[] = [
|
||||
|
@ -29,6 +29,10 @@ describe('Contract Artifacts', () => {
|
||||
const missingRequiredPropertiesByArtifact: ObjectMap<string[]> = {};
|
||||
for (const [artifactName, artifact] of Object.entries(artifacts)) {
|
||||
for (const requiredProperty of REQUIRED_PROPERTIES) {
|
||||
// HACK (xianny): Remove after `compiler` field is added in v3.
|
||||
if (requiredProperty === 'compiler' && artifact.schemaVersion === '2.0.0') {
|
||||
continue;
|
||||
}
|
||||
const requiredValue = get(artifact, requiredProperty);
|
||||
if (requiredValue === undefined || requiredValue === '') {
|
||||
const previousMissing = missingRequiredPropertiesByArtifact[artifactName];
|
||||
|
Loading…
x
Reference in New Issue
Block a user