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

interop: post-preview2 adjustment, part 3 #1221

Merged
merged 6 commits into from
Jul 23, 2020

Conversation

AnnaShaleva
Copy link
Member

@AnnaShaleva AnnaShaleva commented Jul 22, 2020

The third part of #1055.

  1. Neo.Crypto.RIPEMD160 was added. (closes Implement Neo.Crypto.RIPEMD160 syscall #1193)

  2. Were fixed:

System.Storage.GetContext
System.Storage.GetReadOnlyContext
System.Storage.Put
System.Storage.PutEx
Neo.Native.Deploy

  1. No errors in:

System.Storage.Delete
System.Storage.Find
System.Storage.Get
System.Storage.AsReadOnly
Neo.Crypto.VerifyWithECDsaSecp256r1
Neo.Crypto.VerifyWithECDsaSecp256k1
Neo.Crypto.CheckMultisigWithECDsaSecp256r1
Neo.Crypto.CheckMultisigWithECDsaSecp256k1
Neo.Crypto.SHA256

For the rest of them there are separate issues, so that' the last part of 1055.

Part of #1055.

Split methods, as they have a lot of common code. This also fixex nil
error of storageGetReadOnlyContext in case when contract does not have
storage.
Part of #1055.

Maximum storage key len has been changed. Also added maximum storage
value len restriction.
@AnnaShaleva AnnaShaleva self-assigned this Jul 22, 2020
pkg/compiler/codegen.go Outdated Show resolved Hide resolved
Copy link
Contributor

@fyrchik fyrchik left a comment

Choose a reason for hiding this comment

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

https://github.com/neo-project/neo/blob/master/src/neo/SmartContract/ApplicationEngine.Storage.cs#L113
StorageFlags is defined as a enum in C#, so any odd flag denotes const, not only 1.
Implementation of PutEx and docs should be fixed. Pre-defined constant flags will increase readability.

Part of #1055.

Added System.Storage.PutEx to compiler. Added StorageFlag in order to
denote whether item is constant or not.
Now it can be processed as a normal syscall.
Part of #1055.

It could be that context.Block is nill.
@AnnaShaleva AnnaShaleva force-pushed the neo3/interop/post-preview2_adjustment3 branch from f0b68aa to 6e44499 Compare July 22, 2020 13:58
@AnnaShaleva
Copy link
Member Author

https://github.com/neo-project/neo/blob/master/src/neo/SmartContract/ApplicationEngine.Storage.cs#L113
StorageFlags is defined as a enum in C#, so any odd flag denotes const, not only 1.
Implementation of PutEx and docs should be fixed. Pre-defined constant flags will increase readability.

Added StorageFlags, but not sure it's the right place for them.

@codecov
Copy link

codecov bot commented Jul 22, 2020

Codecov Report

Merging #1221 into master will increase coverage by 0.02%.
The diff coverage is 63.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1221      +/-   ##
==========================================
+ Coverage   66.92%   66.94%   +0.02%     
==========================================
  Files         199      199              
  Lines       16991    16997       +6     
==========================================
+ Hits        11371    11379       +8     
+ Misses       5008     5005       -3     
- Partials      612      613       +1     
Impacted Files Coverage Δ
pkg/compiler/analysis.go 95.18% <ø> (ø)
pkg/compiler/codegen.go 91.97% <ø> (-0.02%) ⬇️
pkg/core/interops.go 100.00% <ø> (ø)
pkg/core/native/interop.go 66.66% <0.00%> (ø)
pkg/interop/crypto/crypto.go 0.00% <0.00%> (ø)
pkg/interop/storage/storage.go 0.00% <0.00%> (ø)
pkg/core/interop_system.go 59.00% <50.00%> (+1.51%) ⬆️
pkg/core/interop/crypto/hash.go 100.00% <100.00%> (ø)
pkg/core/interop/crypto/interop.go 100.00% <100.00%> (ø)
pkg/rpc/client/wsclient.go 83.22% <0.00%> (-1.35%) ⬇️

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 d6342ab...6e44499. Read the comment docs.

@@ -35,6 +35,7 @@ var syscalls = map[string]map[string]Syscall{
"ECDSASecp256k1CheckMultisig": {"Neo.Crypto.CheckMultisigWithECDsaSecp256k1", false},
"ECDsaSecp256r1Verify": {"Neo.Crypto.VerifyWithECDsaSecp256r1", false},
"ECDSASecp256r1CheckMultisig": {"Neo.Crypto.CheckMultisigWithECDsaSecp256r1", false},
"RIPEMD160": {"Neo.Crypto.RIPEMD160", false},
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

There was a commit description that this commit closes 1193. Isn't it enough or I should create a separate PR for this?

@roman-khimov roman-khimov merged commit d8a1c3d into master Jul 23, 2020
@roman-khimov roman-khimov deleted the neo3/interop/post-preview2_adjustment3 branch July 23, 2020 17:35
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.

Implement Neo.Crypto.RIPEMD160 syscall
3 participants