internal T GetObject <T>(string key)
        {
            byte[] keyBytes = Encoding.UTF8.GetBytes(key);
            byte[] bytes    = this.persistenceStrategy.FetchBytes(this.ContractAddress, keyBytes);

            if (bytes == null)
            {
                return(default(T));
            }

            return(serializer.Deserialize <T>(bytes, this.network));
        }
        private object GetStorageValue(SmartContractDataType dataType, byte[] bytes)
        {
            PersistentStateSerializer serializer = new PersistentStateSerializer();

            switch (dataType)
            {
            case SmartContractDataType.Address:
                return(serializer.Deserialize <Address>(bytes, this.network));

            case SmartContractDataType.Bool:
                return(serializer.Deserialize <bool>(bytes, this.network));

            case SmartContractDataType.Bytes:
                return(serializer.Deserialize <byte[]>(bytes, this.network));

            case SmartContractDataType.Char:
                return(serializer.Deserialize <char>(bytes, this.network));

            case SmartContractDataType.Int:
                return(serializer.Deserialize <int>(bytes, this.network));

            case SmartContractDataType.Long:
                return(serializer.Deserialize <long>(bytes, this.network));

            case SmartContractDataType.Sbyte:
                return(serializer.Deserialize <sbyte>(bytes, this.network));

            case SmartContractDataType.String:
                return(serializer.Deserialize <string>(bytes, this.network));

            case SmartContractDataType.Uint:
                return(serializer.Deserialize <uint>(bytes, this.network));

            case SmartContractDataType.Ulong:
                return(serializer.Deserialize <ulong>(bytes, this.network));
            }
            return(null);
        }