Skip to content

Commit

Permalink
update exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim8y committed Oct 17, 2024
1 parent 3d8c357 commit 7fdc631
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/Neo.UnitTests/SmartContract/UT_InteropService.NEO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void TestContract_Create()
var manifest = TestUtils.CreateDefaultManifest();
Assert.ThrowsException<InvalidOperationException>(() => snapshotCache.DeployContract(null, nefFile, manifest.ToJson().ToByteArray(false)));
Assert.ThrowsException<ArgumentException>(() => snapshotCache.DeployContract(UInt160.Zero, nefFile, new byte[ContractManifest.MaxLength + 1]));
Assert.ThrowsException<InvalidOperationException>(() => snapshotCache.DeployContract(UInt160.Zero, nefFile, manifest.ToJson().ToByteArray(true), 10000000));
Assert.ThrowsException<VMUncatchableException>(() => snapshotCache.DeployContract(UInt160.Zero, nefFile, manifest.ToJson().ToByteArray(true), 10000000));

var script_exceedMaxLength = new NefFile()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Neo.UnitTests/SmartContract/UT_InteropService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ public void TestContract_Call()
state.Manifest.Permissions[0].Methods = WildcardContainer<string>.Create("a");
engine.SnapshotCache.DeleteContract(state.Hash);
engine.SnapshotCache.AddContract(state.Hash, state);
Assert.ThrowsException<InvalidOperationException>(() => engine.CallContract(state.Hash, method, CallFlags.All, args));
Assert.ThrowsException<VMUncatchableException>(() => engine.CallContract(state.Hash, method, CallFlags.All, args));

state.Manifest.Permissions[0].Methods = WildcardContainer<string>.CreateWildcard();
engine.SnapshotCache.DeleteContract(state.Hash);
Expand All @@ -723,7 +723,7 @@ public void TestContract_Call()

engine.SnapshotCache.DeleteContract(state.Hash);
engine.SnapshotCache.AddContract(state.Hash, state);
Assert.ThrowsException<InvalidOperationException>(() => engine.CallContract(UInt160.Zero, method, CallFlags.All, args));
Assert.ThrowsException<VMUncatchableException>(() => engine.CallContract(UInt160.Zero, method, CallFlags.All, args));
}

[TestMethod]
Expand Down

0 comments on commit 7fdc631

Please sign in to comment.