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.
How to call it in the contract?😅
There was a problem hiding this comment.
Remove this method, it's not for normal contract.
There was a problem hiding this comment.
Need to support Update and Destroy.
|
According to neo-project/neo#2119, new native contract hash is: |
| 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.
Remove this two methods, which weren't defined for contract.
There was a problem hiding this comment.
If you remove these fields, the fifth field will become the third one, which will be incorrect.
There was a problem hiding this comment.
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 <38493437+superboyiii@users.noreply.github.com>
Co-authored-by: Owen Zhang <38493437+superboyiii@users.noreply.github.com>
…ct_CreateAndUpdate.cs Co-authored-by: Owen Zhang <38493437+superboyiii@users.noreply.github.com>
|
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? |
* Upgrade target framework. * Revert "Upgrade target framework." This reverts commit 6b0c49c. * Safe Attribute * Update Contract1.cs (#398) * Revert "publish neon to myget/github packages" (#395) * Remove Contract.Create、Contract.Update、Contract.Destroy; Add Contract.CallNative. * Update * remove CallNative * Update templates/Template.CSharp/Contract1.cs Co-authored-by: Owen Zhang <38493437+superboyiii@users.noreply.github.com> * Update templates/Template.CSharp/Contract1.cs Co-authored-by: Owen Zhang <38493437+superboyiii@users.noreply.github.com> * Update tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_CreateAndUpdate.cs Co-authored-by: Owen Zhang <38493437+superboyiii@users.noreply.github.com> * public * Update * Update call * Fix more UT * Update hashes * Mock contract create * Fix more UT * Fix UT * More fixes * More fixes * More UT * Fix UT's * dotnet-format * Fix Last test * Update * Remove private properties * Fixed UT * disable warning CS0626 Co-authored-by: Shargon <shargon@gmail.com> Co-authored-by: Owen Zhang <38493437+superboyiii@users.noreply.github.com> Co-authored-by: Erik Zhang <erik@neo.org>
* Upgrade target framework. * Revert "Upgrade target framework." This reverts commit 6b0c49c. * Safe Attribute * Update Contract1.cs (#398) * Revert "publish neon to myget/github packages" (#395) * Remove Contract.Create、Contract.Update、Contract.Destroy; Add Contract.CallNative. * Update * remove CallNative * Update templates/Template.CSharp/Contract1.cs Co-authored-by: Owen Zhang <38493437+superboyiii@users.noreply.github.com> * Update templates/Template.CSharp/Contract1.cs Co-authored-by: Owen Zhang <38493437+superboyiii@users.noreply.github.com> * Update tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_CreateAndUpdate.cs Co-authored-by: Owen Zhang <38493437+superboyiii@users.noreply.github.com> * public * Update * Update call * Fix more UT * Update hashes * Mock contract create * Fix more UT * Fix UT * More fixes * More fixes * More UT * Fix UT's * dotnet-format * Fix Last test * Update * Remove private properties * Fixed UT * disable warning CS0626 Co-authored-by: Shargon <shargon@gmail.com> Co-authored-by: Owen Zhang <38493437+superboyiii@users.noreply.github.com> Co-authored-by: Erik Zhang <erik@neo.org>
Remove
Contract.Create,Contract.Update,Contract.Destroy;AddContract.CallNative.