Skip to content
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

Merged
merged 41 commits into from
Dec 16, 2020
Merged

Conversation

chenzhitong
Copy link
Member

@chenzhitong chenzhitong commented Dec 7, 2020

Remove Contract.Create, Contract.Update, Contract.Destroy;
Add Contract.CallNative.

@chenzhitong
Copy link
Member Author

chenzhitong commented Dec 7, 2020

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);
Copy link
Contributor

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?😅

Copy link
Contributor

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.

Copy link
Contributor

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.

@ProDog
Copy link
Contributor

ProDog commented Dec 7, 2020

According to neo-project/neo#2119, new native contract hash is:

NEO hash: 0x74c21a1ca66b7a190bf2a65db83ba6fe550cea64
GAS hash: 0xb399c051778cf37a1e4ef88509b2e054d0420a32
ManagementContract hash: 0xdf18cb2476964c241558ed1e2e8881dcd2d50bde
Policy hash: 0xe8ff1989c19526f4d8102f226e2c6c993b63efe9
Designate hash: 0x7ab39c37afd995f2f947a7ecbf40e91307058595

@superboyiii superboyiii mentioned this pull request Dec 7, 2020
44 tasks
@@ -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; }
Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use private

Copy link
Member

@shargon shargon Dec 14, 2020

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

@shargon
Copy link
Member

shargon commented Dec 8, 2020

Wait for #391

@shargon
Copy link
Member

shargon commented Dec 13, 2020

Merge?

shargon
shargon previously approved these changes Dec 13, 2020
@superboyiii
Copy link
Member

superboyiii commented Dec 14, 2020

I found native hash was changed again in the latest neo master.

        ManagementContract      0xcd97b70d82d69adfcd9165374109419fade8d6ab
        NeoToken        0x0a46e2e37c9987f570b4af253fb77e7eef0f72b6
        GasToken        0xa6a6c15dcdc9b997dac448b6926522d22efeedfb
        PolicyContract  0xdde31084c0fdbebc7f5ed5f53a38905305ccee14
        OracleContract  0xb1c37d5847c2ae36bdde31d0cc833a7ad9667f8f
        DesignationContract     0xc0073f4c7069bf38995780c9da065f9b3949ea7a

Do you think it's good to be fixed in this PR or create another? @chenzhitong @shargon

shargon
shargon previously approved these changes Dec 14, 2020
shargon
shargon previously approved these changes Dec 14, 2020
@superboyiii
Copy link
Member

superboyiii commented Dec 15, 2020

Merge? It works well on mine.

shargon
shargon previously approved these changes Dec 15, 2020
@superboyiii
Copy link
Member

@erikzhang Could you review this?

@shargon shargon merged commit fac2847 into neo-project:master Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants