Skip to content
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

Call _deploy during deploy and update #1933

Merged
merged 17 commits into from
Sep 21, 2020
Merged

Conversation

shargon
Copy link
Member

@shargon shargon commented Sep 14, 2020

Close #1932

@shargon shargon changed the title Call _initialize during deploy and update Call _deploy during deploy Sep 14, 2020
@erikzhang
Copy link
Member

void _deploy(bool updated);

@devhawk @shargon What do you think? If it is the first deployment, then updated is false. If it is an update, then updated is true.

@devhawk
Copy link
Contributor

devhawk commented Sep 15, 2020

I'd like to know more about what the NEON developer experience will be for authoring the _deploy method. Just write a method named _deploy? Attribute? Are we going to check to ensure the method has the correct signature?

Otherwise, looks good.

@shargon shargon changed the title Call _deploy during deploy Call _deploy during deploy and update Sep 15, 2020
@erikzhang
Copy link
Member

if (state.NeedCheckReturnValue)
if (context.EvaluationStack.Count == 0)
Push(StackItem.Null);
else if (context.EvaluationStack.Count > 1)
throw new InvalidOperationException();

_deploy() pushes a null onto the stack, which should be removed.

@shargon shargon merged commit b256992 into neo-project:master Sep 21, 2020
@shargon shargon deleted the call-init branch September 21, 2020 08:45
@erikzhang erikzhang added this to the NEO 3.0 milestone Sep 21, 2020
ShawnYun pushed a commit to ShawnYun/neo that referenced this pull request Jan 8, 2021
* Call _initialize during deploy and update

* Change to _deploy

* Remove var

* Remove args

* Reuse CallContractInternal()

* void _deploy(bool updated);

* Change push

* Unify it

* Fix needCheckReturnValue

* Add else

* Refactor needcheck return type

Co-authored-by: erikzhang <erik@neo.org>
cloud8little pushed a commit to cloud8little/neo that referenced this pull request Jan 24, 2021
* Call _initialize during deploy and update

* Change to _deploy

* Remove var

* Remove args

* Reuse CallContractInternal()

* void _deploy(bool updated);

* Change push

* Unify it

* Fix needCheckReturnValue

* Add else

* Refactor needcheck return type

Co-authored-by: erikzhang <erik@neo.org>
ixje added a commit to CityOfZion/neo-mamba that referenced this pull request Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OnDeploy operation
4 participants