Open dansteren opened 11 months ago
After discussing as a team, we've decided that Result(Void, X)
is not valid. You should instead use Result(Null, X)
. Looking through the candid reference leaving out a value in a variant is the equivalent of null
. The lack of value is not valid. So, we'll continue that pattern.
So, the valid code would be:
import { Canister, Ok, Result, text, query, Void } from "azle";
export default Canister({
method: query([], Result(Null, text), () => {
return Ok(null);
}),
});
Only thing left is to update the documentation to add this caveat.
Given the following canister:
When running
dfx deploy
, Then I am expecting to have the canister build with the following candid file:But actually, it currently fails with this error: