From 0c243225e157ff752d4b4caf5250c81234732e04 Mon Sep 17 00:00:00 2001 From: Luchuan Date: Tue, 24 Nov 2020 16:59:24 +0800 Subject: [PATCH] Extend the return value of GetRequestsByUrl (#2091) --- src/neo/SmartContract/Native/Oracle/OracleContract.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/neo/SmartContract/Native/Oracle/OracleContract.cs b/src/neo/SmartContract/Native/Oracle/OracleContract.cs index 347803d076..80217a2c37 100644 --- a/src/neo/SmartContract/Native/Oracle/OracleContract.cs +++ b/src/neo/SmartContract/Native/Oracle/OracleContract.cs @@ -117,12 +117,12 @@ public OracleRequest GetRequest(StoreView snapshot, ulong id) return snapshot.Storages.Find(new KeyBuilder(Id, Prefix_Request).ToArray()).Select(p => (BitConverter.ToUInt64(p.Key.Key, 1), p.Value.GetInteroperable())); } - public IEnumerable GetRequestsByUrl(StoreView snapshot, string url) + public IEnumerable<(ulong, OracleRequest)> GetRequestsByUrl(StoreView snapshot, string url) { IdList list = snapshot.Storages.TryGet(CreateStorageKey(Prefix_IdList).Add(GetUrlHash(url)))?.GetInteroperable(); if (list is null) yield break; foreach (ulong id in list) - yield return snapshot.Storages[CreateStorageKey(Prefix_Request).Add(id)].GetInteroperable(); + yield return (id, snapshot.Storages[CreateStorageKey(Prefix_Request).Add(id)].GetInteroperable()); } private static byte[] GetUrlHash(string url)