-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
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
Branch autogen entrypoint #67
Conversation
with params and without params. return void or return others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This idea is really good. Congratulation Lights.
I reviewed most of this PR in the other PR... but I didn't like that one 😂 hahaha we need testing in both ways: standard and non-standard entrypoints.
Very nice work @lightszero ! i love it! my only concern is about verification, how we can deal with this, i think that it should return false in verification. |
What about... public static bool onVerification()
{
// Logic here?
return false;
} |
this idea is from eric. |
err...,that is a question. as eric said all neo3 contract is Main(string,object[]) but how about verification? |
Congratulations for the idea @erikzhang 😂 if all is unified, fine. I think your case is not a problem Shargon, because the method would push0 , and conversion already knows its a bool type, and ot would be returned normally. The only "edge" case is a void metgod, which is being treated as "return false", right lights? This one is just when you dont declare your main, so it creates for you. The other PR is more problematic. |
//old test method still keep StackItem[] _params = new StackItem[] { "call02", new StackItem[] { "hello", 33 } }; var resultstack = testengine.ExecuteTestCase(_params); //new test method var result = testengine.ExecuteTestCaseStandard("call02", “hello",33); //new test method(another way) var result = testengine.GetMethod("call02").Run("hello",33);
I think we can merge this first. maybe add some attribute to help compiler like
|
I was thinking exactly in this, an attribute! |
For verification, you can write the |
We should also update the templates. |
But by default, should |
I think that unused functions should FAULT on Application. If we have exception handling, this would help creating "inheritance". I don't know the plan yet, but pehaps an "special" FAULT state... like |
already fault,but fault is not have param in neovm. we can not set a fault reason. |
I think that FAULT reason is more important for a better Exception handling... in the future. |
Just to clarify, the problem is the THROW itself... sometimes you want to invoke something, and if it fails, you proceed with other alternative. So, we actually need exception handling. I'm just mentioning here because it would be useful together with this feature here... but perhaps it's time to start thinking on strategies to allow exception handling on vm. |
if you do not write a Main function in smart contract.
now we can add one automatic: