IntersectMBO / plutus

The Plutus language implementation and tools
Apache License 2.0
1.57k stars 480 forks source link

End -to-end tests for modular exponentiation #6338

Open bezirg opened 4 months ago

bezirg commented 4 months ago

Once the modular exponentiation function has been fully implemented in Plutus Core and PlutusTx and costed we should add some end-to-end tests for it.

perturbing commented 4 months ago

I can help with this.

Here I use under the hood the modular exponentiation function to take a multiplicative inverse (recip), but it is expensive naively.

That is why here is I just bring the inverses into scope via the datum and check that they are inverses instead of doing the computation.