All files / src/codegen/generators constructorGen.ts

100% Statements 8/8
100% Branches 1/1
100% Functions 1/1
100% Lines 8/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  1x     1x   17x   17x 17x 4x   17x 17x    
import { ContractSchema } from "../contractSchema";
import { Generator, ind } from "../generator";
import { cleanAndCapitalizeFirstLetter } from "../utils";
 
export class ConstructorGen implements Generator {
    gen(schema: ContractSchema): string {
        let output = `` +
        `constructor(address _manager, address _owner)\n`;
        output += `    Patchwork721("${schema.scopeName}", "${schema.name}", "${schema.symbol}", _manager, _owner)\n`;
        if (schema.hasLiteRef()) {
            output += `    PatchworkLiteRef()\n`;
        }
        output += `{}\n`;
        return ind(4, output);
    }
}