| 41 | } |
| 42 | |
| 43 | class 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 | |
| 62 | const _env = new HardhatTestEnvironment() |
| 63 | const getFieldValue = (field: ProcessedField, kind: TestValueKind) => _env.getFieldValue(field, kind); |
nothing calls this directly
no outgoing calls
no test coverage detected