pwasm-abi
pwasm-abi copied to clipboard
Add support for repr enums
Consider following code:
#[repr(u8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
enum MyEnum
{
A,
B,
C
}
#[eth_abi(TokenEndpoint, TokenClient)]
pub trait SampleContractInterface {
fn constructor(&mut self, myEnum: MyEnum);
}
Expected result: everything works
Actual result:
error: custom attribute panicked
--> src\lib.rs:65:5
|
65 | #[eth_abi(TokenEndpoint, TokenClient)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: message: Unable to handle param of type MyEnum: not supported by abi
error: aborting due to previous error
error: Could not compile `pwasm-abstractions-contract`.
Btw, u8/i8/u16/i16 types are "not supported by abi" too. I believe they should be here too.
Im getting similar error for string type. How did you resolved that error??