Skip to content

Commit

Permalink
Fix: ban notify from contract developer (#845)
Browse files Browse the repository at this point in the history
* ban  notify from contract developer

* fix ut

* Update src/Neo.SmartContract.Framework/Services/Runtime.cs

---------

Co-authored-by: Vitor Nazário Coelho <vncoelho@gmail.com>
Co-authored-by: Shargon <shargon@gmail.com>
  • Loading branch information
3 people committed Jan 2, 2024
1 parent 2e95da7 commit 5e61a31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/Neo.SmartContract.Framework/Services/Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ public static class Runtime
[Syscall("System.Runtime.Log")]
public static extern void Log(string message);

[Syscall("System.Runtime.Notify")]
public static extern void Notify(string eventName, object[] state);
// Events not present in the ABI were disabled in HF_Basilisk
// [Syscall("System.Runtime.Notify")]
// public static extern void Notify(string eventName, object[] state);

[Syscall("System.Runtime.BurnGas")]
public static extern void BurnGas(long gas);
Expand Down
2 changes: 1 addition & 1 deletion tests/Neo.SmartContract.Framework.UnitTests/SyscallTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void TestAllSyscalls()
HashSet<string> fwSyscalls = visitor.Visit(compilation.GlobalNamespace).ToHashSet();

fwSyscalls.SymmetricExceptWith(neoSyscalls);
if (fwSyscalls.Count > 0)
if (fwSyscalls.Count > 0 && fwSyscalls.All(p => !p.Equals("System.Runtime.Notify")))
{
Assert.Fail($"Unknown or unimplemented syscalls: {string.Join("\n", fwSyscalls)}");
}
Expand Down

0 comments on commit 5e61a31

Please sign in to comment.