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

Create ManagementContract #2119

Merged
merged 22 commits into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/neo/SmartContract/Native/ManagementContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ internal ContractState GetContract(StoreView snapshot, UInt160 hash)
}

[ContractMethod(0, CallFlags.AllowModifyStates)]
private ContractState Deploy(ApplicationEngine engine, byte[] nefFile, byte[] manifest)
internal ContractState Deploy(ApplicationEngine engine, byte[] nefFile, byte[] manifest)
shargon marked this conversation as resolved.
Show resolved Hide resolved
{
if (!(engine.ScriptContainer is Transaction tx))
throw new InvalidOperationException();
Expand Down Expand Up @@ -90,7 +90,7 @@ private ContractState Deploy(ApplicationEngine engine, byte[] nefFile, byte[] ma
}

[ContractMethod(0, CallFlags.AllowModifyStates)]
private void Update(ApplicationEngine engine, byte[] nefFile, byte[] manifest)
internal void Update(ApplicationEngine engine, byte[] nefFile, byte[] manifest)
{
if (nefFile is null && manifest is null) throw new ArgumentException();

Expand Down
48 changes: 0 additions & 48 deletions tests/neo.UnitTests/Ledger/UT_ContractIdState.cs

This file was deleted.

1 change: 0 additions & 1 deletion tests/neo.UnitTests/Ledger/UT_ContractState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Neo.IO;
using Neo.IO.Json;
using Neo.Ledger;
using Neo.SmartContract;
using Neo.SmartContract.Manifest;
using System.IO;
Expand Down
2 changes: 0 additions & 2 deletions tests/neo.UnitTests/Persistence/UT_ReadOnlyView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ public void Stores()
Assert.AreEqual(UInt256.Zero, r.BlockHashIndex.Get().Hash);
Assert.AreEqual(uint.MaxValue, r.HeaderHashIndex.Get().Index);
Assert.AreEqual(UInt256.Zero, r.HeaderHashIndex.Get().Hash);
Assert.AreEqual(0, r.ContractId.Get().NextId);
Assert.AreEqual(0, r.Blocks.Find().Count());
Assert.AreEqual(0, r.Transactions.Find().Count());
Assert.AreEqual(0, r.Contracts.Find().Count());
Assert.AreEqual(0, r.Storages.Find().Count());
Assert.AreEqual(0, r.HeaderHashList.Find().Count());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Neo.Cryptography.ECC;
using Neo.Ledger;
using Neo.SmartContract;
using Neo.SmartContract.Manifest;
using System;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,9 @@ public StorageKey CreateStorageKey(byte prefix, byte[] key = null)
public class TestNep17Token : Nep17Token<NeoToken.NeoAccountState>
{
public override int Id => 0x10000005;

public override string Name => "testNep17Token";

public override string Symbol => throw new NotImplementedException();

public override byte Decimals => 8;
public override uint ActiveBlockIndex => 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ private class DummyNative : NativeContract
{
public override string Name => "Dummy";
public override int Id => 1;
public override uint ActiveBlockIndex => 0;

[ContractMethod(0, CallFlags.None)]
public void NetTypes(
Expand Down Expand Up @@ -138,8 +139,8 @@ public void TestTestCall()
public class TestNativeContract : NativeContract
{
public override string Name => "test";

public override int Id => 0x10000006;
public override uint ActiveBlockIndex => 0;

public void TestOnPersist(ApplicationEngine engine)
{
Expand Down