Skip to content

Commit

Permalink
Add UT
Browse files Browse the repository at this point in the history
  • Loading branch information
shargon committed Jul 5, 2024
1 parent 6a1a13b commit edba56b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/Neo.UnitTests/SmartContract/Native/UT_NativeContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,22 @@ public void TestActiveDeprecatedIn()
Assert.IsFalse(NativeContract.IsActive(new active() { ActiveIn = null, DeprecatedIn = Hardfork.HF_Cockatrice }, settings.IsHardforkEnabled, 20));
}

[TestMethod]
public void TestActiveDeprecatedInRoleManagement()
{
string json = UT_ProtocolSettings.CreateHKSettings("\"HF_Echidna\": 20");
var file = Path.GetTempFileName();
File.WriteAllText(file, json);
ProtocolSettings settings = ProtocolSettings.Load(file, false);
File.Delete(file);

var before = NativeContract.RoleManagement.GetContractState(settings.IsHardforkEnabled, 19);
var after = NativeContract.RoleManagement.GetContractState(settings.IsHardforkEnabled, 20);

Assert.AreEqual(2, before.Manifest.Abi.Events[0].Parameters.Length);
Assert.AreEqual(4, after.Manifest.Abi.Events[0].Parameters.Length);
}

[TestMethod]
public void TestGetContract()
{
Expand Down

0 comments on commit edba56b

Please sign in to comment.