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

GetInvocationCounter #813

Merged
merged 12 commits into from Jun 13, 2019

Conversation

5 participants
@shargon
Copy link
Member

commented Jun 11, 2019

Close #307

@shargon shargon requested a review from erikzhang Jun 11, 2019

@vncoelho
Copy link
Member

left a comment

@shargon, this is an interesting thing, is there any use that you have already discussed?

}
else
{
engine.InvocationCounter[contract.ScriptHash] = 1;

This comment has been minimized.

Copy link
@vncoelho

vncoelho Jun 11, 2019

Member

Shargon, could this Dictionary be already initialized in 1 and avoid this if?

This comment has been minimized.

Copy link
@shargon

shargon Jun 11, 2019

Author Member

we need to increment the value, so you need to query the previous value

This comment has been minimized.

Copy link
@vncoelho

vncoelho Jun 11, 2019

Member

Yes, but I mean, for the first time initialize already with 1 and then just increment.

This comment has been minimized.

Copy link
@vncoelho

vncoelho Jun 11, 2019

Member

This would simplify the if.

This comment has been minimized.

Copy link
@shargon

shargon Jun 12, 2019

Author Member

It's initialized to 1 when it is not found

Show resolved Hide resolved neo.UnitTests/UT_Syscalls.cs
@igormcoelho
Copy link
Contributor

left a comment

Shargon I'll review, but we also have a related interesting and complementary solution to this.

@igormcoelho

This comment has been minimized.

Copy link
Contributor

commented Jun 11, 2019

@shargon can you take a look at #814 ? I think its related.

@shargon

This comment has been minimized.

Copy link
Member Author

commented Jun 11, 2019

Is not related, is according to this issue #307

erikzhang and others added some commits Jun 12, 2019

@shargon

This comment has been minimized.

Copy link
Member Author

commented Jun 12, 2019

@erikzhang could you compute the gas cost?

shargon added some commits Jun 12, 2019

@codecov-io

This comment has been minimized.

Copy link

commented Jun 12, 2019

Codecov Report

Merging #813 into master will increase coverage by 0.4%.
The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #813     +/-   ##
=========================================
+ Coverage      38%   38.41%   +0.4%     
=========================================
  Files         176      176             
  Lines       12443    12459     +16     
=========================================
+ Hits         4729     4786     +57     
+ Misses       7714     7673     -41
Impacted Files Coverage Δ
neo/SmartContract/ApplicationEngine.cs 56.81% <100%> (+0.49%) ⬆️
neo/SmartContract/InteropService.cs 21.08% <86.66%> (+5.59%) ⬆️
neo/IO/Caching/DataCache.cs 61.27% <0%> (+4.04%) ⬆️
neo/VM/Helper.cs 18.7% <0%> (+9.67%) ⬆️
neo/Ledger/ContractState.cs 19.44% <0%> (+19.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 354563d...52cfa25. Read the comment docs.

Show resolved Hide resolved neo/SmartContract/ApplicationEngine.cs Outdated
Show resolved Hide resolved neo/SmartContract/InteropService.cs Outdated

shargon and others added some commits Jun 12, 2019

Update neo/SmartContract/ApplicationEngine.cs
Co-Authored-By: Erik Zhang <erik@neo.org>
Update neo/SmartContract/InteropService.cs
Co-Authored-By: Erik Zhang <erik@neo.org>

@shargon shargon merged commit fe3ab04 into neo-project:master Jun 13, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@shargon shargon deleted the shargon:invocation-counter branch Jun 13, 2019

@erikzhang erikzhang added this to the NEO 3.0 milestone Jun 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.