-
Notifications
You must be signed in to change notification settings - Fork 79
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 NEP-24 #3560
manifest: support NEP-24 #3560
Conversation
40c7142
to
3a9fdda
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3560 +/- ##
==========================================
- Coverage 83.02% 82.97% -0.06%
==========================================
Files 334 335 +1
Lines 46543 46708 +165
==========================================
+ Hits 38643 38755 +112
- Misses 6326 6363 +37
- Partials 1574 1590 +16 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
3a9fdda
to
317b65d
Compare
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.
And you need to adjust
func comply(m *manifest.Manifest, checkNames bool, st *Standard) error { |
- Extend
standard.Standard
structure withRequired []string
field. This field includes standards required by this standard. - In
comply()
check that standards marked as "Required" are present in the manifest. No compliance check is needed for them, the presence check is enough since compliance is checked by the calling code for all standards.
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.
Also, the test of RPC bindings generator based on the existing NEP contract is missing, we discussed it in DM.
317b65d
to
4fc2373
Compare
4fc2373
to
d642090
Compare
d642090
to
8cf1b90
Compare
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.
Review is not finished, some new code is uploaded.
examples/nft-nd/nft.yml
Outdated
- name: RoyaltiesTransferred | ||
parameters: | ||
- name: royaltyToken | ||
type: Hash160 | ||
- name: royaltyRecipient | ||
type: Hash160 | ||
- name: buyer | ||
type: Hash160 | ||
- name: tokenId | ||
type: ByteArray | ||
- name: amount | ||
type: Integer |
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.
Not for the NEP11 contract itself, read the spec:
Marketplaces that support this standard MUST emit the event, RoyaltiesTransferred for each recipient, after sending a payment.
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.
so I should remove it from manifest/standard too?
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, it's not a part of the standard that belongs to the NEP11 contract itself. But it should be moved to a separate standard, ref. #3560 (comment).
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.
The test is not finished. I need a test with generated RPC bindings.
pkg/rpcclient/nep24/royalty.go
Outdated
var royalties []RoyaltyRecipient | ||
for _, item := range res.Stack { | ||
royalty, ok := item.Value().([]stackitem.Item) | ||
if !ok || len(royalty) != 2 { | ||
return nil, fmt.Errorf("invalid royalty structure: expected array of 2 items, got %d", len(royalty)) | ||
} | ||
var recipient RoyaltyRecipient | ||
err = recipient.FromStackItem(royalty) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to decode royalty detail: %w", err) | ||
} | ||
royalties = append(royalties, recipient) | ||
} |
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.
Waiting for the response.
What is your expected result? To me, the auto-generated code looks good although it does not includes named return structures, but it depends on the original contract. As I said earlier, it's a matter of separate issue anyway. |
b1d16d4
to
f3b7983
Compare
i have:
and:
and:
|
f3b7983
to
f27de7c
Compare
I wrongly passed as a config file to
|
You're not first one to do this, btw. @smallhive and @tatiana-nspcc both know it happens easily. Long-term this will be solved by removing binding configuration file because of NEP-25. |
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.
#3560 (comment) is still missing.
61e54e4
to
3214732
Compare
3214732
to
cbfda6a
Compare
80f6607
to
b49d9b6
Compare
7893dbd
to
0a9b4be
Compare
0a9b4be
to
1aadb3f
Compare
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.
Good.
1aadb3f
to
efe352b
Compare
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.
Good job, some minor changes are required, otherwise LGTM.
efe352b
to
04d28a6
Compare
`Required` contains standards that are required for this standard. Signed-off-by: Ekaterina Pavlova <[email protected]>
Close #3451 Signed-off-by: Ekaterina Pavlova <[email protected]>
Signed-off-by: Ekaterina Pavlova <[email protected]>
Signed-off-by: Ekaterina Pavlova <[email protected]>
04d28a6
to
b63c7aa
Compare
Close #3451
wrapper generates:
but it should be different.
add tests with
smartcontact/testdata/