compiler: add tests for native wrappers

This commit is contained in:
Evgeniy Stratonikov 2021-02-05 13:15:39 +03:00
parent 73a75cc27a
commit 6cf40749a9
2 changed files with 208 additions and 1 deletions

View file

@ -287,9 +287,14 @@ func isNativeHelpersPath(s string) bool {
// canConvert returns true if type doesn't need to be converted on type assertion.
func canConvert(s string) bool {
if len(s) != 0 && s[0] == '*' {
s = s[1:]
}
if isInteropPath(s) {
s = s[len(interopPrefix):]
return s != "/iterator.Iterator" && s != "/storage.Context"
return s != "/iterator.Iterator" && s != "/storage.Context" &&
s != "/native/ledger.Block" && s != "/native/ledger.Transaction" &&
s != "/native/management.Contract"
}
return true
}