Chia-Network / clvm_tools_rs

clvm_tools ported to rust based on https://github.com/Chia-Mine/clvm_tools-js/, and chialisp-21 dialect with a new compiler.
Apache License 2.0
11 stars 13 forks source link

Allow overridable method delegation in downstream CompilerOpts implementations #85

Closed prozacchiwawa closed 5 months ago

prozacchiwawa commented 5 months ago

This adds an interposer which allows a CompilerOpts to be implemented as a wrapper around an existing CompilerOpts object and allows the user simultaneously to provide individual method overrides only where desired. This allows the interface for CompilerOpts to grow and change without imposing as much on downstream implementations. CompilerOpts provides file reading (and writing and file dates in the module system pr) which are used to delegate these functions in uncommon scenarios such as when we want to test how the compiler reacts to the presence or absence of files, or collect multiple outputs without writing to disk. The HasCompilerOptsDelegation trait has methods which provide default implementations for every method of CompilerOpts, but which the user can replace when they implement HasCompilerOptsDelegation. Having HasCompilerOptsDelegation automatically gives one a trait implementation for CompilerOpts which uses those overrides.

coveralls commented 5 months ago

Pull Request Test Coverage Report for Build 8820477360

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/compiler/comptypes.rs 108 174 62.07%
<!-- Total: 108 174 62.07% -->
Files with Coverage Reduction New Missed Lines %
src/compiler/sexp.rs 1 80.73%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 8805170223: -0.2%
Covered Lines: 15047
Relevant Lines: 18170

💛 - Coveralls