Skip to content

Call _deploy during deploy and update#1933

Merged
shargon merged 17 commits intoneo-project:masterfrom
shargon:call-init
Sep 21, 2020
Merged

Call _deploy during deploy and update#1933
shargon merged 17 commits intoneo-project:masterfrom
shargon:call-init

Conversation

@shargon
Copy link
Copy Markdown
Member

@shargon shargon commented Sep 14, 2020

Close #1932

@shargon shargon requested a review from erikzhang September 14, 2020 13:41
@shargon shargon changed the title Call _initialize during deploy and update Call _deploy during deploy Sep 14, 2020
@erikzhang
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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