We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm not sure if I'm doing something wrong, but
Given an interface and two class implementations, one empty class and one class w/ one property (as per MyOptional example) https://github.com/bloxbean/cardano-client-lib/blob/fix/blueprint-sum-type-annotation/annotation-processor/src/test/java/com/bloxbean/cardano/client/plutus/annotation/processor/model/MyOptional.java
The code that is autogenerated has error.
The text was updated successfully, but these errors were encountered:
@nemo83 Currently @Constr annotation can only be applied to a class not interface. So in this case, you need to do something like this.
@Constr
public interface MyOptional { }
@Constr public class Some implements MyOptional { private BigInteger value; public BigInteger getValue() { return value; } public void setValue(BigInteger value) { this.value = value; } }
@Constr(alternative = 1) public class None implements MyOptional { }
Sorry, something went wrong.
What if you MyOption appears in another model object?
MyOption
EDIT:
By converting MyOption from interface to abstract class seemed to have done the trick.
interface
abstract class
Anyway, blueprint seems to be able to handle @Constr at interface level when for example you have a Redeemer which can be something like
Redeemer
pub type Redeemer { Withdraw, Spend(something: Int) }
The auto generated code is already:
@Constr public interface Redeemer { }
No branches or pull requests
I'm not sure if I'm doing something wrong, but
Given an interface and two class implementations, one empty class and one class w/ one property (as per MyOptional example) https://github.com/bloxbean/cardano-client-lib/blob/fix/blueprint-sum-type-annotation/annotation-processor/src/test/java/com/bloxbean/cardano/client/plutus/annotation/processor/model/MyOptional.java
The code that is autogenerated has error.
The text was updated successfully, but these errors were encountered: