-
Notifications
You must be signed in to change notification settings - Fork 77
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
Implement System.Callback.*
interops
#1238
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1238 +/- ##
==========================================
+ Coverage 62.86% 66.49% +3.63%
==========================================
Files 200 204 +4
Lines 17251 17297 +46
==========================================
+ Hits 10844 11501 +657
+ Misses 5823 5181 -642
- Partials 584 615 +31
Continue to review full report at Codecov.
|
pkg/core/interops.go
Outdated
{Name: "Neo.Crypto.CheckMultisigWithECDsaSecp256r1", Func: crypto.ECDSASecp256r1CheckMultisig, Price: 0, ParamCount: 1}, | ||
{Name: "Neo.Crypto.CheckMultisigWithECDsaSecp256k1", Func: crypto.ECDSASecp256k1CheckMultisig, Price: 0, ParamCount: 1}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For these two interops there should be at least 3 parameters, but there could be more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, there should be exactly 3 parameters. And we need to fix (s *Stack) PopSigElements()
function (just remove default
case, now both pubs and sigs are arrays), perhaps I missed that in the interop refactoring PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there are 3 parameters, but we don't need to remove the default case.
Parsing in C# code is a bit complicated, as "Array" can be unpacked. See https://github.com/neo-project/neo/blob/master/src/neo/SmartContract/ApplicationEngine.cs#L179
Remove interop-related structures from the `vm` package. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Support creating callbacks from pointers. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Get 2 contracts in pair which is useful everytime we need to test syscall with one contract calling the other. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Support creating callbacks from contract methods. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Allow to create callbacks from syscalls. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Specify DisallowCallback flag if syscall is not allowed to be used in a callback. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Allow to use them during verification.
Close #1197 .
Close #1237 .
Regarding syscalls, only parameter count is stored, as we don't need parameter types.