From 89272791ac02453e9a3f1183fa4107072ead5682 Mon Sep 17 00:00:00 2001 From: Carlos Medeiros Date: Tue, 17 Sep 2024 09:54:19 +0100 Subject: [PATCH] add zemu test --- tests_zemu/tests/masp.test.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests_zemu/tests/masp.test.ts b/tests_zemu/tests/masp.test.ts index bc67053..38e4199 100644 --- a/tests_zemu/tests/masp.test.ts +++ b/tests_zemu/tests/masp.test.ts @@ -167,4 +167,33 @@ describe('Masp', function () { await sim.close() } }) + + test.concurrent.each(MASP_MODELS)('Clean randomness Buffers', async function (m) { + const sim = new Zemu(m.path) + try { + await sim.start({ ...defaultOptions, model: m.name }) + const app = new NamadaApp(sim.getTransport()) + + const respSpend = await app.getSpendRandomness() + console.log(respSpend) + expect(respSpend.returnCode).toEqual(0x9000) + expect(respSpend.errorMessage).toEqual('No errors') + + const respOutput = await app.getOutputRandomness() + console.log(respOutput) + expect(respOutput.returnCode).toEqual(0x9000) + expect(respOutput.errorMessage).toEqual('No errors') + + const respRandomness = await app.getConvertRandomness() + console.log(respRandomness) + expect(respRandomness.returnCode).toEqual(0x9000) + expect(respRandomness.errorMessage).toEqual('No errors') + + const respClean = await app.cleanRandomnessBuffers() + console.log(respClean) + expect(respClean.returnCode).toEqual(0x9000) + } finally { + await sim.close() + } + }) })