예제 #1
0
파일: Account.cs 프로젝트: zutobg/Meadow
        public byte[] ReadStorage(byte[] key)
        {
            // If we already have cached storage data, return it. Otherwise we'll need to cache some.
            if (!StorageCache.TryGetValue(key, out var val))
            {
                // We obtain the value from our storage trie, cache it, and decode it, as it's RLP encoded.
                byte[] value = StorageTrie.Get(key);
                if (value == null)
                {
                    val = null;
                }
                else
                {
                    val = RLP.Decode(value);
                }

                StorageCache[key] = val;
            }

            // Return our storage key.
            return(val);
        }