Skip to content

Commit 2d42a67

Browse files
committed
Add FeeEstimator test case
1 parent 8818424 commit 2d42a67

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/generator_tests.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,21 @@ describe('Generator Tests', () => {
283283
});
284284

285285
describe('Trait Generation Tests', () => {
286+
it('should generate FeeEstimator', () => {
287+
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
288+
const config = new TestConfig(`${__dirname}/../res/lightning_01.h`);
289+
const parser = new Parser(config);
290+
parser.parse();
291+
292+
const generator = new TraitGenerator(config, new AuxiliaryArtifacts());
293+
const feeest = <RustTrait>parser.glossary['LDKFeeEstimator'];
294+
const output = generator.generateFileContents(feeest);
295+
296+
chai.expect(output).includes('public init() {');
297+
chai.expect(output).includes('self.cType = LDKFeeEstimator(');
298+
chai.expect(output).includes('get_est_sat_per_1000_weight: getEstSatPer1000WeightLambda,');
299+
chai.expect(output).includes('open func getEstSatPer1000Weight(confirmationTarget: ConfirmationTarget) -> UInt32 {');
300+
});
286301
it('should generate BaseSign completely', () => {
287302
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
288303
const config = new TestConfig(`${__dirname}/../res/lightning_01.h`);

0 commit comments

Comments
 (0)