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

Read only methods #1049

Closed
wants to merge 16 commits into from
Closed

Read only methods #1049

wants to merge 16 commits into from

Conversation

shargon
Copy link
Member

@shargon shargon commented Aug 22, 2019

Close #927

TODO:

ContractManifest currentManifest = engine.Snapshot.Contracts.TryGet(engine.CurrentScriptHash)?.Manifest;

if (currentManifest != null && !currentManifest.CanCall(contract.Manifest, method.GetString()))
if (currentManifest != null && !currentManifest.CanCall(contract.Manifest, methodStr))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@neo-project/core @erikzhang current Manifest could be null? i think that it is a MUST

Suggested change
if (currentManifest != null && !currentManifest.CanCall(contract.Manifest, methodStr))
if (currentManifest == null || !currentManifest.CanCall(contract.Manifest, methodStr))

public static readonly uint System_Contract_Destroy = Register("System.Contract.Destroy", Contract_Destroy, 0_01000000, TriggerType.Application);
public static readonly uint System_Storage_GetContext = Register("System.Storage.GetContext", Storage_GetContext, 0_00000400, TriggerType.Application);
public static readonly uint System_Contract_Destroy = Register("System.Contract.Destroy", Contract_Destroy, 0_01000000, TriggerType.Application, true);
public static readonly uint System_Storage_GetContext = Register("System.Storage.GetContext", Storage_GetContext, 0_00000400, TriggerType.Application, true);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@igormcoelho I increased the scope not only for the storages, for destroy, update, and create too

@codecov-io
Copy link

codecov-io commented Aug 22, 2019

Codecov Report

Merging #1049 into master will increase coverage by 0.01%.
The diff coverage is 97.29%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1049      +/-   ##
==========================================
+ Coverage   61.34%   61.35%   +0.01%     
==========================================
  Files         195      196       +1     
  Lines       13407    13414       +7     
==========================================
+ Hits         8224     8230       +6     
- Misses       5183     5184       +1
Impacted Files Coverage Δ
neo/SmartContract/Native/Tokens/NeoToken.cs 53.21% <ø> (ø) ⬆️
neo/SmartContract/Native/Tokens/Nep5Token.cs 98.2% <ø> (ø) ⬆️
neo/SmartContract/Native/Tokens/GasToken.cs 48.78% <ø> (ø) ⬆️
neo/SmartContract/Native/PolicyContract.cs 94.23% <ø> (ø) ⬆️
neo/SmartContract/InteropService.NEO.cs 26.74% <100%> (ø) ⬆️
neo/SmartContract/ExecutionContextState.cs 100% <100%> (ø)
...eo/SmartContract/Native/ContractMethodAttribute.cs 100% <100%> (ø) ⬆️
neo/SmartContract/Native/NativeContract.cs 84.04% <100%> (ø) ⬆️
neo/SmartContract/InteropDescriptor.cs 96.15% <100%> (+0.32%) ⬆️
neo/SmartContract/Manifest/ContractManifest.cs 84.05% <100%> (ø) ⬆️
... and 3 more

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 b1a4d29...6107a8d. Read the comment docs.

@shargon shargon marked this pull request as ready for review August 23, 2019 13:20
@shargon shargon added this to the NEO 3.0 milestone Aug 24, 2019
@shargon shargon added the feature Type: Large changes or new features label Aug 24, 2019
@shargon
Copy link
Member Author

shargon commented Aug 24, 2019

Wrong rebased, closed in favor of #1052

@shargon shargon closed this Aug 24, 2019
@shargon shargon deleted the read-only branch August 24, 2019 07:00
@erikzhang erikzhang removed this from the NEO 3.0 milestone Aug 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Type: Large changes or new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

neo3 ABI readonly methods
3 participants