Closed malik672 closed 3 days ago
@clearloop this should be done
@clearloop this should be done
nice! you already got how it works! btw could you please check my template implementation in issue-275-template, especially the commit 339daeb
i8
, u8
...i64
, u64
zink/examples/addmod.rs
feel free to copy my previous code to your PR!
nice! you already got how it works! btw could you please check my template implementation in issue-275-template, especially the commit 339daeb
- we need to complete this interface for the rust primitive numbers, e.g
i8
,u8
...i64
,u64
- introduce a test in
zink/examples/addmod.rs
feel free to copy my previous code to your PR!
a macro would be good for this tbh
a macro would be good for this tbh
yes! feel free! you may interest with my template implementation for #252 as well e0e0f4b, there is a impl_byte
macro just like what we need here ^ ^
@clearloop didn't really get the test tbh
Almost there! when you run the tests, you can do
RUST_LOG=trace cargo nextest run --example addmod --nocapture
so you will see error failed to load contract
addmod_i32
- You should load
addmod
which is the name of the example, we're compiling each example as a contract, and with the logging you actually can debug what happened in the compiler- add
addmod
&mulmod
branches to HostFunc::TryFrom then we can emitADDMOD
&MULMOD
instead ofNOOP
, feel free to optimize theTryFrom
since our functions are increasing!see also my workaround based on your commits: c6a1e38
yeah just looked at it, that would be messy a bit
Resolves #275
0x30bE4D758d86cfb1Ae74Ae698f2CF4BA7dC8d693