Obsidian
Obsidian copied to clipboard
Static transaction code generation doesn't generate field
The following passes the Obsidian compiler just fine, but the Java compiler gives out an error because the field out
through which f
is invoked does not get generated.
main contract X {
static transaction f() returns int {
return 3;
}
transaction g() returns int {
return X.f();
}
}
:compileJava/chaincode/input/src/src/main/java/org/hyperledger/fabric/example/example/X.java:105: error: cannot find symbol
return X.out.f(__st);
You've encountered an unfortunate temporary special case in the compiler. We don't really have support for static transactions as you're asking for them.