MCPcopy Create free account
hub / github.com/d1ll0n/stack-packer / HardhatTestEnvironment

Class HardhatTestEnvironment

src/code-gen/test/hardhat.ts:43–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43class HardhatTestEnvironment extends TestEnvironment {
44 constructor() {
45 super(
46 HardhatElementaryValues,
47 );
48 }
49
50 public getCallWithAssignment(
51 contactName: string,
52 fn: string,
53 inputs: string[],
54 outputs: string[],
55 forceDestructuring?: boolean
56 ): ArrayJoinInput<string> {
57 const leftHandSide = outputs.length ? (outputs.length === 1 && !forceDestructuring ? `const ${outputs[0]} = ` : `const { ${outputs.join(", ")} } = `): '';
58 return [`${leftHandSide}await ${contactName}.${fn}(${inputs.join(", ")});`]
59 }
60}
61
62const _env = new HardhatTestEnvironment()
63const getFieldValue = (field: ProcessedField, kind: TestValueKind) => _env.getFieldValue(field, kind);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected