-
Notifications
You must be signed in to change notification settings - Fork 81
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
manifest: support interface checking #1373
Conversation
Let's move compiler part out of this PR. We can't really change manifest checks now because neo-project/neo#1883 is not (yet) accepted (we can make it an extension, but it's not critical for us). |
OK, I see you're not changing contract deployment checks now, so this makes more sense as it is now. |
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.
Please fix the linter also.
@@ -104,3 +104,55 @@ func TestComlileAndInvokeFunction(t *testing.T) { | |||
require.Equal(t, []byte("on update|sub update"), res.Stack[0].Value()) | |||
}) | |||
} | |||
|
|||
func TestCompileExamples(t *testing.T) { |
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.
But we already have something like that in the compiler.
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.
It is here mainly to cover compiler options settings. Maybe we can cut this test to just 3 examples (both tokens and contract with invalid events).
There are some standards (NEP5, etc.) which impose some restrictions on what methods and events a contract must contain and their signatures. This commit supports checking if arbitrary manifest complies with the standard.
Check that emitted manifest complies with supported standards. This can be made a separate flag.
Check that all `Notify` invocations in source correspond to some event in manifest. Helpful for typos such as `transfer` instead of `Transfer`.
Codecov Report
@@ Coverage Diff @@
## master #1373 +/- ##
==========================================
+ Coverage 77.51% 77.62% +0.10%
==========================================
Files 233 235 +2
Lines 18647 18711 +64
==========================================
+ Hits 14455 14524 +69
+ Misses 3167 3162 -5
Partials 1025 1025
Continue to review full report at Codecov.
|
tv := c.typeAndValueOf(n.Args[0]) | ||
params := make([]string, 0, len(n.Args[1:])) | ||
for _, p := range n.Args[1:] { | ||
params = append(params, c.scTypeFromExpr(p)) |
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.
It's a little risky, but let's try doing that.
There are some standards (NEP5, etc.) which impose
some restrictions on what methods and events a contract
must contain and their signatures. This commit supports
checking if arbitrary manifest complies with the standard.