From 76acef18adbf5c3a1834f869c72538b8922b8974 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 21 Jul 2020 15:11:17 +0300 Subject: [PATCH] core: adjust System.Runtime.Platform interop Part of #1055. Added `Platform` method to compiler. --- pkg/compiler/syscall.go | 1 + pkg/interop/runtime/runtime.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/pkg/compiler/syscall.go b/pkg/compiler/syscall.go index 276acb26b..853c634f3 100644 --- a/pkg/compiler/syscall.go +++ b/pkg/compiler/syscall.go @@ -68,6 +68,7 @@ var syscalls = map[string]map[string]Syscall{ "CheckWitness": {"System.Runtime.CheckWitness", false}, "Log": {"System.Runtime.Log", false}, "Notify": {"System.Runtime.Notify", false}, + "Platform": {"System.Runtime.Platform", false}, }, "storage": { "ConvertContextToReadOnly": {"System.Storage.AsReadOnly", false}, diff --git a/pkg/interop/runtime/runtime.go b/pkg/interop/runtime/runtime.go index a45088e1b..ecc392d04 100644 --- a/pkg/interop/runtime/runtime.go +++ b/pkg/interop/runtime/runtime.go @@ -80,3 +80,9 @@ func GetNotifications(h []byte) [][]interface{} { func GetInvocationCounter() int { return 0 } + +// Platform returns the platform name, which is set to be `NEO`. This function uses +// `System.Runtime.Platform` syscall. +func Platform() []byte { + return nil +}