use super::*;
pub static SYSCALLS: Lazy<HashMap<[u8; 4], SyscallSpec>> = Lazy::new(|| {
let names = [
"System.Storage.GetContext",
"System.Storage.GetReadOnlyContext",
"System.Storage.AsReadOnly",
"System.Storage.Get",
"System.Storage.Put",
"System.Storage.Delete",
"System.Storage.Find",
"System.Iterator.Next",
"System.Iterator.Value",
"System.Crypto.CheckSig",
"System.Crypto.CheckMultisig",
"System.Contract.Call",
"System.Contract.GetCallFlags",
"System.Contract.CreateStandardAccount",
"System.Contract.CreateMultisigAccount",
"System.Runtime.GetTrigger",
"System.Runtime.Platform",
"System.Runtime.GetNetwork",
"System.Runtime.GetAddressVersion",
"System.Runtime.GetTime",
"System.Runtime.GetScriptContainer",
"System.Runtime.GetExecutingScriptHash",
"System.Runtime.GetCallingScriptHash",
"System.Runtime.GetEntryScriptHash",
"System.Runtime.LoadScript",
"System.Runtime.CheckWitness",
"System.Runtime.GetInvocationCounter",
"System.Runtime.GetRandom",
"System.Runtime.Log",
"System.Runtime.Notify",
"System.Runtime.GetNotifications",
"System.Runtime.GasLeft",
"System.Runtime.BurnGas",
"System.Runtime.CurrentSigners",
"System.Runtime.GetMsgValue",
];
let mut m = HashMap::new();
for name in names {
m.insert(
interop_id_bytes(name),
SyscallSpec {
id: interop_id_bytes(name),
name,
},
);
}
m
});
pub fn syscall_name(id: &[u8; 4]) -> Option<&'static str> {
SYSCALLS.get(id).map(|s| s.name)
}