-
Notifications
You must be signed in to change notification settings - Fork 102
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
Sync update with neo pull 2119 #402
Conversation
merge from origin
This reverts commit 6b0c49c.
The test needs to be combined with neo-project/neo#2119 |
[Syscall("System.Contract.Destroy")] | ||
public static extern void Destroy(); | ||
[Syscall("System.Contract.CallNative")] | ||
public static extern object CallNative(string name); |
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.
How to call it in the contract?😅
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.
Remove this method, it's not for normal contract.
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.
Need to support Update
and Destroy
.
According to neo-project/neo#2119, new native contract hash is:
|
@@ -9,6 +9,8 @@ public class GAS | |||
{ | |||
public static extern UInt160 Hash { [ContractHash] get; } | |||
public static extern string Name { get; } | |||
public static extern int Id { get; } | |||
public static extern uint ActiveBlockIndex { get; } |
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.
Remove this two methods, which weren't defined for contract.
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.
If you remove these fields, the fifth field will become the third one, which will be incorrect.
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.
We can use private
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.
I tested without ActiveBlockIndex
and it works well, I think that we should remove it. Please take a look @erikzhang
tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_CreateAndUpdate.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Owen Zhang <[email protected]>
Co-authored-by: Owen Zhang <[email protected]>
…ct_CreateAndUpdate.cs Co-authored-by: Owen Zhang <[email protected]>
Wait for #391 |
src/Neo.SmartContract.Framework/Services/Neo/ManagementContract.cs
Outdated
Show resolved
Hide resolved
Add Safe attribute
Merge? |
I found native hash was changed again in the latest neo master.
Do you think it's good to be fixed in this PR or create another? @chenzhitong @shargon |
Merge? It works well on mine. |
@erikzhang Could you review this? |
Remove
Contract.Create
,Contract.Update
,Contract.Destroy
;AddContract.CallNative
.